Skip to content

Commit

Permalink
Merge pull request #43 from PlasmaPy/pre-commit-ci-update-config
Browse files Browse the repository at this point in the history
  • Loading branch information
StanczakDominik authored Feb 16, 2021
2 parents 0ea5429 + 5b1d0bf commit 7c6700a
Show file tree
Hide file tree
Showing 16 changed files with 66 additions and 46 deletions.
2 changes: 1 addition & 1 deletion .codecov.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ coverage:
status:
project:
default:
threshold: 0.2%
threshold: 0.2%
2 changes: 1 addition & 1 deletion .codemeta.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,4 +72,4 @@
}
}
]
}
}
2 changes: 1 addition & 1 deletion .coveragerc
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ omit =
exclude_lines =
coverage: ignore
ImportError
ModuleNotFoundError
ModuleNotFoundError
2 changes: 1 addition & 1 deletion .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Create LFS file list
run: git lfs ls-files -l | cut -d ' ' -f1 | sort > .lfs-assets-id

Expand Down
10 changes: 5 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.3.0
rev: v3.4.0
hooks:
- id: check-yaml
- id: check-json
Expand All @@ -9,8 +9,8 @@ repos:
- id: trailing-whitespace
- id: check-ast
- id: requirements-txt-fixer
- repo: https://github.com/timothycrosley/isort
rev: 4.3.21-2
- repo: https://github.com/PyCQA/isort
rev: 5.7.0
hooks:
- id: isort
name: isort
Expand All @@ -20,11 +20,11 @@ repos:
types: [python]
args: [-m=3, -tc]
- repo: https://github.com/psf/black
rev: 19.3b0
rev: 20.8b1
hooks:
- id: black
- repo: https://gitlab.com/pycqa/flake8
rev: '3.7.9'
rev: '3.8.4'
hooks:
- id: flake8
additional_dependencies: [flake8-docstrings]
8 changes: 4 additions & 4 deletions LICENSE.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ modification, are permitted provided that the following conditions are met:
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

* Neither the name of PlasmaPy nor the names of its contributors may be used
to endorse or promote products derived from this software without specific
* Neither the name of PlasmaPy nor the names of its contributors may be used
to endorse or promote products derived from this software without specific
prior written permission.

Subject to the terms and conditions of this license, each copyright
Expand Down Expand Up @@ -44,8 +44,8 @@ expressly, by implication, estoppel or otherwise.
## Disclaimer

