Skip to content

Commit

Permalink
Formatter
Browse files Browse the repository at this point in the history
  • Loading branch information
robjmcgibbon committed Jun 21, 2024
1 parent 9ca0d29 commit 4ac1cba
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
5 changes: 2 additions & 3 deletions swiftsimio/metadata/soap/soap_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,5 @@ def get_soap_name_nice(group: str) -> str:
"SOAP": "SOAP",
"ProjectedAperture": "ProjectedAperture",
}
split_name = group.split('/')
return ''.join(name.capitalize() for name in split_name)

split_name = group.split("/")
return "".join(name.capitalize() for name in split_name)
6 changes: 3 additions & 3 deletions swiftsimio/reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -989,23 +989,23 @@ def get_desc(dataset):
# Can't load description!
description = "No description available"

if self.metadata.filetype != 'SOAP':
if self.metadata.filetype != "SOAP":
return description

try:
is_masked = dataset.attrs["Masked"]
except KeyError:
is_masked = False
if not is_masked:
return description + ' Not masked.'
return description + " Not masked."

# TODO: Update for https://github.com/SWIFTSIM/SOAP/pull/81
# TODO: Also need to add group mask data for that PR
# If is_masked is true then these other attributes should exist
mask_datasets = dataset.attrs["Mask Datasets"]
mask_threshold = dataset.attrs["Mask Threshold"]
if len(mask_datasets) == 1:
mask_str = f' Only computed for objects with {mask_datasets[0]} >= {mask_threshold}.'
mask_str = f" Only computed for objects with {mask_datasets[0]} >= {mask_threshold}."
else:
mask_str = f' Only computed for objects where {" + ".join(mask_datasets)} >= {mask_threshold}.'
return description + mask_str
Expand Down

0 comments on commit 4ac1cba

Please sign in to comment.