Repository: fusion-energy/plasmaboundaries (language: python)

Issue:
removed _ from package name
Renaming occurrences of ```plasma_boundaries``` and ```plasma-boundaries``` to ```plasmaboundaries```.

This means the package name using in the pip install / conda install is the same as the import statement used elsewhere in the code


Discussion / hints:

Fix patch:
diff --git a/README.md b/README.md
index a1726ea..3f762d9 100644
--- a/README.md
+++ b/README.md
@@ -1,3 +1,8 @@
+[![CI with install](https://github.com/fusion-energy/plasmaboundaries/actions/workflows/ci_with_install.yml/badge.svg)](https://github.com/fusion-energy/plasmaboundaries/actions/workflows/ci_with_install.yml)
+
+[![Upload Python Package](https://github.com/fusion-energy/plasmaboundaries/actions/workflows/python-publish.yml/badge.svg)](https://github.com/fusion-energy/plasmaboundaries/actions/workflows/python-publish.yml)
+[![anaconda-publish](https://github.com/fusion-energy/plasmaboundaries/actions/workflows/anaconda-publish.yml/badge.svg)](https://github.com/fusion-energy/plasmaboundaries/actions/workflows/anaconda-publish.yml)
+
 # plasma-boundaries
 
 This code computes and plots analytical solutions of the Grad-Shafranov (GS)
@@ -10,18 +15,18 @@ Documentation can be found [here](https://plasma-boundaries.readthedocs.io/en/la
 ## Installation (Conda)
 You can install plasma-boundaries using [Conda](https://docs.conda.io/en/latest/) by running:
 ```bash
-conda install -c fusion-energy -c conda-forge plasma_boundaries
+conda install -c fusion-energy -c conda-forge plasmaboundaries
 ```
 
 ## Installation (pip)
 You can install plasma-boundaries using [Pip](https://pip.pypa.io/en/stable/) by running:
 ```bash
-pip install plasma_boundaries
+pip install plasmaboundaries
 ```
 
 Alternatively you can pip install from the repository:
 ```bash
-pip install git+https://github.com/fusion-energy/plasma_boundaries.git
+pip install git+https://github.com/fusion-energy/plasmaboundaries.git
 ```
 
 
@@ -30,13 +35,13 @@ pip install git+https://github.com/fusion-energy/plasma_boundaries.git
 First compute the magnetic flux <img src="https://render.githubusercontent.com/render/math?math=\Psi"> from plasma-boundaries based on a specific set of parameters.
 In this example, the built-in ITER plasma parameters will be used:
 ```python
-import plasma_boundaries
+import plasmaboundaries
 
 # plasma parameters
-params = plasma_boundaries.ITER
+params = plasmaboundaries.ITER
 
 # compute magnetic flux psi(R, z)
-psi = plasma_boundaries.compute_psi(params, config='double-null')
+psi = plasmaboundaries.compute_psi(params, config='double-null')
 ```
 
 The magnetic flux can now be calculated for any coordinates and plotted with matplotlib:
diff --git a/conda/meta.yaml b/conda/meta.yaml
index 4e9be90..7c8f5e3 100644
--- a/conda/meta.yaml
+++ b/conda/meta.yaml
@@ -1,4 +1,4 @@
-{% set name = "plasma_boundaries" %}
+{% set name = "plasmaboundaries" %}
 
 package:
   name: "{{ name|lower }}"
@@ -25,7 +25,7 @@ requirements:
 
 test:
   imports:
-    - plasma_boundaries
+    - plasmaboundaries
   requires:
     - pytest
   source_files:
@@ -37,13 +37,13 @@ test:
     - python examples/plot_NSTX.py
 
 about:
-  home: "https://github.com/fusion-energy/plasma_boundaries"
+  home: "https://github.com/fusion-energy/plasmaboundaries"
   license: MIT
   license_family: MIT
   license_file: LICENSE.txt
   doc_url: https://plasma-boundaries.readthedocs.io/en/latest/
-  dev_url: https://github.com/fusion-energy/plasma_boundaries
-  summary: plasma_boundaries - Determine plasma flux functions for various plasma parameters and plasma configurations.
+  dev_url: https://github.com/fusion-energy/plasmaboundaries
+  summary: plasmaboundaries - Determine plasma flux functions for various plasma parameters and plasma configurations.
 
 extra:
   recipe-maintainers:
diff --git a/docs/source/conf.py b/docs/source/conf.py
index a820fde..5a5948b 100644
--- a/docs/source/conf.py
+++ b/docs/source/conf.py
@@ -16,7 +16,7 @@
 
 # -- Project information -----------------------------------------------------
 
-project = 'plasma_boundaries'
+project = 'plasmaboundaries'
 copyright = '2020-2022, Rémi Delaporte-Mathurin'
 author = 'Rémi Delaporte-Mathurin'
 
diff --git a/docs/source/index.rst b/docs/source/index.rst
index 9aa7ac2..7339ea0 100644
--- a/docs/source/index.rst
+++ b/docs/source/index.rst
@@ -1,9 +1,9 @@
-.. plasma_boundaries documentation master file, created by
+.. plasmaboundaries documentation master file, created by
    sphinx-quickstart on Wed Jul 15 09:26:22 2020.
    You can adapt this file completely to your liking, but it should at least
    contain the root `toctree` directive.
 
-plasma_boundaries
+plasmaboundaries
 ============================================
 This code computes and plots analytical solutions of the Grad-Shafranov (GS) equation for studying plasma equilibrium, stability and transport in fusion reactors based on the work of A. Cerfon and J. Freidberg [1]_.
 
@@ -18,12 +18,12 @@ Installation
 -------------
 You can install plasma-boundaries using Pip_ by running:
 ::
-   pip install plasma_boundaries
+   pip install plasmaboundaries
 ::
 
 Alternatively you can clone the repository:
 ::
-   git clone https://github.com/fusion-energy/plasma_boundaries
+   git clone https://github.com/fusion-energy/plasmaboundaries
 ::
 
 Install the dependencies
@@ -34,16 +34,16 @@ Install the dependencies
 
 Usage
 -----
-First compute the magnetic flux :math:`\Psi` from plasma_boundaries based on a specific set of parameters.
+First compute the magnetic flux :math:`\Psi` from plasmaboundaries based on a specific set of parameters.
 In this example, the built-in ITER plasma parameters will be used:
 ::
-   import plasma_boundaries
+   import plasmaboundaries
 
    # plasma parameters
-   params = plasma_boundaries.ITER
+   params = plasmaboundaries.ITER
 
    # compute magnetic flux psi(R, z)
-   psi = plasma_boundaries.compute_psi(params, config='double-null')
+   psi = plasmaboundaries.compute_psi(params, config='double-null')
 ::
 
 The magnetic flux can now be calculated for any coordinates and plotted with matplotlib:
diff --git a/docs/source/magnetic_flux.rst b/docs/source/magnetic_flux.rst
index 9d7f32c..afca406 100644
--- a/docs/source/magnetic_flux.rst
+++ b/docs/source/magnetic_flux.rst
@@ -2,7 +2,7 @@ Magnetic Flux
 ========================
 
 
-.. automodule:: plasma_boundaries.magnetic_flux
+.. automodule:: plasmaboundaries.magnetic_flux
    :members:
    :undoc-members:
    :show-inheritance:
diff --git a/docs/source/model.rst b/docs/source/model.rst
index 948b128..d5f0e9c 100644
--- a/docs/source/model.rst
+++ b/docs/source/model.rst
@@ -1,7 +1,7 @@
 Plasmaboundaries Model
 ========================
 
-.. automodule:: plasma_boundaries.model
+.. automodule:: plasmaboundaries.model
    :members:
    :undoc-members:
    :show-inheritance:
diff --git a/examples/plot_ITER_plasmas.py b/examples/plot_ITER_plasmas.py
index e32c7a8..dd54197 100644
--- a/examples/plot_ITER_plasmas.py
+++ b/examples/plot_ITER_plasmas.py
@@ -9,10 +9,10 @@
 
 
 import numpy as np
-import plasma_boundaries
+import plasmaboundaries
 
 # plasma parameters
-params = plasma_boundaries.ITER
+params = plasmaboundaries.ITER
 
 fig, (ax1, ax2, ax3) = plt.subplots(1, 3, sharey=True, figsize=(10, 4.8))
 
@@ -21,7 +21,7 @@
     [ax1, ax2, ax3],
     ["non-null", "single-null", "double-null"]):
     # compute psi
-    psi = plasma_boundaries.compute_psi(params, config=config)
+    psi = plasmaboundaries.compute_psi(params, config=config)
 
     # plot the results
     xmin, xmax = 0.6, 1.35
diff --git a/examples/plot_NSTX.py b/examples/plot_NSTX.py
index 534a868..3e63083 100644
--- a/examples/plot_NSTX.py
+++ b/examples/plot_NSTX.py
@@ -9,10 +9,10 @@
 
 
 import numpy as np
-import plasma_boundaries
+import plasmaboundaries
 
 # plasma parameters
-params = [plasma_boundaries.NSTX_single_null, plasma_boundaries.NSTX_double_null]
+params = [plasmaboundaries.NSTX_single_null, plasmaboundaries.NSTX_double_null]
 
 fig, (ax1, ax2) = plt.subplots(1, 2, sharey=True, figsize=(10, 4.8))
 
@@ -23,7 +23,7 @@
         params):
 
     # compute psi
-    psi = plasma_boundaries.compute_psi(param, config=config)
+    psi = plasmaboundaries.compute_psi(param, config=config)
 
     # plot the results
     xmin, xmax = 0.1, 2
diff --git a/plasma_boundaries/__init__.py b/plasmaboundaries/__init__.py
similarity index 91%
rename from plasma_boundaries/__init__.py
rename to plasmaboundaries/__init__.py
index 50364bd..5068c03 100644
--- a/plasma_boundaries/__init__.py
+++ b/plasmaboundaries/__init__.py
@@ -4,7 +4,7 @@
 except (ModuleNotFoundError, ImportError):
     from importlib_metadata import version, PackageNotFoundError
 try:
-    __version__ = version("plasma_boundaries")
+    __version__ = version("plasmaboundaries")
 except PackageNotFoundError:
     from setuptools_scm import get_version
 
diff --git a/plasma_boundaries/magnetic_flux.py b/plasmaboundaries/magnetic_flux.py
similarity index 100%
rename from plasma_boundaries/magnetic_flux.py
rename to plasmaboundaries/magnetic_flux.py
diff --git a/plasma_boundaries/model.py b/plasmaboundaries/model.py
similarity index 96%
rename from plasma_boundaries/model.py
rename to plasmaboundaries/model.py
index 3e395fb..a05d958 100644
--- a/plasma_boundaries/model.py
+++ b/plasmaboundaries/model.py
@@ -1,4 +1,4 @@
-import plasma_boundaries
+import plasmaboundaries
 import numpy as np
 from scipy.optimize import fsolve
 import sympy as sp
@@ -57,9 +57,9 @@ def constraints(p, params, config):
 
     # create sympy expressions for derivatives
     def psi(x, y):
-        return plasma_boundaries.psi(x, y, p, params["A"], config, pkg='sp')
-    psi_x_sp, psi_y_sp = plasma_boundaries.derivatives(psi, 1)
-    psi_xx_sp, psi_yy_sp = plasma_boundaries.derivatives(psi, 2)
+        return plasmaboundaries.psi(x, y, p, params["A"], config, pkg='sp')
+    psi_x_sp, psi_y_sp = plasmaboundaries.derivatives(psi, 1)
+    psi_xx_sp, psi_yy_sp = plasmaboundaries.derivatives(psi, 2)
 
     psi_x, psi_y = val_from_sp(psi_x_sp), val_from_sp(psi_y_sp)
     psi_xx, psi_yy = val_from_sp(psi_xx_sp), val_from_sp(psi_yy_sp)
@@ -153,7 +153,7 @@ def compute_psi(params, config="non-null", return_coeffs=False):
     coefficients = fsolve(constraints, x_0, args=(params, config), xtol=10)
 
     def new_psi(X, Y, pkg='np'):
-        return plasma_boundaries.psi(
+        return plasmaboundaries.psi(
             X, Y, c_i=coefficients, A=params["A"], config=config, pkg=pkg)
 
     if return_coeffs:
diff --git a/plasma_boundaries/parameters.py b/plasmaboundaries/parameters.py
similarity index 100%
rename from plasma_boundaries/parameters.py
rename to plasmaboundaries/parameters.py
diff --git a/pyproject.toml b/pyproject.toml
index 3f88f65..2b3c87d 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -7,4 +7,4 @@ requires = [
 build-backend = "setuptools.build_meta"
 
 [tool.setuptools_scm]
-write_to = "plasma_boundaries/_version.py"
+write_to = "plasmaboundaries/_version.py"
diff --git a/setup.cfg b/setup.cfg
index 5fe75bc..41b49e4 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -1,11 +1,11 @@
 [metadata]
-name = plasma_boundaries
+name = plasmaboundaries
 author = Remi Delaporte-Mathurin
 author_email = rdelaportemathurin@gmail.com
 description = Determine plasma flux functions for various plasma parameters and plasma configurations
 long_description = file: README.md
 long_description_content_type = text/markdown
-url = https://github.com/fusion-energy/plasma_boundaries
+url = https://github.com/fusion-energy/plasmaboundaries
 license = MIT
 license_file = LICENSE.txt
 classifiers =
@@ -19,8 +19,8 @@ classifiers =
     License :: OSI Approved :: MIT License
     Operating System :: OS Independent
 project_urls =
-    Source = https://github.com/fusion-energy/plasma_boundaries
-    Tracker = https://github.com/fusion-energy/plasma_boundaries/issues
+    Source = https://github.com/fusion-energy/plasmaboundaries
+    Tracker = https://github.com/fusion-energy/plasmaboundaries/issues
 
 [options]
 packages = find:


Test patch:
diff --git a/tests/test_model.py b/tests/test_model.py
index f119f28..9ed3260 100644
--- a/tests/test_model.py
+++ b/tests/test_model.py
@@ -1,4 +1,4 @@
-import plasma_boundaries
+import plasmaboundaries
 
 import sympy as sp
 import numpy as np
@@ -34,7 +34,7 @@ def test_non_null():
         "elongation": 2
     }
     config = "non-null"
-    psi = plasma_boundaries.compute_psi(params, config=config)
+    psi = plasmaboundaries.compute_psi(params, config=config)
 
     x, y = sp.symbols("x y")
 
@@ -61,7 +61,7 @@ def test_single_null():
         "elongation": 2
     }
     config = "single-null"
-    psi = plasma_boundaries.compute_psi(params, config=config)
+    psi = plasmaboundaries.compute_psi(params, config=config)
 
     x, y = sp.symbols("x y")
 
@@ -90,7 +90,7 @@ def test_double_null():
         "elongation": 2
     }
     config = "double-null"
-    psi = plasma_boundaries.compute_psi(params, config=config)
+    psi = plasmaboundaries.compute_psi(params, config=config)
 
     x, y = sp.symbols("x y")
 
diff --git a/tests/test_version.py b/tests/test_version.py
index 9ff289d..af69291 100644
--- a/tests/test_version.py
+++ b/tests/test_version.py
@@ -1,10 +1,10 @@
 import pytest
-import plasma_boundaries
+import plasmaboundaries
 
 
 def test_version():
     """Check that __version__ exists and is correctly formatted"""
-    version = plasma_boundaries.__version__
+    version = plasmaboundaries.__version__
     # Ensure it is given as a string
     assert isinstance(version, str)
     # Ensure is has at least two parts -- major and minor version -- separated by '.'