Skip to content

Commit

Permalink
[pre-commit.ci] pre-commit autoupdate (#61)
Browse files Browse the repository at this point in the history
* [pre-commit.ci] pre-commit autoupdate

updates:
- [github.com/pre-commit/pre-commit-hooks: v3.4.0 → v4.1.0](pre-commit/pre-commit-hooks@v3.4.0...v4.1.0)
- [github.com/psf/black: 21.12b0 → 22.3.0](psf/black@21.12b0...22.3.0)
- [github.com/nbQA-dev/nbQA: 0.8.0 → 1.3.1](nbQA-dev/nbQA@0.8.0...1.3.1)
- [github.com/macisamuele/language-formatters-pre-commit-hooks: v2.1.0 → v2.3.0](macisamuele/language-formatters-pre-commit-hooks@v2.1.0...v2.3.0)

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
pre-commit-ci[bot] committed Apr 11, 2022
1 parent 2336a10 commit 03432f5
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 20 deletions.
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ ci:
repos:

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.4.0
rev: v4.1.0
hooks:
- id: check-ast
- id: trailing-whitespace
Expand All @@ -30,12 +30,12 @@ repos:
- python

- repo: https://github.com/psf/black
rev: 21.12b0
rev: 22.3.0
hooks:
- id: black

- repo: https://github.com/nbQA-dev/nbQA
rev: 0.8.0
rev: 1.3.1
hooks:
- id: nbqa-black
additional_dependencies:
Expand All @@ -49,7 +49,7 @@ repos:
- --nbqa-mutate

- repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks
rev: v2.1.0
rev: v2.3.0
hooks:
- id: pretty-format-ini
args: [--autofix]
Expand Down
16 changes: 8 additions & 8 deletions plasmapy_nei/nei/nei.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,15 +88,15 @@ def __init__(

self._number_densities = {
elem: np.full((max_steps + 1, self.nstates[elem]), np.nan, dtype=np.float64)
* u.cm ** -3
* u.cm**-3
for elem in self.elements
}

self._n_elem = {
elem: np.full(max_steps + 1, np.nan) * u.cm ** -3 for elem in self.elements
elem: np.full(max_steps + 1, np.nan) * u.cm**-3 for elem in self.elements
}

self._n_e = np.full(max_steps + 1, np.nan) * u.cm ** -3
self._n_e = np.full(max_steps + 1, np.nan) * u.cm**-3
self._T_e = np.full(max_steps + 1, np.nan) * u.K
self._time = np.full(max_steps + 1, np.nan) * u.s

Expand Down Expand Up @@ -161,7 +161,7 @@ def _assign(
}

# Calculate the electron number density
n_e = 0.0 * u.cm ** -3
n_e = 0.0 * u.cm**-3
for elem in elements:
integer_charges = np.linspace(
0, self.nstates[elem] - 1, self.nstates[elem]
Expand Down Expand Up @@ -920,7 +920,7 @@ def n_input(self) -> u.Quantity:
def n_input(self, n: u.Quantity):
if isinstance(n, u.Quantity):
try:
n = n.to(u.cm ** -3)
n = n.to(u.cm**-3)
except u.UnitConversionError:
raise u.UnitsError("Invalid hydrogen density.")
if n.isscalar:
Expand All @@ -938,13 +938,13 @@ def n_input(self, n: u.Quantity):
bounds_error=False,
fill_value="extrapolate",
)
self._hydrogen_number_density = lambda time: f(time.value) * u.cm ** -3
self._hydrogen_number_density = lambda time: f(time.value) * u.cm**-3
self._n_input = n
elif callable(n):
if self.time_start is not None:
try:
n(self.time_start).to(u.cm ** -3)
n(self.time_max).to(u.cm ** -3)
n(self.time_start).to(u.cm**-3)
n(self.time_max).to(u.cm**-3)
except Exception:
raise ValueError("Invalid number density function.")
self._n_input = n
Expand Down
16 changes: 8 additions & 8 deletions plasmapy_nei/nei/tests/test_nei.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

time_array = np.array([0, 800]) * u.s
T_e_array = np.array([4e4, 6e4]) * u.K
n_array = np.array([1e9, 5e8]) * u.cm ** -3
n_array = np.array([1e9, 5e8]) * u.cm**-3


@pytest.fixture(
Expand Down Expand Up @@ -57,7 +57,7 @@
"inputs": inputs_dict,
"abundances": abundances,
"T_e": T_e_array,
"n": 1e9 * u.cm ** -3,
"n": 1e9 * u.cm**-3,
"time_input": time_array,
"time_start": 0 * u.s,
"time_max": 800 * u.s,
Expand All @@ -73,7 +73,7 @@
"inputs": inputs_dict,
"abundances": abundances,
"T_e": lambda time: 1e4 * (1 + time / u.s) * u.K,
"n": 1e15 * u.cm ** -3,
"n": 1e15 * u.cm**-3,
"time_max": 800 * u.s,
"max_steps": 2,
"dt": 100 * u.s,
Expand All @@ -87,7 +87,7 @@
"inputs": inputs_dict,
"abundances": abundances,
"T_e": 6e4 * u.K,
"n": lambda time: 1e9 * (1 + time / u.s) * u.cm ** -3,
"n": lambda time: 1e9 * (1 + time / u.s) * u.cm**-3,
"time_start": 0 * u.s,
"time_max": 800 * u.s,
"adapt_dt": False,
Expand All @@ -109,7 +109,7 @@
"Fe": 1e-4,
},
"T_e": 10001.0 * u.K,
"n": 1e13 * u.cm ** -3,
"n": 1e13 * u.cm**-3,
"time_max": 2e6 * u.s,
"tol": 1e-9,
"adapt_dt": False,
Expand All @@ -132,7 +132,7 @@
"S": 2e-6,
},
"T_e": 7e6 * u.K,
"n": 1e9 * u.cm ** -3,
"n": 1e9 * u.cm**-3,
"time_max": 1e8 * u.s,
"dt": 5e7 * u.s,
"max_steps": 3,
Expand All @@ -150,7 +150,7 @@
},
"abundances": {"H": 1, "He": 0.1, "O": 1e-4},
"T_e": 3e6 * u.K,
"n": 1e9 * u.cm ** -3,
"n": 1e9 * u.cm**-3,
"dt": 1e6 * u.s,
"time_start": 0 * u.s,
"time_max": 1e6 * u.s,
Expand All @@ -165,7 +165,7 @@
"inputs": ["H", "He"],
"abundances": {"H": 1, "He": 0.1},
"T_e": lambda t: u.K * (1e6 + 1.3e4 * np.sin(t.value)),
"n": 1e10 * u.cm ** -3,
"n": 1e10 * u.cm**-3,
"max_steps": 300,
"time_start": 0 * u.s,
"time_max": 2 * np.pi * u.s,
Expand Down

0 comments on commit 03432f5

Please sign in to comment.