Skip to content

Commit

Permalink
update tooling, black format changes
Browse files Browse the repository at this point in the history
  • Loading branch information
dgarnier committed Jun 4, 2024
1 parent 7e6c06f commit 87198f1
Show file tree
Hide file tree
Showing 11 changed files with 21 additions and 37 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/constraints.txt
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ venv
__pycache__/
src/inductance/_version.py
new_dipole.py
.DS_Store
.DS_Store
1 change: 1 addition & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Sphinx configuration."""

project = "Inductance"
author = "Darren Garnier"
copyright = "2023, Darren Garnier"
Expand Down
1 change: 1 addition & 0 deletions noxfile.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Nox sessions."""

import os
import shlex
import shutil
Expand Down
2 changes: 1 addition & 1 deletion poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 1 addition & 0 deletions src/inductance/coils.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
Filaments are defined as an numpy 3 element vector
- r, z, and n.
"""

from __future__ import annotations

import math
Expand Down
1 change: 1 addition & 0 deletions src/inductance/mutual.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"""

import math

import numpy as np
Expand Down
41 changes: 9 additions & 32 deletions src/inductance/self.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand All @@ -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)
)
)

Expand Down Expand Up @@ -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)
Expand All @@ -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)
)
)

Expand Down Expand Up @@ -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)
)
Expand Down Expand Up @@ -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)
)
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down
1 change: 1 addition & 0 deletions src/inductance/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
This module contains utility functions for inductance calculations.
"""

import math

import numpy as np
Expand Down
1 change: 1 addition & 0 deletions tests/coverage_env.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Disable Numba JIT when running coverage."""

import os

COVERAGE = os.getenv("COVERAGE_RUN", "")
Expand Down

0 comments on commit 87198f1

Please sign in to comment.