Skip to content

Commit

Permalink
Added refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
JBorrow committed Sep 18, 2024
1 parent 64b8d94 commit 695f7e1
Show file tree
Hide file tree
Showing 4 changed files with 1,255 additions and 1,124 deletions.
5 changes: 2 additions & 3 deletions swiftsimio/masks.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,8 @@ def __init__(self, metadata: SWIFTMetadata, spatial_only=True):
self.units = metadata.units
self.spatial_only = spatial_only

if self.metadata.filetype == "FOF":
# No virtual snapshots or cells metadata for fof currently
raise NotImplementedError("Masking not supported for FOF filetype")
if not self.metadata.masking_valid:
raise NotImplementedError(f"Masking not supported for {self.metadata.output_type} filetype")

if self.metadata.partial_snapshot:
raise InvalidSnapshot(
Expand Down
2 changes: 2 additions & 0 deletions swiftsimio/metadata/metadata/metadata_fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
header_unpack_arrays = {
"BoxSize": "boxsize",
"NumPart_ThisFile": "num_part",
"NumGroup_ThisFile": "num_group",
"NumSubhalos_ThisFile": "num_subhalo",
"CanHaveTypes": "has_type",
"NumFilesPerSnapshot": "num_files_per_snapshot",
"OutputType": "output_type",
Expand Down
Loading

0 comments on commit 695f7e1

Please sign in to comment.