Skip to content
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

Open
wants to merge 5 commits into
base: MPI-Hydro
Choose a base branch
from

Conversation

cristobal-sifon
Copy link
Contributor

Also replace pylab.find (no longer available)

# moved around
if not os.path.isdir(self.rootdir):
self.rootdir = self.rootdir.replace(
'/gpfs/data/jvbq85', '/cosma/home/durham/jvbq85/data')
Copy link
Owner

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.")
Copy link
Owner

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
Copy link
Owner

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()
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is this for?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants