Skip to content

Commit

Permalink
updated Python version requirements
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcusMNoack committed Sep 14, 2023
1 parent 486a2ff commit 1feff84
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 27 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/fvGP-CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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: |
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
6 changes: 2 additions & 4 deletions fvgp/.travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 3 additions & 5 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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={
Expand Down
16 changes: 8 additions & 8 deletions tests/test_fvgp.py
Original file line number Diff line number Diff line change
Expand Up @@ -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])))
Expand Down Expand Up @@ -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):
Expand All @@ -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
Expand All @@ -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)"]
Expand Down
6 changes: 2 additions & 4 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 1feff84

Please sign in to comment.