Skip to content

Commit

Permalink
fix(create-unbranched-groups): number in segment group id cannot be n…
Browse files Browse the repository at this point in the history
…egative
  • Loading branch information
sanjayankur31 committed Aug 14, 2024
1 parent 2e17bdc commit 456bc69
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
3 changes: 2 additions & 1 deletion neuroml/nml/helper_methods.py
Original file line number Diff line number Diff line change
Expand Up @@ -2193,7 +2193,8 @@ def create_unbranched_segment_group_branches(self, root_segment_id: int, use_con
# initialise root segment and first segment group
seg = self.get_segment(root_segment_id)
group_name = f"seg_group_{len(self.morphology.segment_groups) - 1}_seg_{seg.id}"
num_seg_groups = len(self.morphology.segment_groups)
group_name = f"seg_group_{num_seg_groups}_seg_{seg.id}"
new_seg_group = self.add_unbranched_segment_group(group_name)
# run recursive function
Expand Down
13 changes: 7 additions & 6 deletions neuroml/nml/nml.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
# -*- coding: utf-8 -*-

#
# Generated Tue Jun 11 14:00:16 2024 by generateDS.py version 2.43.3.
# Python 3.10.9 (main, Jan 11 2023, 15:21:40) [GCC 11.2.0]
# Generated Wed Aug 14 13:56:38 2024 by generateDS.py version 2.44.1.
# Python 3.11.9 (main, Apr 17 2024, 00:00:00) [GCC 14.0.1 20240411 (Red Hat 14.0.1-0)]
#
# Command line options:
# ('-o', 'nml.py')
Expand All @@ -16,7 +16,7 @@
# NeuroML_v2.3.1.xsd
#
# Command line:
# /home/padraig/anaconda2/envs/py310//bin/generateDS -o "nml.py" --use-getter-setter="none" --user-methods="helper_methods.py" --export="write validate" --custom-imports-template="gds_imports-template.py" NeuroML_v2.3.1.xsd
# /home/asinha/.local/share/virtualenvs/neuroml-311-dev/bin/generateDS -o "nml.py" --use-getter-setter="none" --user-methods="helper_methods.py" --export="write validate" --custom-imports-template="gds_imports-template.py" NeuroML_v2.3.1.xsd
#
# Current working directory (os.getcwd()):
# nml
Expand Down Expand Up @@ -198,7 +198,7 @@ class GeneratedsSuperSuper(object):

class GeneratedsSuper(GeneratedsSuperSuper):
__hash__ = object.__hash__
tzoff_pattern = re_.compile(r"(\+|-)((0\d|1[0-3]):[0-5]\d|14:00)$")
tzoff_pattern = re_.compile("(\\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00)$")

class _FixedOffsetTZ(datetime_.tzinfo):
def __init__(self, offset, name):
Expand Down Expand Up @@ -704,7 +704,7 @@ def get_path_(self, node):
path = "/".join(path_list)
return path

Tag_strip_pattern_ = re_.compile(r"\{.*\}")
Tag_strip_pattern_ = re_.compile(r"{.*}")

def get_path_list_(self, node, path_list):
if node is None:
Expand Down Expand Up @@ -49780,7 +49780,8 @@ def create_unbranched_segment_group_branches(

# initialise root segment and first segment group
seg = self.get_segment(root_segment_id)
group_name = f"seg_group_{len(self.morphology.segment_groups) - 1}_seg_{seg.id}"
num_seg_groups = len(self.morphology.segment_groups)
group_name = f"seg_group_{num_seg_groups}_seg_{seg.id}"
new_seg_group = self.add_unbranched_segment_group(group_name)

# run recursive function
Expand Down

0 comments on commit 456bc69

Please sign in to comment.