Skip to content

Commit

Permalink
#39: warn about errors that occurred before running parameter estimation
Browse files Browse the repository at this point in the history
  • Loading branch information
fbergmann committed Jan 11, 2024
1 parent e5d9349 commit 5441f34
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
3 changes: 2 additions & 1 deletion basico/model_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -5338,7 +5338,8 @@ def add_parameter_set(name, param_set_dict=None, **kwargs):

# if we are here, the parameter set does not exist yet, unfortunately
# the test added a message, so lets remove it
COPASI.CCopasiMessage.getLastMessage()
if COPASI.CCopasiMessage.peekLastMessage().getNumber() == 5501:
COPASI.CCopasiMessage.getLastMessage()

if param_set_dict is None:
# create parameter set from current state
Expand Down
6 changes: 6 additions & 0 deletions basico/task_parameterestimation.py
Original file line number Diff line number Diff line change
Expand Up @@ -1177,6 +1177,12 @@ def run_parameter_estimation(**kwargs):
if 'settings' in kwargs:
basico.set_task_settings(task, kwargs['settings'])

# the parameter estimation task will not run if errors have not been
# cleared from the error log. So we clear them here if necessary
if COPASI.CCopasiMessage.getHighestSeverity() > COPASI.CCopasiMessage.WARNING:
logger.warning("Uncaptured Errors: " +
basico.model_info.get_copasi_messages(0, 'No output'))

num_messages_before = COPASI.CCopasiMessage.size()

task.setCallBack(get_default_handler())
Expand Down

0 comments on commit 5441f34

Please sign in to comment.