diff --git a/glotaran/parameter/parameter_group.py b/glotaran/parameter/parameter_group.py index 1d520eab7..84e043fe9 100644 --- a/glotaran/parameter/parameter_group.py +++ b/glotaran/parameter/parameter_group.py @@ -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) diff --git a/glotaran/parameter/test/test_parameter_group.py b/glotaran/parameter/test/test_parameter_group.py index db99bbf57..61abdeefe 100644 --- a/glotaran/parameter/test/test_parameter_group.py +++ b/glotaran/parameter/test/test_parameter_group.py @@ -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 = """