Skip to content

Commit

Permalink
Create partial snapshot property
Browse files Browse the repository at this point in the history
  • Loading branch information
JBorrow committed Oct 6, 2023
1 parent a418000 commit 1397600
Showing 1 changed file with 18 additions and 6 deletions.
24 changes: 18 additions & 6 deletions swiftsimio/reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -651,7 +651,7 @@ def present_particle_names(self):
]

@property
def code_info(self):
def code_info(self) -> str:
"""
Gets a nicely printed set of code information with:
Expand All @@ -672,7 +672,7 @@ def get_string(x):
return output

@property
def compiler_info(self):
def compiler_info(self) -> str:
"""
Gets information about the compiler and formats it as:
Expand All @@ -691,7 +691,7 @@ def get_string(x):
return output

@property
def library_info(self):
def library_info(self) -> str:
"""
Gets information about the libraries used and formats it as:
Expand All @@ -712,7 +712,7 @@ def get_string(x):
return output

@property
def hydro_info(self):
def hydro_info(self) -> str:
r"""
Gets information about the hydro scheme and formats it as:
Expand Down Expand Up @@ -743,7 +743,7 @@ def get_string(x):
return output

@property
def viscosity_info(self):
def viscosity_info(self) -> str:
r"""
Gets information about the viscosity scheme and formats it as:
Expand All @@ -770,7 +770,7 @@ def get_string(x):
return output

@property
def diffusion_info(self):
def diffusion_info(self) -> str:
"""
Gets information about the diffusion scheme and formats it as:
Expand All @@ -790,6 +790,18 @@ def get_float(x):
)

return output

@property
def partial_snapshot(self) -> bool:
"""
Whether or not this snapshot is partial (e.g. a "x.0.hdf5" file), or
a file describing an entire snapshot.
"""

# Partial snapshots have num_files_per_snapshot set to 1. Virtual snapshots
# collating multiple sub-snapshots together have num_files_per_snapshot = 1.

return self.num_files_per_snapshot > 1


class SWIFTParticleTypeMetadata(object):
Expand Down

0 comments on commit 1397600

Please sign in to comment.