From 0c89de3264109f9c6f0f45e4f624ceca7ddc7a0b Mon Sep 17 00:00:00 2001 From: "Frank T. Bergmann" Date: Tue, 25 Jan 2022 10:45:37 +0100 Subject: [PATCH] - #11: pass on the basic_only flag, when calling get_task_settings, add flag to documentation --- basico/model_info.py | 3 +++ basico/task_optimization.py | 6 ++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/basico/model_info.py b/basico/model_info.py index 5815a02..51179f5 100644 --- a/basico/model_info.py +++ b/basico/model_info.py @@ -3694,6 +3694,9 @@ def get_task_settings(task, basic_only=True, **kwargs): :param task: the task to read the settings of :type task: COPASI.CCopasiTask or str + :param basic_only: boolean flag, indicating that only the basic parameters should be returned + :type basic_only: bool + :param kwargs: optional parameters - | `model`: to specify the data model to be used (if not specified diff --git a/basico/task_optimization.py b/basico/task_optimization.py index 97e23a5..70d2285 100644 --- a/basico/task_optimization.py +++ b/basico/task_optimization.py @@ -212,12 +212,14 @@ def set_objective_function(expression, maximize=None, minimize=None, model=None) problem.setMaximize(not minimize) -def get_opt_settings(model=None): +def get_opt_settings(model=None, basic_only=True): """Returns a dictionary with the optimization setup The result int dictionary includes the objective function, and the subtask. :param model: the model or None for the current one + :param basic_only: boolean flag indicating whether only basic settings should be returned + :type basic_only: bool :return: dictionary with settings """ if model is None: @@ -228,7 +230,7 @@ def get_opt_settings(model=None): problem = task.getProblem() assert (isinstance(problem, COPASI.COptProblem)) - settings = basico.get_task_settings(basico.T.OPTIMIZATION) + settings = basico.get_task_settings(basico.T.OPTIMIZATION, model=model, basic_only=basic_only) settings['expression'] = basico.model_info._replace_cns_with_names(problem.getObjectiveFunction(), model=model) subtype = problem.getSubtaskType()