-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Account for missing snapshots in Track retrieval #13
base: MPI-Hydro
Are you sure you want to change the base?
Conversation
# moved around | ||
if not os.path.isdir(self.rootdir): | ||
self.rootdir = self.rootdir.replace( | ||
'/gpfs/data/jvbq85', '/cosma/home/durham/jvbq85/data') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be kept private.
a better fix is to change path argument to paramfile, so that the user can supply an updated paramfile.
with self.Open(-1) as f: | ||
self.ParticleMass=f['/Cosmology/ParticleMass'][0] | ||
except: | ||
#print("Info: fail to get ParticleMass.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why suppressing the info?
self._valid_snapshots = np.array( | ||
[os.path.isfile(self.GetFileName(i)) | ||
for i in range(self.MaxSnap+1)]) | ||
return self._valid_snapshots |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assume this is only to account for a different MinSnap? if there are missing snaps in between, then some records like SnapshotIndexOfLastIsolation etc. will break. Then it will be friendly to print some warning message about the missing ones.
if hasattr(snapbirth, '__iter__'): | ||
snapbirth = snapbirth[0] | ||
snaps = np.arange(snapbirth, self.MaxSnap+1, dtype=int) | ||
to = time() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what is this for?
Also replace pylab.find (no longer available)