Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 1 addition & 6 deletions .github/workflows/test_conda_install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,19 +31,14 @@ jobs:
- name: Install AMICI
shell: bash -l {0}
run: |
pip3 install -v ./python/sdist
pip3 install -v ./python/sdist[test]
- name: Show environment
shell: bash -l {0}
run: |
python -c "import os; import pprint; pprint.pprint(dict(os.environ))"
which cmake
which ninja
ls -l /Users/runner/miniconda3/envs/amici/bin || true
- name: Install test dependencies
shell: bash -l {0}
run: |
# Install test extras (pytest, scipy, etc.)
pip3 install pytest pytest-cov scipy h5py antimony
- name: Test import
shell: bash -l {0}
run: |
Expand Down
3 changes: 3 additions & 0 deletions pytest.ini
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ addopts = -vv --strict-markers --doctest-modules
filterwarnings =
# warnings are errors
error
# Unrelated to our code, unclosed SSL socket when downloading test assets
# (probably improper cleanup upstream in case of exceptions)
ignore:Exception ignored while finalizing socket:pytest.PytestUnraisableExceptionWarning
# Known issue with numpy under valgrind - don't error on this
once:Signature .* for <class 'numpy.longdouble'> does not match any known type. falling back to type probe function:UserWarning
# petab
Expand Down
26 changes: 21 additions & 5 deletions python/tests/test_sbml_import.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
from amici.testing import skip_on_valgrind
from conftest import MODEL_STEADYSTATE_SCALED_XML
from numpy.testing import assert_allclose, assert_array_equal
from requests import HTTPError


def simple_sbml_model():
Expand Down Expand Up @@ -649,16 +650,31 @@ def test_units(model_units_module):
)
def test_sympy_exp_monkeypatch(tempdir):
"""
This model contains a removeable discontinuity at t=0 that requires
This model contains a removable discontinuity at t=0 that requires
monkeypatching sympy.Pow._eval_derivative in order to be able to compute
non-nan sensitivities
"""
import pooch

model_file = pooch.retrieve(
url="https://www.ebi.ac.uk/biomodels/model/download/BIOMD0000000529.2?filename=BIOMD0000000529_url.xml",
known_hash="md5:c6e0b298397485b93d7acfab80b21fd4",
)
downloader = pooch.HTTPDownloader(headers={"User-Agent": "Mozilla/5.0"})

try:
model_file = pooch.retrieve(
url="https://www.biomodels.org/model/download/BIOMD0000000529.2?filename=BIOMD0000000529_url.xml",
known_hash="md5:c6e0b298397485b93d7acfab80b21fd4",
downloader=downloader,
)
except HTTPError as e:
# When running on GHA, we might be subject to some rate limiting
# or similar. In that case, skip instead of failing.
if (
"GITHUB_ACTIONS" in os.environ
and e.response is not None
and e.response.status_code in {403, 429, 503}
):
pytest.skip(f"BioModels temporarily unavailable/rate-limited: {e}")
raise

importer = amici.SbmlImporter(model_file)
module_name = "BIOMD0000000529"

Expand Down
Loading