Skip to content

Commit

Permalink
dev: adding support for 3.11 (#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
eckelsjd committed Dec 19, 2023
1 parent 06c089a commit 3e809c1
Show file tree
Hide file tree
Showing 9 changed files with 38 additions and 130 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: ['3.12']
python-version: ['3.11', '3.12']
os: [ ubuntu-latest, macOS-latest, windows-latest ]
steps:
- uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion .idea/amisc.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
![Logo](https://raw.githubusercontent.com/eckelsjd/amisc/main/docs/assets/amisc_logo_text.svg)
[![pdm-managed](https://img.shields.io/badge/pdm-managed-blueviolet)](https://pdm-project.org)
[![PyPI](https://img.shields.io/pypi/v/amisc?logo=python&logoColor=%23cccccc)](https://pypi.org/project/amisc)
[![Python 3.12](https://img.shields.io/badge/python-3.12+-blue.svg?logo=python&logoColor=cccccc)](https://www.python.org/downloads/)
[![Python 3.11](https://img.shields.io/badge/python-3.11+-blue.svg?logo=python&logoColor=cccccc)](https://www.python.org/downloads/)
![Commits](https://img.shields.io/github/commit-activity/m/eckelsjd/amisc?logo=github)
![build](https://img.shields.io/github/actions/workflow/status/eckelsjd/amisc/deploy.yml?logo=github
)
Expand Down
142 changes: 26 additions & 116 deletions pdm.lock

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ authors = [
]
dependencies = [
"numpy>=1.26.2",
"matplotlib>=3.8.2",
"scipy>=1.11.4",
"scikit-learn>=1.3.2",
"networkx>=3.2.1",
"dill>=0.3.7",
"scipy>=1.11.4",
"matplotlib>=3.8.2",
]
requires-python = ">=3.12"
requires-python = ">=3.11"
readme = "docs/README.md"
license = {file = "LICENSE"}
keywords = ["surrogates", "multidisciplinary", "multifidelity", "adaptive", "collocation", "metamodeling"]
Expand Down
2 changes: 1 addition & 1 deletion src/amisc/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from amisc.interpolator import BaseInterpolator
from amisc.rv import BaseRV

__version__ = "0.1.2"
__version__ = "0.1.3"

# Custom types that are used frequently
IndexSet = list[tuple[tuple, tuple]]
Expand Down
2 changes: 1 addition & 1 deletion src/amisc/component.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ def __init__(self, x_vars: list[BaseRV] | BaseRV, model: callable,
self._model_kwargs = model_kwargs if model_kwargs is not None else {}
self.truth_alpha = truth_alpha
self.x_vars = x_vars if isinstance(x_vars, list) else [x_vars]
max_alpha = (2,)*len(truth_alpha) if max_alpha == () else max_alpha
max_alpha = truth_alpha if max_alpha == () else max_alpha
max_beta = (2,)*len(self.x_vars) if max_beta == () else max_beta
self.max_refine = list(max_alpha + max_beta) # Max refinement indices

Expand Down
8 changes: 3 additions & 5 deletions tests/test_system.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@

# TODO: Include a swap and insert component test

@pytest.mark.skipif(not sys.platform.startswith('linux'), reason='not sure why')
def test_fire_sat(plots=True):
# @pytest.mark.skipif(not sys.platform.startswith('linux'), reason='not sure why')
def test_fire_sat(plots=False):
"""Test the fire satellite coupled system from Chaudhuri (2018)"""
N = 100
surr = fire_sat_system(save_dir=Path('.'))
Expand All @@ -29,9 +29,7 @@ def test_fire_sat(plots=True):
xt = xt[use_idx, :]
yt = yt[use_idx, :]
test_set = {'xt': xt, 'yt': yt}
n_jobs = -1 if sys.platform.startswith('linux') else 1 # parallel on VM runners on Github get stuck for non-linux
surr.fit(max_iter=15, max_tol=1e-2, max_runtime=1/12, test_set=test_set, n_jobs=n_jobs,
num_refine=1000)
surr.fit(max_iter=15, max_tol=1e-2, max_runtime=1/12, test_set=test_set, n_jobs=-1, num_refine=1000)

ysurr = surr.predict(xt)
l2_error = np.sqrt(np.nanmean((ysurr-yt)**2, axis=0)) / np.sqrt(np.nanmean(yt**2, axis=0))
Expand Down

0 comments on commit 3e809c1

Please sign in to comment.