Skip to content

Commit

Permalink
🩹 Fix degraded label with nesting over 2
Browse files Browse the repository at this point in the history
  • Loading branch information
s-weigand committed May 20, 2022
1 parent 2e44162 commit a051427
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions glotaran/parameter/parameter_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -490,6 +490,7 @@ def all(
"""
root = f"{root}{self.label}{separator}" if root is not None else ""
for label, p in self._parameters.items():
p.full_label = f"{root}{label}"
yield (f"{root}{label}", p)
for _, l in self.items():
yield from l.all(root=root, separator=separator)
Expand Down
3 changes: 3 additions & 0 deletions glotaran/parameter/test/test_parameter_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,9 @@ def test_parameter_group_from_dict_nested():

assert params.get("kinetic.j.1").full_label == "kinetic.j.1"

roundtrip_df = ParameterGroup.from_dataframe(params.to_dataframe()).to_dataframe()
assert all(roundtrip_df.label == params.to_dataframe().label)


def test_parameter_group_to_array():
params = """
Expand Down

0 comments on commit a051427

Please sign in to comment.