Skip to content

Commit f72312c

Browse files
committed
Change required versions of numpy >= 2.0, required versions of python?=3.9, and required versions of torch >= 2.5. As this will ensure they can work together.
1 parent ab71703 commit f72312c

File tree

7 files changed

+16
-16
lines changed

7 files changed

+16
-16
lines changed

environment.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ channels:
66
dependencies:
77
- python>=3.9
88
#- numpy>=1.20,<=1.26.4
9-
- numpy>=1.20
9+
- numpy>=2.0
1010
- matplotlib
1111
- scipy
1212
- jupyter
@@ -17,7 +17,7 @@ dependencies:
1717
- setuptools
1818
- sympy
1919
- networkx
20-
- pytorch
20+
- pytorch>=2.5
2121
- numba
2222
- cvxpy
2323
# make html in docs folder

environment_w_extras.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ channels:
66
dependencies:
77
- python>=3.9
88
#- numpy>=1.20,<=1.26.4
9-
- numpy>=1.20
9+
- numpy>=2.0
1010
- matplotlib
1111
- scipy
1212
- jupyter
@@ -17,7 +17,7 @@ dependencies:
1717
- setuptools
1818
- sympy
1919
- networkx
20-
- pytorch
20+
- pytorch>=2.5
2121
- numba
2222
- cvxpy
2323
# gpu support

pyapprox/surrogates/affine/linearsystemsolvers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1354,7 +1354,7 @@ def _constraint_bounds(self):
13541354
)
13551355

13561356

1357-
class BasisPursuitDensoisingCVXRegressionSolver(
1357+
class BasisPursuitDenoisingCVXRegressionSolver(
13581358
CVXOPTOptionsMixin, LinearSystemSolver
13591359
):
13601360
def __init__(self, penalty: float, backend: BackendMixin = NumpyMixin):

pyapprox/surrogates/affine/tests/test_linsolvers.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
LinearlyConstrainedLstSqSolver,
99
OMPSolver,
1010
BasisPursuitRegressionSolver,
11-
BasisPursuitDensoisingCVXRegressionSolver,
11+
BasisPursuitDenoisingCVXRegressionSolver,
1212
QuantileRegressionSolver,
1313
EntropicLoss,
1414
EntropicRegressionSolver,
@@ -103,7 +103,7 @@ def test_basis_pursuit_denoising_cvxopt(self):
103103
true_coef[np.random.permutation(true_coef.shape[0])[:sparsity]] = 1.0
104104
vals = basis_matrix @ true_coef
105105

106-
solver = BasisPursuitDensoisingCVXRegressionSolver(0.001, backend=bkd)
106+
solver = BasisPursuitDenoisingCVXRegressionSolver(0.001, backend=bkd)
107107
solver.set_options(
108108
{"abstol": 1e-14, "reltol": 1e-14, "feastol": 1e-14}
109109
)

pyproject.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ requires = [
1111
name = "pyapprox"
1212
version = "1.0.3"
1313
description = "High-dimensional function approximation and estimation"
14-
requires-python = '>=3.6'
14+
requires-python = '>=3.9'
1515
license = {file = 'LICENSE'}
1616
readme = "README.md"
1717
authors = [
@@ -23,11 +23,11 @@ classifiers=[
2323
"Operating System :: OS Independent",
2424
]
2525
dependencies = [
26-
'numpy >= 1.20',
26+
'numpy >= 2.0',
2727
'matplotlib',
2828
'scipy >= 1.0.0',
2929
'sympy',
30-
'torch',
30+
'torch>=2.5',
3131
'coverage>=6.0',
3232
'pytest-cov',
3333
'pytest>=4.6',

setup.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
long_description_content_type="text/markdown",
2727
url="https://github.com/sandialabs/pyapprox",
2828
packages=setuptools.find_packages(),
29-
python_requires=">=3.8",
29+
python_requires=">=3.9",
3030
classifiers=[
3131
"Programming Language :: Python :: 3",
3232
"License :: OSI Approved :: MIT License",
@@ -36,16 +36,16 @@
3636
setup_requires=[
3737
"setuptools",
3838
# "numpy >= 1.20, <=1.26.4",
39-
"numpy >= 1.20",
39+
"numpy >= 2.0",
4040
"scipy >= 1.0.0",
4141
],
4242
install_requires=[
4343
# "numpy >= 1.20, <=1.26.4",
44-
"numpy >= 1.20",
44+
"numpy >= 2.0",
4545
"matplotlib",
4646
"scipy >= 1.0.0",
4747
"sympy",
48-
"torch",
48+
"torch>=2.5",
4949
# coverage > 6.0 causes a wierd bug with numpy
5050
# e.g
5151
# test_scipy_gauss_legendre_pts_wts_1D (__main__.TestNumpyUtilities)

tutorials/surrogates/plot_basis_pursuit_denoising.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@
102102
from pyapprox.util.backends.numpy import NumpyMixin as bkd
103103
from pyapprox.variables.joint import IndependentMarginalsVariable
104104
from pyapprox.surrogates.affine.linearsystemsolvers import (
105-
BasisPursuitDensoisingCVXRegressionSolver,
105+
BasisPursuitDenoisingCVXRegressionSolver,
106106
)
107107
from pyapprox.surrogates.univariate.orthopoly import (
108108
setup_univariate_orthogonal_polynomial_from_marginal,
@@ -144,7 +144,7 @@
144144
nsamples = 50
145145
train_samples = sampler(nsamples)
146146
train_values = model(train_samples)
147-
solver = BasisPursuitDensoisingCVXRegressionSolver(0.001, backend=bkd)
147+
solver = BasisPursuitDenoisingCVXRegressionSolver(0.001, backend=bkd)
148148
solver.set_options({"abstol": 1e-14, "reltol": 1e-14, "feastol": 1e-14})
149149
solver.set_weights(sampler.christoffel_function(train_samples))
150150
bexp.set_solver(solver)

0 commit comments

Comments
 (0)