diff --git a/.github/workflows/test_install.yml b/.github/workflows/test_install.yml index 81cf1edafc..6721008599 100644 --- a/.github/workflows/test_install.yml +++ b/.github/workflows/test_install.yml @@ -50,8 +50,8 @@ jobs: run: | scripts/installAmiciArchive.sh - sdist: - name: sdist Install + sdist_ubuntu: + name: sdist Install Ubuntu runs-on: ubuntu-22.04 @@ -92,3 +92,45 @@ jobs: - name: Test import run: | python -m amici + + + sdist_macos: + name: sdist Install macos + + runs-on: macos-latest + + strategy: + matrix: + python-version: [3.9] + + steps: + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + + - uses: actions/checkout@v3 + - run: git fetch --prune --unshallow + + - run: echo "AMICI_DIR=$(pwd)" >> $GITHUB_ENV + + # install amici dependencies + - name: homebrew + run: | + brew install hdf5 swig gcc cppcheck libomp boost \ + && brew ls -v boost \ + && brew ls -v libomp \ + && echo LDFLAGS="-L/usr/local/lib/ -L/usr/local/Cellar/boost/1.81.0_1/lib/" >> $GITHUB_ENV \ + && echo CPPFLAGS="-I /usr/local/Cellar/boost/1.81.0_1/include/" >> $GITHUB_ENV + + - name: Create AMICI sdist + run: | + scripts/buildSdist.sh + + - name: Install python sdist + run: | + pip3 install -v --user $(ls -t python/sdist/dist/amici-*.tar.gz | head -1) + + - name: Test import + run: | + python -m amici diff --git a/CHANGELOG.md b/CHANGELOG.md index 9f1009c3c8..ff722cd5d3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,15 @@ ## v0.X Series +### v0.17.1 (2023-05-10) + +This release fixes two bugs: + +* One bug introduced in v0.17.0, that causes an `ImportError` + on macOS (https://github.com/AMICI-dev/AMICI/issues/2075). +* An AttributeError in petab_import_pysb with petab>=0.2.0 + https://github.com/AMICI-dev/AMICI/pull/2079 + ### v0.17.0 (2023-05-09) AMICI v0.17.0 requires Python>=3.9 and a C++17 compatible compiler diff --git a/ThirdParty/sundials/cmake/tpl/FindKLU.cmake b/ThirdParty/sundials/cmake/tpl/FindKLU.cmake index 9aa4cf8bad..9e25883c4f 100644 --- a/ThirdParty/sundials/cmake/tpl/FindKLU.cmake +++ b/ThirdParty/sundials/cmake/tpl/FindKLU.cmake @@ -35,7 +35,9 @@ if(WIN32) set(CMAKE_FIND_LIBRARY_PREFIXES lib ${CMAKE_FIND_LIBRARY_PREFIXES}) set(CMAKE_FIND_LIBRARY_SUFFIXES d.lib ${CMAKE_FIND_LIBRARY_SUFFIXES}) elseif(APPLE) - set(CMAKE_FIND_LIBRARY_SUFFIXES d.a ${CMAKE_FIND_LIBRARY_SUFFIXES}) + # AMICI + # set(CMAKE_FIND_LIBRARY_SUFFIXES d.a ${CMAKE_FIND_LIBRARY_SUFFIXES}) + set(CMAKE_FIND_LIBRARY_SUFFIXES .a d.a ${CMAKE_FIND_LIBRARY_SUFFIXES}) else() set(CMAKE_FIND_LIBRARY_SUFFIXES .a ${CMAKE_FIND_LIBRARY_SUFFIXES}) endif() diff --git a/python/sdist/amici/petab_import_pysb.py b/python/sdist/amici/petab_import_pysb.py index 796aa3bee0..4d2f146a74 100644 --- a/python/sdist/amici/petab_import_pysb.py +++ b/python/sdist/amici/petab_import_pysb.py @@ -9,9 +9,8 @@ import os from itertools import chain from pathlib import Path -from typing import Dict, Iterable, Optional, Tuple, Union +from typing import Dict, Iterable, Optional, Union -import libsbml import petab import pysb import sympy as sp @@ -19,6 +18,7 @@ MEASUREMENT_FILES, NOISE_FORMULA, OBSERVABLE_FILES, OBSERVABLE_FORMULA, PARAMETER_FILE, SBML_FILES, VISUALIZATION_FILES) +from petab.models.sbml_model import SbmlModel from .logging import get_logger, log_execution_time, set_log_level @@ -56,7 +56,7 @@ def __init__(self, pysb_model: 'pysb.Model' = None, *args, **kwargs): self._add_observation_model() if self.pysb_model is not None: - self.sbml_document, self.sbml_model = \ + self.model = \ create_dummy_sbml( self.pysb_model, observable_ids=self.observable_df.index.values @@ -252,7 +252,7 @@ def from_yaml(yaml_config: Union[Dict, Path, str], def create_dummy_sbml( pysb_model: 'pysb.Model', observable_ids: Optional[Iterable[str]] = None -) -> Tuple['libsbml.Model', 'libsbml.SBMLDocument']: +) -> SbmlModel: """Create SBML dummy model for to use PySB models with PEtab. Model must at least contain PEtab problem parameter and noise parameters @@ -260,9 +260,8 @@ def create_dummy_sbml( :param pysb_model: PySB model :param observable_ids: Observable IDs - :return: A dummy SBML model and document. + :return: A dummy petab SBML model. """ - import libsbml document = libsbml.SBMLDocument(3, 1) @@ -305,7 +304,7 @@ def create_dummy_sbml( s.setCompartment('dummy_compartment') s.setConstant(False) - return document, dummy_sbml_model + return SbmlModel(sbml_model=dummy_sbml_model, sbml_document=document) @log_execution_time('Importing PEtab model', logger) diff --git a/python/sdist/setup.cfg b/python/sdist/setup.cfg index cb9338612f..26255e77be 100644 --- a/python/sdist/setup.cfg +++ b/python/sdist/setup.cfg @@ -44,7 +44,7 @@ include_package_data = True zip_safe = False [options.extras_require] -petab = petab>=0.1.27 +petab = petab>=0.2.0 pysb = pysb>=1.13.1 test = pytest diff --git a/version.txt b/version.txt index c5523bd09b..7cca7711a0 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -0.17.0 +0.17.1