Skip to content

Commit e34ce02

Browse files
authored
Merge pull request #635 from bobmyhill/python_313
Allow numpy 2, python 3.13
2 parents 15d2d11 + f428368 commit e34ce02

File tree

6 files changed

+15
-11
lines changed

6 files changed

+15
-11
lines changed

.github/workflows/main.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838

3939
strategy:
4040
matrix:
41-
python-versions: ['3.9', '3.10', '3.11', '3.12']
41+
python-versions: ['3.9', '3.10', '3.11', '3.12', '3.13']
4242

4343
steps:
4444
- uses: actions/checkout@v4
@@ -65,7 +65,7 @@ jobs:
6565

6666
strategy:
6767
matrix:
68-
python-versions: ['3.9', '3.10', '3.11', '3.12']
68+
python-versions: ['3.9', '3.10', '3.11', '3.12', '3.13']
6969

7070
steps:
7171
- uses: actions/checkout@v4

examples/example_fit_composition.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,8 +191,8 @@
191191
# Create empty arrays to store the weight proportions of each phase,
192192
# and the principal uncertainties (we do not use the covariances here,
193193
# although they are calculated)
194-
weight_proportions = np.zeros((len(samples), len(phases))) * np.NaN
195-
weight_proportion_uncertainties = np.zeros((len(samples), len(phases))) * np.NaN
194+
weight_proportions = np.zeros((len(samples), len(phases))) * np.nan
195+
weight_proportion_uncertainties = np.zeros((len(samples), len(phases))) * np.nan
196196

197197
# Loop over the samples, fitting phase proportions
198198
# to the provided bulk composition

misc/benchmarks/slb_2024_benchmarks.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,16 +183,17 @@ def check_fig_3_fcc_ferric_fper():
183183
fper = SLB_2024.ferropericlase()
184184
mag = SLB_2024.smag()
185185

186+
fper.set_composition([0.0, 0.95, 0.01, 0.0, 0.04])
187+
186188
assemblage = simplify_composite_with_composition(
187189
Composite([fper]), {"Fe": 1.0, "O": 1.1}
188190
)
189191
fper = assemblage.phases[0]
190192

191193
composition = {"Fe": 1.0, "O": 1.0}
192194
assemblage = Composite([bcc, fper, mag], [0.5, 0.49, 0.01])
193-
fper.set_composition([0.05, 0.0, 0.95])
194195
equality_constraints = [["P", 1.0e5], ["phase_fraction", (mag, 0.0)]]
195-
sol = equilibrate(composition, assemblage, equality_constraints, tol=1.0e-5)
196+
sol = equilibrate(composition, assemblage, equality_constraints)
196197
T_a_wu_mag = sol[0].assemblage.temperature
197198
print(f"BCC-fper-mag triple point at 1 bar: {T_a_wu_mag:.2f} K")
198199

pyproject.toml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,21 +15,22 @@ classifiers = [
1515
"Programming Language :: Python :: 3.10",
1616
"Programming Language :: Python :: 3.11",
1717
"Programming Language :: Python :: 3.12",
18+
"Programming Language :: Python :: 3.13",
1819
]
1920

2021
[tool.poetry.dependencies]
2122
python = "^3.8"
22-
numpy = "^1.24"
23+
numpy = ">=1.24,<=2.2"
2324
scipy = "^1.10"
2425
sympy = "^1.12"
2526
cvxpy = "^1.3"
2627
matplotlib = "^3.7"
27-
numba = "^0.59"
28+
numba = ">=0.59,<=0.61"
2829
pycddlib-standalone = {version = "^3.0", optional = true}
2930

3031
[tool.poetry.dev-dependencies]
3132
ipython = "^8.5"
32-
numba = "^0.59"
33+
numba = ">=0.59,<=0.61"
3334

3435
[tool.poetry.extras]
3536
dev = ["pycddlib-standalone"]

test.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,9 @@ fulldir=$2
5353
#echo "*** testing $t ..."
5454
($PYTHON <<EOF
5555
import matplotlib as m
56+
import numpy as np
5657
m.use('Template')
58+
np.set_printoptions(legacy='1.25')
5759
VERBOSE=1
5860
RUNNING_TESTS=1
5961
with open('$t') as f:

tutorial/tutorial_04_fitting.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -483,9 +483,9 @@
483483
"# Create empty arrays to store the weight proportions of each phase,\n",
484484
"# and the principal uncertainties (we do not use the covariances here,\n",
485485
"# although they are calculated)\n",
486-
"weight_proportions = np.zeros((len(samples), len(phases)))*np.NaN\n",
486+
"weight_proportions = np.zeros((len(samples), len(phases)))*np.nan\n",
487487
"weight_proportion_uncertainties = np.zeros((len(samples),\n",
488-
" len(phases)))*np.NaN\n",
488+
" len(phases)))*np.nan\n",
489489
"\n",
490490
"residuals = []\n",
491491
"# Loop over the samples, fitting phase proportions\n",

0 commit comments

Comments
 (0)