Skip to content

Commit

Permalink
Squash bug registering field names
Browse files Browse the repository at this point in the history
  • Loading branch information
robjmcgibbon committed Aug 2, 2024
1 parent 8b94a0b commit 0e6c14c
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions swiftsimio/reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -924,15 +924,13 @@ def convert(name):
return re.sub("([a-z0-9])([A-Z])", r"\1_\2", name).lower()

# Skip fields which are groups themselves
self.field_paths = [
f"{self.group}/{item}"
for item in self.metadata.handle[f"{self.group}"].keys()
if f"{self.group}/{item}" not in self.metadata.present_groups
]

self.field_names = [
convert(item) for item in self.metadata.handle[f"{self.group}"].keys()
]
self.field_paths = []
self.field_names = []
for item in self.metadata.handle[f"{self.group}"].keys():
# Skip fields which are groups themselves
if f"{self.group}/{item}" not in self.metadata.present_groups:
self.field_paths.append(f"{self.group}/{item}")
self.field_names.append(convert(item))

return

Expand Down

0 comments on commit 0e6c14c

Please sign in to comment.