Skip to content

Commit

Permalink
- #11: pass on the basic_only flag, when calling get_task_settings, a…
Browse files Browse the repository at this point in the history
…dd flag to documentation
  • Loading branch information
fbergmann committed Jan 25, 2022
1 parent 29c75ed commit 0c89de3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
3 changes: 3 additions & 0 deletions basico/model_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 4 additions & 2 deletions basico/task_optimization.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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()
Expand Down

0 comments on commit 0c89de3

Please sign in to comment.