Skip to content

Commit

Permalink
Add parameter id as display name if no parameter display name exists …
Browse files Browse the repository at this point in the history
…for amr export
  • Loading branch information
nanglo123 committed Aug 15, 2024
1 parent 3043c9a commit 593c257
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions mira/modeling/amr/petrinet.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,8 @@ def __init__(self, model: Model):
param_dict = {'id': str(key)}
if param.display_name:
param_dict['name'] = param.display_name
else:
param_dict['name'] = str(key)
if param.description:
param_dict['description'] = param.description
if param.value is not None:
Expand Down
4 changes: 4 additions & 0 deletions mira/modeling/amr/regnet.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,10 @@ def __init__(self, model: Model):
if param.placeholder:
continue
param_dict = {'id': str(key)}
if param.display_name:
param_dict['name'] = param.display_name
else:
param_dict['name'] = str(key)
if param.value is not None:
param_dict['value'] = param.value
if not param.distribution:
Expand Down
2 changes: 2 additions & 0 deletions mira/modeling/amr/stockflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,8 @@ def __init__(self, model: Model):
param_dict = {'id': key}
if param.display_name:
param_dict['name'] = param.display_name
else:
param_dict['name'] = str(key)
if param.description:
param_dict['description'] = param.description
if param.value is not None:
Expand Down

0 comments on commit 593c257

Please sign in to comment.