Skip to content

Commit

Permalink
ran nox.. not sure how to fix some things it's finding
Browse files Browse the repository at this point in the history
  • Loading branch information
dgarnier committed Jun 8, 2023
1 parent e2b3f03 commit a008250
Show file tree
Hide file tree
Showing 9 changed files with 531 additions and 346 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@
/docs/_build/
/src/*.egg-info/
__pycache__/
src/pysol/_version.py
10 changes: 6 additions & 4 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
{
"editor.tabCompletion": "on",
"diffEditor.codeLens": true,
"python.formatting.provider": "black"
}
"editor.tabCompletion": "on",
"diffEditor.codeLens": true,
"python.formatting.provider": "black",
"python.linting.flake8Enabled": true,
"python.linting.enabled": true
}
4 changes: 1 addition & 3 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,8 @@

import nox


try:
from nox_poetry import Session
from nox_poetry import session
from nox_poetry import Session, session
except ImportError:
message = f"""\
Nox failed to import the 'nox-poetry' package.
Expand Down
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,15 @@ license = "MIT"
python = "^3.8"
numpy = "^1.24"
numba = "^0.57"
click = "^8.0"

[tool.poetry.dev-dependencies]
poetry = "^1.4.0"
matplotlib = "^3.7.1"
jupyter-hdfscontents = "^0.2"
versioningit = "^2.2.0"
nox = "^2023.4.22"
nox-poetry = "^0.8.0"

[tool.versioningit.vcs]
# The method key:
Expand Down
76 changes: 43 additions & 33 deletions src/pysol/elliptics.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Follow Toshio Fukushima, "Precise and fast computation of a general incomplete
# Follow Toshio Fukushima, "Precise and fast computation of a general incomplete
# elliptic integral of second kind by half and double argument transformations"
# Journal of Computational and Applied Mathematics 235 (2011) 4140–4148
# DOI: https://doi.org/10.1090/S0025-5718-2011-02455-5
Expand All @@ -14,12 +14,22 @@

except ImportError:
from warnings import warn_explicit

warning = "Couldn't import Numba. Elliptic integrals will run slower than expected."
warn_explicit(warning, RuntimeWarning, "elliptics.py", 0)

def vectorize(*args, **kwargs):
if len(args) == 1 and len(kwargs) == 0 and callable(args[0]):
# called as @decorator
return args[0]
else:
# called as @decorator(*args, **kwargs)
return lambda f: f




def celbd(mc):
def celbd(mc): # noqa: C901
'''
!---------------------------------------------------------------------------
subroutine celbd(mc,elb,eld)
Expand Down Expand Up @@ -88,9 +98,9 @@ def celbd(mc):
elb = 1.e0
eld = 0.3862943611198906188344642429164e0 - 0.5e0 * log(mc)
elif mc < 0.1:
nome=mc*(Q1+mc*(Q2+mc*(Q3+mc*(Q4+mc*(Q5+mc*(Q6 \
+mc*(Q7+mc*(Q8+mc*(Q9+mc*(Q10+mc*(Q11+mc*(Q12 \
+mc*(Q13+mc*(Q14+mc*(Q15+mc*Q16)))))))))))))))
nome = mc * (Q1 + mc * (Q2 + mc * (Q3 + mc * (Q4 + mc * (Q5 + mc * (Q6 \
+ mc * (Q7 + mc * (Q8 + mc * (Q9 + mc * (Q10 + mc * (Q11 + mc * (Q12 \
+ mc * (Q13 + mc * (Q14 + mc * (Q15 + mc * Q16)))))))))))))))
if mc < 0.01:
dkkc = mc * (K1 + mc * (K2 + mc * (K3 + mc * (K4 + mc *
(K5 + mc *
Expand All @@ -103,37 +113,37 @@ def celbd(mc):
#
# (K'-1)/(pi/2)
#
dkkc= 0.01286425658832983978282698630501405107893e0 \
+mx*(0.26483429894479586582278131697637750604652e0 \
+mx*(0.15647573786069663900214275050014481397750e0 \
+mx*(0.11426146079748350067910196981167739749361e0 \
+mx*(0.09202724415743445309239690377424239940545e0 \
+mx*(0.07843218831801764082998285878311322932444e0 \
+mx*(0.06935260142642158347117402021639363379689e0 \
+mx*(0.06293203529021269706312943517695310879457e0 \
+mx*(0.05821227592779397036582491084172892108196e0 \
+mx*(0.05464909112091564816652510649708377642504e0 \
+mx*(0.05191068843704411873477650167894906357568e0 \
+mx*(0.04978344771840508342564702588639140680363e0 \
+mx*(0.04812375496807025605361215168677991360500e0 \
))))))))))))
dkkc = (0.01286425658832983978282698630501405107893e0
+ mx * (0.15647573786069663900214275050014481397750e0
+ mx * (0.11426146079748350067910196981167739749361e0
+ mx * (0.09202724415743445309239690377424239940545e0
+ mx * (0.07843218831801764082998285878311322932444e0
+ mx * (0.06935260142642158347117402021639363379689e0
+ mx * (0.06293203529021269706312943517695310879457e0
+ mx * (0.05821227592779397036582491084172892108196e0
+ mx * (0.26483429894479586582278131697637750604652e0
+ mx * (0.05464909112091564816652510649708377642504e0
+ mx * (0.05191068843704411873477650167894906357568e0
+ mx * (0.04978344771840508342564702588639140680363e0
+ mx * (0.04812375496807025605361215168677991360500e0
)))))))))))))
#
# (K'-E')/(pi/2)
#
dddc= 0.02548395442966088473597712420249483947953e0 \
+mx*(0.51967384324140471318255255900132590084179e0 \
+mx*(0.20644951110163173131719312525729037023377e0 \
+mx*(0.13610952125712137420240739057403788152260e0 \
+mx*(0.10458014040566978574883406877392984277718e0 \
+mx*(0.08674612915759188982465635633597382093113e0 \
+mx*(0.07536380269617058326770965489534014190391e0 \
+mx*(0.06754544594618781950496091910264174396541e0 \
+mx*(0.06190939688096410201497509102047998554900e0 \
+mx*(0.05771071515451786553160533778648705873199e0 \
+mx*(0.05451217098672207169493767625617704078257e0 \
+mx*(0.05204028407582600387265992107877094920787e0 \
+mx*(0.05011532514520838441892567405879742720039e0 \
))))))))))))
dddc = (0.02548395442966088473597712420249483947953e0
+ mx * (0.51967384324140471318255255900132590084179e0
+ mx * (0.20644951110163173131719312525729037023377e0
+ mx * (0.13610952125712137420240739057403788152260e0
+ mx * (0.10458014040566978574883406877392984277718e0
+ mx * (0.08674612915759188982465635633597382093113e0
+ mx * (0.07536380269617058326770965489534014190391e0
+ mx * (0.06754544594618781950496091910264174396541e0
+ mx * (0.06190939688096410201497509102047998554900e0
+ mx * (0.05771071515451786553160533778648705873199e0
+ mx * (0.05451217098672207169493767625617704078257e0
+ mx * (0.05204028407582600387265992107877094920787e0
+ mx * (0.05011532514520838441892567405879742720039e0
)))))))))))))

kkc = 1.e0 + dkkc
logq2 = -0.5e0 * log(nome)
Expand Down
Loading

0 comments on commit a008250

Please sign in to comment.