diff --git a/doc/releasenotes.rst b/doc/releasenotes.rst index fcb0eeeb9..aac749bac 100644 --- a/doc/releasenotes.rst +++ b/doc/releasenotes.rst @@ -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) ------------------ diff --git a/pypesto/objective/petab_import.py b/pypesto/objective/petab_import.py index b55656830..cdac7263d 100644 --- a/pypesto/objective/petab_import.py +++ b/pypesto/objective/petab_import.py @@ -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( @@ -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): @@ -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, ) @@ -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. diff --git a/pypesto/version.py b/pypesto/version.py index 034f46c34..6526deb42 100644 --- a/pypesto/version.py +++ b/pypesto/version.py @@ -1 +1 @@ -__version__ = "0.0.6" +__version__ = "0.0.7" diff --git a/setup.py b/setup.py index eac17b41e..28ab07cab 100644 --- a/setup.py +++ b/setup.py @@ -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', )