mirror of
https://github.com/Findus23/halo_comparison.git
synced 2024-09-13 09:03:49 +02:00
never use outdated cache
This commit is contained in:
parent
70d25c3f72
commit
f23522b6bd
1 changed files with 4 additions and 1 deletions
|
@ -17,7 +17,10 @@ class ParticlesMeta:
|
|||
def read_file(file: Path) -> Tuple[pd.DataFrame, ParticlesMeta]:
|
||||
cache_file = file.with_suffix(".cache.pickle")
|
||||
meta_cache_file = file.with_suffix(".cache_meta.pickle")
|
||||
if not (cache_file.exists() and meta_cache_file.exists()):
|
||||
cache_is_outdated = file.stat().st_mtime > cache_file.stat().st_mtime
|
||||
if cache_is_outdated:
|
||||
print("cache is outdated")
|
||||
if not (cache_file.exists() and meta_cache_file.exists()) or cache_is_outdated:
|
||||
reference_file = h5py.File(file)
|
||||
has_fof = "FOFGroupIDs" in reference_file["PartType1"]
|
||||
|
||||
|
|
Loading…
Reference in a new issue