diff --git a/neuroml/nml/helper_methods.py b/neuroml/nml/helper_methods.py index 08c07f7..126bd6b 100644 --- a/neuroml/nml/helper_methods.py +++ b/neuroml/nml/helper_methods.py @@ -1617,6 +1617,12 @@ def add_segment( self.morphology.segments.append(segment) + # remove cached property since it is now outdated + try: + del self.__dict__['segment_ids_vs_segments'] + except KeyError: + pass + if optimise_segment_groups: self.optimise_segment_groups() diff --git a/neuroml/nml/nml.py b/neuroml/nml/nml.py index 8e08329..9146c24 100644 --- a/neuroml/nml/nml.py +++ b/neuroml/nml/nml.py @@ -2,7 +2,7 @@ # -*- coding: utf-8 -*- # -# Generated Wed Sep 11 17:09:38 2024 by generateDS.py version 2.44.1. +# Generated Thu Sep 12 16:44:57 2024 by generateDS.py version 2.44.1. # Python 3.11.9 (main, Aug 23 2024, 00:00:00) [GCC 14.2.1 20240801 (Red Hat 14.2.1-1)] # # Command line options: @@ -49179,6 +49179,12 @@ def add_segment( self.morphology.segments.append(segment) + # remove cached property since it is now outdated + try: + del self.__dict__["segment_ids_vs_segments"] + except KeyError: + pass + if optimise_segment_groups: self.optimise_segment_groups()