From 4ac1cbaf90c49cf8e3970a953c460b873772a4a8 Mon Sep 17 00:00:00 2001 From: robjmcgibbon Date: Fri, 21 Jun 2024 14:05:36 +0100 Subject: [PATCH] Formatter --- swiftsimio/metadata/soap/soap_types.py | 5 ++--- swiftsimio/reader.py | 6 +++--- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/swiftsimio/metadata/soap/soap_types.py b/swiftsimio/metadata/soap/soap_types.py index ed564cd2..cecb2730 100644 --- a/swiftsimio/metadata/soap/soap_types.py +++ b/swiftsimio/metadata/soap/soap_types.py @@ -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) diff --git a/swiftsimio/reader.py b/swiftsimio/reader.py index 90ba6a64..d57374b3 100644 --- a/swiftsimio/reader.py +++ b/swiftsimio/reader.py @@ -989,7 +989,7 @@ 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: @@ -997,7 +997,7 @@ def get_desc(dataset): 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 @@ -1005,7 +1005,7 @@ def get_desc(dataset): 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