Skip to content

Commit

Permalink
Merge pull request #2077 from AMICI-dev/release_0.17.1
Browse files Browse the repository at this point in the history
Release 0.17.1
  • Loading branch information
dweindl committed May 10, 2023
2 parents e524930 + d9fa810 commit 81d32e7
Show file tree
Hide file tree
Showing 6 changed files with 64 additions and 12 deletions.
46 changes: 44 additions & 2 deletions .github/workflows/test_install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ jobs:
run: |
scripts/installAmiciArchive.sh
sdist:
name: sdist Install
sdist_ubuntu:
name: sdist Install Ubuntu

runs-on: ubuntu-22.04

Expand Down Expand Up @@ -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
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion ThirdParty/sundials/cmake/tpl/FindKLU.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
13 changes: 6 additions & 7 deletions python/sdist/amici/petab_import_pysb.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@
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
from petab.C import (CONDITION_FILES, CONDITION_NAME, FORMAT_VERSION,
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

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -252,17 +252,16 @@ 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
for observables.
: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)
Expand Down Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion python/sdist/setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.17.0
0.17.1

0 comments on commit 81d32e7

Please sign in to comment.