Skip to content

Commit 59b6064

Browse files
kodiakhq[bot]jngrad
authored andcommitted
Update Python requirements (#4924)
Description of changes: - replace `np.product()` (deprecated in NumPy 1.15 and removed in NumPy 2.0) by `np.prod()` - bump Python version requirement of `requests` due to CVE-2024-35195 - adjust Python version requirements to resolve all dependency issues - `python3 -m pip install -r requirements.txt` now works again
1 parent 792f6b8 commit 59b6064

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

requirements.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# build system
2-
cython>=0.29.14,<3.0
2+
cython>=0.29.14,<3.0.10
33
# required scientific packages
4-
numpy>=1.17.4
4+
numpy>=1.17.4,<2.0
55
h5py>=2.7.1
66
# optional scientific packages
77
scipy>=1.4.0
@@ -13,8 +13,8 @@ vtk>=7.1.1
1313
PyOpenGL>=3.1.0
1414
pygame>=1.9.6
1515
# CI-related
16-
requests>=2.18.4 # to post on GitHub as espresso-ci
17-
lxml>=4.2.1 # to deploy tutorials
16+
requests>=2.32.0
17+
lxml>=4.2.1
1818
# sphinx and its dependencies
1919
sphinx>=2.3.0,!=3.0.0
2020
sphinx-toggleprompt==0.0.5

testsuite/python/cutoffs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ def test(self):
4242
fene = FeneBond(r_0=1, d_r_max=2, k=1)
4343
system.bonded_inter.add(fene)
4444
self.assertEqual(system.cell_system.max_cut_bonded, 3)
45-
n_nodes = np.product(system.cell_system.node_grid)
45+
n_nodes = np.prod(system.cell_system.node_grid)
4646
if n_nodes == 1:
4747
# Bonds don't influence interaction range
4848
self.assertEqual(system.cell_system.interaction_range, -1)

testsuite/python/lb_stats.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,9 @@ def test_mass_momentum_thermostat(self):
106106
fluid_temp += np.sum(np.copy(lb_node.velocity)**2) * dens
107107

108108
# Normalize
109-
fluid_mass /= np.product(self.lbf.shape)
109+
fluid_mass /= np.prod(self.lbf.shape)
110110
fluid_temp *= self.system.volume() / (
111-
3. * np.product(self.lbf.shape)**2)
111+
3. * np.prod(self.lbf.shape)**2)
112112

113113
# check mass conversation
114114
self.assertAlmostEqual(fluid_mass, self.params["dens"],

testsuite/python/particle.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ def test_vs_relative(self):
195195
self.assertEqual(res[0], 0, f"vs_relative: {res}")
196196
self.assertEqual(res[1], 5.0, f"vs_relative: {res}")
197197
np.testing.assert_allclose(
198-
res[2], np.array((0.5, -0.5, -0.5, -0.5)),
198+
np.copy(res[2]), np.array([0.5, -0.5, -0.5, -0.5]),
199199
err_msg=f"vs_relative: {res}", atol=self.tol)
200200
# check exceptions
201201
with self.assertRaisesRegex(ValueError, "needs input in the form"):

0 commit comments

Comments
 (0)