From 7e0b3f80506a3c3c11bb5383e5199426c0f56ae6 Mon Sep 17 00:00:00 2001 From: Daniel Weindl Date: Wed, 10 May 2023 19:58:50 +0200 Subject: [PATCH 1/4] Fix PySBModel.get_parameter_value (#203) Incorrectly returned the parameter name, instead of its value. --- petab/models/pysb_model.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/petab/models/pysb_model.py b/petab/models/pysb_model.py index f03b0b19..30c6922f 100644 --- a/petab/models/pysb_model.py +++ b/petab/models/pysb_model.py @@ -83,7 +83,7 @@ def get_parameter_ids(self) -> Iterable[str]: def get_parameter_value(self, id_: str) -> float: try: - return self.model.parameters[id_].name + return self.model.parameters[id_].value except KeyError as e: raise ValueError(f"Parameter {id_} does not exist.") from e From b322ad89b697eedc4f4029d3be512d9972706f55 Mon Sep 17 00:00:00 2001 From: Daniel Weindl Date: Thu, 11 May 2023 15:19:17 +0200 Subject: [PATCH 2/4] Fix Problem.to_files(model_file=...) (#204) * Fix Problem.to_files(model_file=...) model_file parameter was not properly handled, resulting in missing model files in the created yaml file. * typo --------- Co-authored-by: dilpath --- petab/problem.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/petab/problem.py b/petab/problem.py index f52a2ec5..ae877422 100644 --- a/petab/problem.py +++ b/petab/problem.py @@ -411,7 +411,7 @@ def to_files_generic( if not isinstance(self.model, SbmlModel): raise NotImplementedError("Saving non-SBML models is " "currently not supported.") - filenames['sbml_file'] = 'model.xml' + filenames['model_file'] = 'model.xml' filenames['yaml_file'] = 'problem.yaml' @@ -542,7 +542,7 @@ def error(name: str) -> ValueError: if yaml_file: yaml.create_problem_yaml( - sbml_files=sbml_file, + sbml_files=model_file, condition_files=condition_file, measurement_files=measurement_file, parameter_file=parameter_file, From 93f90504dacbab6d9fc95087dc79a3feee5f8b65 Mon Sep 17 00:00:00 2001 From: Daniel Weindl Date: Sat, 13 May 2023 18:44:22 +0200 Subject: [PATCH 3/4] Readme: py39 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 58fdc2bd..17591810 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ and the easiest way to install it is running pip3 install petab -It will require Python>=3.8 to run. (We are following the +It will require Python>=3.9 to run. (We are following the [numpy Python support policy](https://numpy.org/neps/nep-0029-deprecation_policy.html)). Development versions of the PEtab library can be installed using From ca4ab1f478ba542b88bedf7b9d1748c416b4198a Mon Sep 17 00:00:00 2001 From: Daniel Weindl Date: Tue, 16 May 2023 07:28:53 +0200 Subject: [PATCH 4/4] Bump version; update changelog --- CHANGELOG.md | 6 ++++++ petab/version.py | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b4b47545..d7ba5ec2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,12 @@ ## 0.2 series +### 0.2.1 + +Fixes: +* Fixed an issue in `Problem.to_files(model_file=...)` (#204) +* Fixed `PySBModel.get_parameter_value`, which incorrectly returned the parameter name instead of its value (#203) + ### 0.2.0 Note: petab 0.2.0 requires Python>=3.9 diff --git a/petab/version.py b/petab/version.py index 6459fb29..91b33193 100644 --- a/petab/version.py +++ b/petab/version.py @@ -1,2 +1,2 @@ """PEtab library version""" -__version__ = '0.2.0' +__version__ = '0.2.1'