From 1feff8424584bdf578e14833001d80cc18a41400 Mon Sep 17 00:00:00 2001 From: Marcus Date: Thu, 14 Sep 2023 13:11:06 -0700 Subject: [PATCH] updated Python version requirements --- .github/workflows/fvGP-CI.yml | 6 +++--- CONTRIBUTING.rst | 2 +- fvgp/.travis.yml | 6 ++---- requirements.txt | 4 ++-- setup.py | 8 +++----- tests/test_fvgp.py | 16 ++++++++-------- tox.ini | 6 ++---- 7 files changed, 21 insertions(+), 27 deletions(-) diff --git a/.github/workflows/fvGP-CI.yml b/.github/workflows/fvGP-CI.yml index 753586e..2f7f77b 100644 --- a/.github/workflows/fvGP-CI.yml +++ b/.github/workflows/fvGP-CI.yml @@ -17,7 +17,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: [ '3.8', '3.9' ] + python-version: [ '3.9', '3.10' ] steps: - uses: actions/checkout@v2 @@ -52,10 +52,10 @@ jobs: steps: - uses: actions/checkout@v2 - - name: Setup Python 3.8 + - name: Setup Python 3.9 uses: actions/setup-python@v2 with: - python-version: '3.8' + python-version: '3.9' - name: Setup deploy run: | diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst index 17cceb3..1b3202c 100644 --- a/CONTRIBUTING.rst +++ b/CONTRIBUTING.rst @@ -102,7 +102,7 @@ Before you submit a pull request, check that it meets these guidelines: 2. If the pull request adds functionality, the docs should be updated. Put your new functionality into a function with a docstring, and add the feature to the list in README.rst. -3. The pull request should work for Python 3.5, 3.6, 3.7 and 3.8, and for PyPy. Check +3. The pull request should work for Python 3.9, 3.10, and for PyPy. Check https://travis-ci.com/MarcusMichaelNoack/fvgp/pull_requests and make sure that the tests pass for all supported Python versions. diff --git a/fvgp/.travis.yml b/fvgp/.travis.yml index a51bcd5..d0b62d7 100644 --- a/fvgp/.travis.yml +++ b/fvgp/.travis.yml @@ -2,10 +2,8 @@ language: python python: - - 3.8 - - 3.7 - - 3.6 - - 3.5 + - 3.10 + - 3.9 # Command to install dependencies, e.g. pip install -r requirements.txt --use-mirrors install: pip install -U tox-travis diff --git a/requirements.txt b/requirements.txt index d765247..4f2ce4c 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,8 +2,8 @@ wheel versioneer matplotlib plotly -scipy -numpy +scipy == 1.11.2 +numpy == 1.25.2 dask >= 2021.6.2 distributed >= 2021.6.2 hgdl == 2.1.2 diff --git a/setup.py b/setup.py index 5760cb2..1ba6480 100755 --- a/setup.py +++ b/setup.py @@ -28,17 +28,15 @@ setup( author="Marcus Michael Noack", author_email='MarcusNoack@lbl.gov', - python_requires='>=3.7', + python_requires='>=3.9', classifiers=[ 'Development Status :: 2 - Pre-Alpha', 'Intended Audience :: Developers', 'License :: OSI Approved :: GNU General Public License v3 (GPLv3)', 'Natural Language :: English', 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.5', - 'Programming Language :: Python :: 3.6', - 'Programming Language :: Python :: 3.7', - 'Programming Language :: Python :: 3.8', + 'Programming Language :: Python :: 3.9', + 'Programming Language :: Python :: 3.10', ], description="Python package for highly flexible function-valued Gaussian processes (fvGP)", entry_points={ diff --git a/tests/test_fvgp.py b/tests/test_fvgp.py index 23ce6f6..329a2d2 100755 --- a/tests/test_fvgp.py +++ b/tests/test_fvgp.py @@ -70,13 +70,13 @@ def test_single_task_init_advanced(self): def test_train_basic(self): my_gp1 = GP(input_dim, x_data, y_data, np.array([1, 1, 1, 1, 1, 1])) my_gp1.train(np.array([[0.01,1],[0.01,10],[0.01,10],[0.01,10],[0.01,10],[0.01,10]]), - method = "local", pop_size = 10, tolerance = 0.001,max_iter = 5) + method = "local", pop_size = 10, tolerance = 0.001,max_iter = 2) my_gp1.train(np.array([[0.01,1],[0.01,10],[0.01,10],[0.01,10],[0.01,10],[0.01,10]]), - method = "global", pop_size = 10, tolerance = 0.001,max_iter = 5) + method = "global", pop_size = 10, tolerance = 0.001,max_iter = 2) my_gp1.train(np.array([[0.01,1],[0.01,10],[0.01,10],[0.01,10],[0.01,10],[0.01,10]]), - method = "hgdl", pop_size = 10, tolerance = 0.001,max_iter = 5) + method = "hgdl", pop_size = 10, tolerance = 0.001,max_iter = 2) my_gp1.train(np.array([[0.01,1],[0.01,10],[0.01,10],[0.01,10],[0.01,10],[0.01,10]]), - method = "mcmc", pop_size = 10, tolerance = 0.001,max_iter = 5) + method = "mcmc", pop_size = 10, tolerance = 0.001,max_iter = 2) res = my_gp1.posterior_mean(np.random.rand(len(x_data),len(x_data[0]))) res = my_gp1.posterior_mean_grad(np.random.rand(10,len(x_data[0]))) @@ -128,7 +128,7 @@ def test_train_hgdl(self): my_gp2.train(np.array([[0.01,10],[0.01,10],[0.01,10],[0.01,10],[0.01,10],[0.01,10]]), - method = "hgdl", tolerance = 0.001, max_iter = 3) + method = "hgdl", tolerance = 0.001, max_iter = 2) def test_train_hgdl_async(self): @@ -152,12 +152,12 @@ def mkernel(x1,x2,hps,obj): my_fvgp = fvGP(input_dim,1,2, x_data, y_data, np.array([1, 1]), gp_kernel_function=mkernel) my_fvgp.train(np.array([[0.01,1],[0.01,10]]), - method = "global", pop_size = 10, tolerance = 0.001, max_iter = 5) + method = "global", pop_size = 10, tolerance = 0.001, max_iter = 2) def test_gp2Scale(self): client = Client() input_dim = 1 - N = 10000 + N = 2000 x_data = np.random.rand(N,input_dim) y_data = np.sin(np.linalg.norm(x_data,axis = 1) * 5.0) hps_n = 2 @@ -169,7 +169,7 @@ def test_gp2Scale(self): init_hps = np.random.uniform(size = len(hps_bounds), low = hps_bounds[:,0], high = hps_bounds[:,1]) my_gp2S = GP(1, x_data,y_data,init_hps, gp2Scale = True, gp2Scale_batch_size= 1000) - my_gp2S.train(hps_bounds, max_iter = 5, init_hyperparameters = init_hps) + my_gp2S.train(hps_bounds, max_iter = 2, init_hyperparameters = init_hps) x_pred = np.linspace(0,1,1000) mean1 = my_gp2S.posterior_mean(x_pred.reshape(-1,1))["f(x)"] diff --git a/tox.ini b/tox.ini index c447436..8355a2a 100644 --- a/tox.ini +++ b/tox.ini @@ -3,10 +3,8 @@ envlist = py35, py36, py37, py38, flake8 [travis] python = - 3.8: py38 - 3.7: py37 - 3.6: py36 - 3.5: py35 + 3.9: py39 + 3.10: py310 [testenv:flake8] basepython = python