Skip to content

Commit

Permalink
feat: improve morphinfo to show segment group summary
Browse files Browse the repository at this point in the history
  • Loading branch information
sanjayankur31 committed Nov 8, 2024
1 parent 6766192 commit b702c0c
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 8 deletions.
8 changes: 6 additions & 2 deletions neuroml/nml/helper_methods.py
Original file line number Diff line number Diff line change
Expand Up @@ -1358,9 +1358,13 @@ def morphinfo(self, segment_detail=False, string_buffer=None):
print("* SegmentGroups: "+str(len(self.morphology.segment_groups)), file=string_buffer)
if segment_detail:
print(file=string_buffer)
for sg in self.morphology.segment_groups:
self.get_segment_group_info(sg.id)
self.get_segment_group_info(sg.id, file=string_buffer)
else:
print(file=string_buffer)
for sg in self.morphology.segment_groups:
print(f"* SegmentGroup: {sg.id}; {len(sg.members)} members, {len(sg.includes)} included groups, {len(self.get_all_segments_in_group(sg))} segments", file=string_buffer)
def biophysinfo(self, string_buffer=None):
"""Get information on the biophysical properties of the cell.
Expand Down
16 changes: 10 additions & 6 deletions neuroml/nml/nml.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# -*- coding: utf-8 -*-

#
# Generated Wed Nov 6 17:39:46 2024 by generateDS.py version 2.44.1.
# Generated Fri Nov 8 15:15:22 2024 by generateDS.py version 2.44.1.
# Python 3.11.10 (main, Sep 9 2024, 00:00:00) [GCC 14.2.1 20240801 (Red Hat 14.2.1-1)]
#
# Command line options:
Expand Down Expand Up @@ -48887,10 +48887,6 @@ def summary(self, morph=True, biophys=True, string_buffer=None):
"*******************************************************",
file=string_buffer,
)
print(
"Tip: use morphinfo(True) to see more detailed information.",
file=string_buffer,
)
print(file=string_buffer)

if biophys:
Expand Down Expand Up @@ -48930,8 +48926,16 @@ def morphinfo(self, segment_detail=False, string_buffer=None):
)

if segment_detail:
print(file=string_buffer)
for sg in self.morphology.segment_groups:
self.get_segment_group_info(sg.id)
self.get_segment_group_info(sg.id, file=string_buffer)
else:
print(file=string_buffer)
for sg in self.morphology.segment_groups:
print(
f"* SegmentGroup: {sg.id}; {len(sg.members)} members, {len(sg.includes)} included groups, {len(self.get_all_segments_in_group(sg))} segments",
file=string_buffer,
)

def biophysinfo(self, string_buffer=None):
"""Get information on the biophysical properties of the cell.
Expand Down

0 comments on commit b702c0c

Please sign in to comment.