This software is provided by the copyright holders and contributors "as is"
and any express or implied warranties, including, but not limited to, the
implied warranties of merchantability and fitness for a particular purpose are
and any express or implied warranties, including, but not limited to, the
implied warranties of merchantability and fitness for a particular purpose are
disclaimed. In no event shall the copyright holder or contributors be liable
for any direct, indirect, incidental, special, exemplary, or consequential
damages (including, but not limited to, procurement of substitute goods or
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Smithsonian Institution.
We love contributions! PlasmaPy-NEI is open source,
built on open source, and we'd love to have you in our community.

### Imposter syndrome disclaimer
### Imposter syndrome disclaimer

We want your help. No, really.

Expand Down
4 changes: 2 additions & 2 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

numpydoc
pillow
pytest
setuptools-scm
sphinx <= 2.4.4
sphinx-automodapi
sphinx-gallery
sphinx_rtd_theme
pytest
setuptools-scm
8 changes: 4 additions & 4 deletions licenses/PlasmaPy_license.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ modification, are permitted provided that the following conditions are met:
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

* Neither the name of PlasmaPy nor the names of its contributors may be used
to endorse or promote products derived from this software without specific
* Neither the name of PlasmaPy nor the names of its contributors may be used
to endorse or promote products derived from this software without specific
prior written permission.

Subject to the terms and conditions of this license, each copyright
Expand Down Expand Up @@ -44,8 +44,8 @@ expressly, by implication, estoppel or otherwise.
## Disclaimer

This software is provided by the copyright holders and contributors "as is"
and any express or implied warranties, including, but not limited to, the
implied warranties of merchantability and fitness for a particular purpose are
and any express or implied warranties, including, but not limited to, the
implied warranties of merchantability and fitness for a particular purpose are
disclaimed. In no event shall the copyright holder or contributors be liable
for any direct, indirect, incidental, special, exemplary, or consequential
damages (including, but not limited to, procurement of substitute goods or
Expand Down
3 changes: 1 addition & 2 deletions plasmapy_nei/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,4 @@
finally:
del warnings

from . import eigen
from . import nei
from . import eigen, nei
17 changes: 11 additions & 6 deletions plasmapy_nei/eigen/eigenclass.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@

__all__ = ["EigenData", "eigen_data_dict"]

import warnings

import astropy.units as u
import h5py
import numpy as np
from numpy import linalg as LA
import pkg_resources
import warnings
import astropy.units as u
from numpy import linalg as LA

try:
from plasmapy.particles import Particle, particle_input
Expand Down Expand Up @@ -169,11 +170,13 @@ def _load_data(self):
)

self._eigenvectors = np.ndarray(
shape=(self.ntemp, self.nstates, self.nstates), dtype=np.float64,
shape=(self.ntemp, self.nstates, self.nstates),
dtype=np.float64,
)

self._eigenvector_inverses = np.ndarray(
shape=(self.ntemp, self.nstates, self.nstates), dtype=np.float64,
shape=(self.ntemp, self.nstates, self.nstates),
dtype=np.float64,
)

self._ionization_rate[:, :] = c_rate[:, :]
Expand All @@ -196,7 +199,9 @@ def _load_data(self):
rarr = r_rate[temperature_index, :]

eqi = _get_equilibrium_charge_states(
carr, rarr, self.element.atomic_number,
carr,
rarr,
self.element.atomic_number,
)

for ion in range(1, self.nstates - 1):
Expand Down
17 changes: 9 additions & 8 deletions plasmapy_nei/eigen/tests/test_eigenclass.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@
except ImportError:
from plasmapy import particles as atomic

from plasmapy_nei.eigen import EigenData
import pytest
import numpy as np
import pytest

from plasmapy_nei.eigen import EigenData


@pytest.mark.parametrize("atomic_numb", np.arange(1, 30))
Expand Down Expand Up @@ -54,12 +55,12 @@ def time_advance_solver_for_testing(natom, te, ne, dt, f0, table):
@pytest.mark.parametrize("natom", [1, 2, 6, 7, 8])
def test_reachequlibrium_state(natom):
"""
Starting the random initial distribution, the charge states will reach
to equilibrium cases after a long time.
In this test, we set the ionization and recombination rates at
Te0=2.0e6 K and plasma density ne0=1.0e+7. A random charge states
distribution will be finally closed to equilibrium distribution at
2.0e6K.
Starting the random initial distribution, the charge states will reach
to equilibrium cases after a long time.
In this test, we set the ionization and recombination rates at
Te0=2.0e6 K and plasma density ne0=1.0e+7. A random charge states
distribution will be finally closed to equilibrium distribution at
2.0e6K.
"""
#
# Initial conditions, set plasma temperature, density and dt
Expand Down
25 changes: 19 additions & 6 deletions plasmapy_nei/nei/nei.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@
__all__ = ["NEI", "NEIError", "SimulationResults"]


import numpy as np
from typing import Union, Optional, List, Dict, Callable
from typing import Callable, Dict, List, Optional, Union

import astropy.units as u
import numpy as np
from scipy import interpolate, optimize

from plasmapy_nei.eigen import EigenData, eigen_data_dict

try:
Expand All @@ -16,7 +18,6 @@

import warnings


# TODO: Allow this to keep track of velocity and position too, and
# eventually to have density and temperature be able to be functions of
# position. (and more complicated expressions for density and
Expand Down Expand Up @@ -478,7 +479,11 @@ def __init__(
n_init = self.hydrogen_number_density(self.time_start)

self.initial = IonizationStates(
inputs=inputs, abundances=abundances, T_e=T_e_init, n=n_init, tol=tol,
inputs=inputs,
abundances=abundances,
T_e=T_e_init,
n=n_init,
tol=tol,
)

self.tol = tol
Expand Down Expand Up @@ -524,7 +529,9 @@ def __init__(
) from e

def equil_ionic_fractions(
self, T_e: u.Quantity = None, time: u.Quantity = None,
self,
T_e: u.Quantity = None,
time: u.Quantity = None,
) -> Dict[str, np.ndarray]:
"""
Return the equilibrium ionic fractions for a temperature or at
Expand Down Expand Up @@ -1178,7 +1185,13 @@ def _set_adaptive_timestep(self):

try:
new_dt = (
optimize.brentq(T_val, *dt_bounds, xtol=1e-14, maxiter=1000, disp=True,)
optimize.brentq(
T_val,
*dt_bounds,
xtol=1e-14,
maxiter=1000,
disp=True,
)
* u.s
)
except Exception as exc:
Expand Down
6 changes: 4 additions & 2 deletions plasmapy_nei/nei/tests/test_nei.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@
from plasmapy.atomic import IonizationStates, particle_symbol
except ImportError:
from plasmapy.particles import IonizationStates, particle_symbol
from plasmapy_nei.nei import NEI
from plasmapy_nei.eigen import EigenData

import numpy as np
import pytest

from plasmapy_nei.eigen import EigenData
from plasmapy_nei.nei import NEI

inputs_dict = {"H": [0.9, 0.1], "He": [0.5, 0.3, 0.2]}
abundances = {"H": 1, "He": 0.1}

Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ astropy >= 3.2
h5py >= 2.9
matplotlib >= 3.0
numpy >= 1.16
plasmapy >= 0.3.1
scipy >= 1.0
setuptools >= 41.2
plasmapy >= 0.3.1
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ packages = find:
python_requires = >=3.7
setup_requires =
setuptools_scm
install_requires =
install_requires =
astropy>=3.2
h5py
numpy>=1.16
Expand Down

0 comments on commit 7c6700a

Please sign in to comment.