Skip to content

Commit

Permalink
Merge pull request #161 from ICB-DCM/develop
Browse files Browse the repository at this point in the history
Release 0.0.7
  • Loading branch information
yannikschaelte authored Mar 21, 2019
2 parents 3580790 + fb056dd commit fc7cc06
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 6 deletions.
7 changes: 7 additions & 0 deletions doc/releasenotes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@ Release notes
..........


0.0.7 (2019-03-21)
------------------

* Support noise models in Petab and Amici.
* Minor Petab update bug fixes.


0.0.6 (2019-03-13)
------------------

Expand Down
26 changes: 23 additions & 3 deletions pypesto/objective/petab_import.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,11 @@ def compile_model(self):
observables = self.petab_problem.get_observables()

# sigmas
sigmas = self.petab_problem.get_sigmas()
sigmas = self.petab_problem.get_sigmas(remove=True)

# noise distributions
noise_distrs = _to_amici_noise_distributions(
self.petab_problem.get_noise_distributions())

# model to string
sbml_string = libsbml.SBMLWriter().writeSBMLToString(
Expand All @@ -197,7 +201,8 @@ def compile_model(self):
output_dir=self.output_folder,
observables=observables,
constantParameters=constant_parameter_ids,
sigmas=sigmas
sigmas=sigmas,
noise_distributions=noise_distrs
)

def create_solver(self, model=None):
Expand Down Expand Up @@ -346,7 +351,6 @@ def create_objective(self,
measurement_df=self.petab_problem.measurement_df,
parameter_df=self.petab_problem.parameter_df,
sbml_model=self.petab_problem.sbml_model,
par_opt_ids=par_opt_ids,
par_sim_ids=par_sim_ids,
simulation_conditions=simulation_conditions,
)
Expand Down Expand Up @@ -594,6 +598,22 @@ def _find_output_folder_name(petab_problem: petab.Problem):
return output_folder


def _to_amici_noise_distributions(noise_distributions):
"""
Map from the petab to the amici format of noise distribution
identifiers.
"""
amici_distrs = {}
for id_, val in noise_distributions.items():
amici_val = ''
if val['observableTransformation']:
amici_val += val['observableTransformation'] + '-'
if val['noiseDistribution']:
amici_val += val['noiseDistribution']
amici_distrs[id_] = amici_val
return amici_distrs


def _find_model_name(output_folder):
"""
Just re-use the last part of the output folder.
Expand Down
2 changes: 1 addition & 1 deletion pypesto/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.0.6"
__version__ = "0.0.7"
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ def read(fname):
'pandas>=0.23.4',
'matplotlib>=2.2.3',
'cloudpickle>=0.7.0',
'petab>=0.0.0a11'],
'petab>=0.0.0a12'],
tests_require=['pytest', 'flake8>=3.7.1', 'gitpython'],
extras_require={'amici': ['amici>=0.10.2']},
extras_require={'amici': ['amici>=0.10.4']},
python_requires='>=3.6',
)

0 comments on commit fc7cc06

Please sign in to comment.