Skip to content

Commit

Permalink
Neuron.summary: avoid adding .id twice
Browse files Browse the repository at this point in the history
  • Loading branch information
schlegelp committed Sep 25, 2024
1 parent 6e19005 commit 75518f9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion navis/core/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -657,8 +657,12 @@ def summary(self, add_props=None) -> pd.Series:
# Do not remove the list -> otherwise we might change the original!
props = list(self.SUMMARY_PROPS)

# Make sure ID is always in second place
if "id" in props and props.index("id") != 2:
props.remove("id")
props.insert(2, "id")
# Add .id to summary if not a generic UUID
if not isinstance(self.id, uuid.UUID):
elif not isinstance(self.id, uuid.UUID) and "id" not in props:
props.insert(2, "id")

if add_props:
Expand Down

0 comments on commit 75518f9

Please sign in to comment.