Skip to content

Commit

Permalink
fixing error message, simplifying
Browse files Browse the repository at this point in the history
  • Loading branch information
jonrkarr committed Feb 12, 2021
1 parent c1e1173 commit 36388fb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion biosimulators_utils/sedml/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,7 @@ def apply_changes_to_xml_model(model, model_etree, sed_doc, working_dir,
new_value = calc_compute_model_change_new_value(change, variable_values=iter_variable_values, range_values=range_values)
if new_value == int(new_value):
new_value = str(int(new_value))
else:
else:
new_value = str(new_value)

# get object to change
Expand Down
7 changes: 4 additions & 3 deletions biosimulators_utils/sedml/validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ def validate_doc(doc, validate_semantics=True):
functional_range_graph = networkx.DiGraph()
for task in doc.tasks:
if isinstance(task, RepeatedTask):
for i_range, range in enumerate(task.ranges):
for range in task.ranges:
if isinstance(range, FunctionalRange):
if not range.range:
msg = ('Functional ranges must reference another range. '
Expand All @@ -240,7 +240,8 @@ def validate_doc(doc, validate_semantics=True):
raise ValueError('Variables of functional ranges should define a symbol or target, not both')

if not range.math:
raise ValueError('Functional ranges must have math. Functional range `{}` does not have math.')
msg = 'Functional ranges must have math. Functional range `{}` does not have math.'.format(range.id)
raise ValueError(msg)

functional_range_graph.add_node(range.id)
functional_range_graph.add_edge(range.id, range.range.id)
Expand All @@ -261,7 +262,7 @@ def validate_doc(doc, validate_semantics=True):
raise ValueError('Repeated tasks must have main ranges. Repeated task `{}` does not have a main range.'.format(task.id))
main_range_len = get_range_len(task.range)

for i_range, range in enumerate(task.ranges):
for range in task.ranges:
range_len = get_range_len(range)
if range_len < main_range_len:
msg = (
Expand Down

0 comments on commit 36388fb

Please sign in to comment.