diff --git a/.github/workflows/constraints.txt b/.github/workflows/constraints.txt index 178992a..22d5e21 100644 --- a/.github/workflows/constraints.txt +++ b/.github/workflows/constraints.txt @@ -1,5 +1,5 @@ pip==23.2.1 nox==2023.4.22 -poetry==1.6.1 +poetry==1.8.3 nox-poetry==1.0.3 virtualenv==20.24.5 diff --git a/.gitignore b/.gitignore index f76d312..b260fb8 100644 --- a/.gitignore +++ b/.gitignore @@ -12,4 +12,4 @@ venv __pycache__/ src/inductance/_version.py new_dipole.py -.DS_Store \ No newline at end of file +.DS_Store diff --git a/docs/conf.py b/docs/conf.py index 1652d8a..a6c2042 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -1,4 +1,5 @@ """Sphinx configuration.""" + project = "Inductance" author = "Darren Garnier" copyright = "2023, Darren Garnier" diff --git a/noxfile.py b/noxfile.py index 19cee54..0da75bd 100644 --- a/noxfile.py +++ b/noxfile.py @@ -1,4 +1,5 @@ """Nox sessions.""" + import os import shlex import shutil diff --git a/poetry.lock b/poetry.lock index 06ebd0e..7d35da6 100644 --- a/poetry.lock +++ b/poetry.lock @@ -2928,4 +2928,4 @@ test = ["big-O", "jaraco.functools", "jaraco.itertools", "jaraco.test", "more-it [metadata] lock-version = "2.0" python-versions = "^3.8" -content-hash = "6a32582be23480a032135e1e741e96f562b78ff28bb4bb8f623fd4baee0b8429" +content-hash = "fd8523279fb8c9e5710057b3245a5c02cb9b297b293d5250fca7a9d68872f1cf" diff --git a/pyproject.toml b/pyproject.toml index 5c4601e..cf78d06 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -19,9 +19,10 @@ numba = "^0.57" [tool.poetry.group.dev.dependencies] mpmath = "^1.0.0" -poetry = "^1.5.1" +poetry = "^1.8.3" +poetry-plugin-export = "^1.8.0" nox = "^2023.4.22" -nox-poetry = "^1.0.0" +nox-poetry = "^1.0.3" dunamai = "^1.17.0" Pygments = ">=2.10.0" black = ">=21.10b0" diff --git a/src/inductance/coils.py b/src/inductance/coils.py index 569936b..a1ddf57 100644 --- a/src/inductance/coils.py +++ b/src/inductance/coils.py @@ -8,6 +8,7 @@ Filaments are defined as an numpy 3 element vector - r, z, and n. """ + from __future__ import annotations import math diff --git a/src/inductance/mutual.py b/src/inductance/mutual.py index d67945c..5f0ec94 100644 --- a/src/inductance/mutual.py +++ b/src/inductance/mutual.py @@ -4,6 +4,7 @@ """ + import math import numpy as np diff --git a/src/inductance/self.py b/src/inductance/self.py index 19ff7c7..ce2fe36 100644 --- a/src/inductance/self.py +++ b/src/inductance/self.py @@ -19,6 +19,7 @@ numba-scipy can be fragile and sometimes needs to be "updated" before installation to the newest version of numba. """ + import math import numpy as np @@ -115,11 +116,7 @@ def L_lyle4(r, dr, dz, n): + 221 / 60 * c**2 ) ) - p4 = ( - 1 - / (2**11 * 3**2 * 5 * d**4) - * (-90 * b**4 + 105 * (b * c) ** 2 + 22 * c**4) - ) + p4 = 1 / (2**11 * 3**2 * 5 * d**4) * (-90 * b**4 + 105 * (b * c) ** 2 + 22 * c**4) q4 = ( 1 / (2**11 * 3**2 * 5 * d**4) @@ -128,9 +125,7 @@ def L_lyle4(r, dr, dz, n): - 69 / 28 * c**4 * v - u / 4 * (115 * b**4 - 480 * (b * c) ** 2) + 2**8 * w / 7 * (6 * b**4 - 7 * (b * c) ** 2) - - 1 - / (2**3 * 5 * 7) - * (36590 * b**4 - 2035 * (b * c) ** 2 - 11442 * c**4) + - 1 / (2**3 * 5 * 7) * (36590 * b**4 - 2035 * (b * c) ** 2 - 11442 * c**4) ) ) @@ -186,11 +181,7 @@ def L_lyle4_eq4(r, dr, dz, n): + 221 / 60 * c**2 ) ) - p4 = ( - 1 - / (2**11 * 3**2 * 5 * d**4) - * (-90 * b**4 + 105 * (b * c) ** 2 + 22 * c**4) - ) + p4 = 1 / (2**11 * 3**2 * 5 * d**4) * (-90 * b**4 + 105 * (b * c) ** 2 + 22 * c**4) q4 = ( 1 / (2**11 * 3**2 * 5 * d**4) @@ -199,9 +190,7 @@ def L_lyle4_eq4(r, dr, dz, n): - 69 / 28 * c**4 * v - u / 4 * (115 * b**4 - 480 * (b * c) ** 2) + 2**8 * w / 7 * (6 * b**4 - 7 * (b * c) ** 2) - - 1 - / (2**3 * 5 * 7) - * (36590 * b**4 - 2035 * (b * c) ** 2 - 11442 * c**4) + - 1 / (2**3 * 5 * 7) * (36590 * b**4 - 2035 * (b * c) ** 2 - 11442 * c**4) ) ) @@ -265,10 +254,7 @@ def L_lyle6(r, dr, dz, n): da2**3 * ( 3 * cd2**3 * (4308631 + 86520 * ML - 10052 * v) - - 14 - * bd2**2 - * cd2 - * (617423 + 289800 * ML + 579600 * u - 1474560 * w) + - 14 * bd2**2 * cd2 * (617423 + 289800 * ML + 579600 * u - 1474560 * w) + 21 * bd2**3 * (308779 + 63000 * ML + 43596 * u - 409600 * w) + 42 * bd2 * cd2**2 * (-8329 + 46200 * ML + 134400 * u - 172032 * w) ) @@ -327,10 +313,7 @@ def dLdR_lyle6(r, dr, dz, n): da2**3 * ( -3 * cd2**3 * (4291327 + 86520 * ML - 10052 * v) - + 14 - * bd2**2 - * cd2 - * (559463 + 289800 * ML + 579600 * u - 1474560 * w) + + 14 * bd2**2 * cd2 * (559463 + 289800 * ML + 579600 * u - 1474560 * w) - 21 * bd2**3 * (296179 + 63000 * ML + 43596 * u - 409600 * w) - 42 * bd2 * cd2**2 * (-17569 + 46200 * ML + 134400 * u - 172032 * w) ) @@ -372,9 +355,7 @@ def L_lyle6_appendix(r, dr, dz, n): 0 + (3633 / 10 * b**6 - 3220 * b**4 * c**2 + 2240 * b**2 * c**4) * u - (359 / 30) * c**6 * v - - 2**11 - * (5 / 3 * b**6 - 4 * b**4 * c**2 + 7 / 5 * b**2 * c**4) - * w + - 2**11 * (5 / 3 * b**6 - 4 * b**4 * c**2 + 7 / 5 * b**2 * c**4) * w + 2161453 / (2**3 * 3 * 5 * 7) * b**6 - 617423 / (2**2 * 3**2 * 5) * b**4 * c**2 - 8329 / (2**2 * 3 * 5) * b**2 * c**4 @@ -518,11 +499,7 @@ def _L_thin_wall_babic_akyel(r, _dr, dz, n): k2 = 1 / (1 + beta**2) elk, ele = ellipke(k2) k = np.sqrt(k2) - tk1 = ( - 4.0 - / (3 * np.pi * beta * k**3) - * ((2 * k2 - 1) * ele + (1 - k2) * elk - k**3) - ) + tk1 = 4.0 / (3 * np.pi * beta * k**3) * ((2 * k2 - 1) * ele + (1 - k2) * elk - k**3) eq8 = MU0 * (n**2) * r * np.pi / (2 * beta) * tk1 # eq 8 return eq8 diff --git a/src/inductance/utils.py b/src/inductance/utils.py index bf80e97..818d0b5 100644 --- a/src/inductance/utils.py +++ b/src/inductance/utils.py @@ -2,6 +2,7 @@ This module contains utility functions for inductance calculations. """ + import math import numpy as np diff --git a/tests/coverage_env.py b/tests/coverage_env.py index 8970172..647312f 100644 --- a/tests/coverage_env.py +++ b/tests/coverage_env.py @@ -1,4 +1,5 @@ """Disable Numba JIT when running coverage.""" + import os COVERAGE = os.getenv("COVERAGE_RUN", "")