Skip to content

Commit

Permalink
#61: convert list of values to comma separated string when setting pa…
Browse files Browse the repository at this point in the history
…rameter string values
  • Loading branch information
fbergmann committed Nov 11, 2024
1 parent 439f479 commit 600b49c
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion basico/model_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -4900,7 +4900,14 @@ def _set_group_from_dict(group, values, dm=None):

try:
if param_type == COPASI.CCopasiParameter.Type_STRING:
param.setStringValue(str(values[key]))
current_value = values[key]
# convert list of strings to comma separated string
# converting other data types to string
if isinstance(current_value, list):
current_value = ', '.join(map(str, current_value))
else:
current_value = str(current_value)
param.setStringValue(current_value)
elif param_type == COPASI.CCopasiParameter.Type_INT:
param.setIntValue(int(values[key]))
elif param_type == COPASI.CCopasiParameter.Type_UINT:
Expand Down

0 comments on commit 600b49c

Please sign in to comment.