diff --git a/morph_utils/modifications.py b/morph_utils/modifications.py index 91a561b..1c17c9d 100644 --- a/morph_utils/modifications.py +++ b/morph_utils/modifications.py @@ -372,6 +372,7 @@ def generate_irreducible_morph(morph): next_node_up['type'] = 1 irreducible_nodes_with_topology.append(next_node_up) + irreducible_nodes_with_topology.sort(key=lambda n: n['id']) morph_irreducible = Morphology(irreducible_nodes_with_topology, parent_id_cb=lambda x: x['parent'], node_id_cb=lambda x: x['id'])