Skip to content

Commit

Permalink
Add python 3.12
Browse files Browse the repository at this point in the history
  • Loading branch information
fuodorov committed Aug 7, 2024
1 parent e23d316 commit e92bc3d
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 23 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11"]
python-version: ["3.10", "3.11", "3.12"]

steps:
- name: Checkout sources
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11"]
python-version: ["3.10", "3.11", "3.12"]

steps:
- name: Checkout sources
Expand Down
6 changes: 3 additions & 3 deletions redpic/accelerator/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,8 @@ def read_fields(beamline: dict, z: np.arange) -> interpolate.interp1d:
F_prime = F_prime + f_prime(z)

if not element.max_field == 0:
int_f = integrate.cumtrapz(f(z_data), z_data)[-1]
int_ff = integrate.cumtrapz(f(z_data) ** 2, z_data)[-1]
int_f = integrate.cumulative_trapezoid(f(z_data), z_data)[-1]
int_ff = integrate.cumulative_trapezoid(f(z_data) ** 2, z_data)[-1]
element.length = int_f**2 / int_ff
element.field = int_ff / int_f
element.z_start = element.z0 - element.length
Expand All @@ -131,7 +131,7 @@ def read_fields(beamline: dict, z: np.arange) -> interpolate.interp1d:
element.z_stop = element.z0

F = interpolate.interp1d(z, F, kind="cubic", fill_value=(0, 0), bounds_error=False)
F_int = integrate.cumtrapz(F(z), z)
F_int = integrate.cumulative_trapezoid(F(z), z)
F_prime = interpolate.interp1d(z, F_prime, kind="cubic", fill_value=(0, 0), bounds_error=False)
F_int = interpolate.interp1d(z[1:], F_int, kind="cubic", fill_value=(F_int[0], F_int[-1]), bounds_error=False)

Expand Down
12 changes: 6 additions & 6 deletions requirements/base.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
kenv==0.3.0.3
numba==0.59.1
numpy==1.26.0
pandas==2.0.3
periodictable==1.6.1
scipy==1.11.2
kenv>=0.3.0.3
numba>=0.59.1
numpy>=1.26.0
pandas>=2.0.3
periodictable>=1.6.1
scipy>=1.11.2
24 changes: 12 additions & 12 deletions requirements/dev.txt
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
-r ./base.txt

black==23.7.0
flake8==6.1.0
isort==5.12.0
jupyter==1.0.0
pylint==2.17.5
setuptools==65.5.1
twine==4.0.2
wheel==0.41.2
pytest==7.4.0
pytest_cov==4.1.0
holoviews==1.17.1
matplotlib==3.7.2
black>=23.7.0
flake8>=6.1.0
isort>=5.12.0
jupyter>=1.0.0
pylint>=2.17.5
setuptools>=65.5.1
twine>=4.0.2
wheel>=0.41.2
pytest>=7.4.0
pytest_cov>=4.1.0
holoviews>=1.17.1
matplotlib>=3.7.2
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Intended Audience :: Science/Research",
Expand Down

0 comments on commit e92bc3d

Please sign in to comment.