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

Update TNG tests and add another dont_cache check for loading #2624

Merged
merged 8 commits into from
Jun 19, 2020

Conversation

matthewturk
Copy link
Member

This is the next step after #2618, with one remaining. This checks whether or not an index_filename has been provided; if it has, it overrides the dont_cache for whether we should load from the files.

This covers the case that we aren't caching, but an index file exists, and it also covers for if an index file exists and is specified. It's not yet possible to create an index file since dont_cache doesn't check index_filename.

Tests for this will be forthcoming, once I've stabilized the yt4-merge in #2437 and the Arepo tests there.

@matthewturk matthewturk added bug demeshening Removing the global mesh for particles labels Jun 9, 2020
@matthewturk
Copy link
Member Author

So this also updates the TNG Halo test to use a bounding box that includes particles. I'll change the name.

@matthewturk matthewturk changed the title Add another dont_cache check for loading Update TNG tests and add another dont_cache check for loading Jun 9, 2020
@munkm munkm requested a review from AshKelly June 9, 2020 22:56
@munkm
Copy link
Member

munkm commented Jun 9, 2020

@AshKelly I added you to review this since you've been thinking about this too.

yt/frontends/arepo/tests/test_outputs.py Show resolved Hide resolved
Comment on lines 132 to 140
dont_load = dont_cache and not hasattr(ds, 'index_filename')
try:
rflag = self.regions.load_bitmasks(fname)
rflag = self.regions.check_bitmasks()
self._initialize_frontend_specific()
if rflag == 0:
if dont_load or rflag == 0:
raise OSError
Copy link
Member

Choose a reason for hiding this comment

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

If I follow this: in the case that we don't want to load, dont_load = True we still try and load the bitmasks, but then we raise an OSError which triggers the exception and thus, we then initialize from scratch?

If so, I guess this is ok, because loading is fast.

Copy link
Member Author

Choose a reason for hiding this comment

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

That was the idea, yeah, but I think maybe it's not the best idea anymore. It might need to be worked through a bit more carefully.

Copy link
Member

Choose a reason for hiding this comment

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

I guess you could put the if dont_load: raise OSError straight after the try and then at the end of the try have the if flag == 0: raise OSError - otherwise yt outputs:
Loading particle index...
Generating particle index...

Copy link
Member Author

Choose a reason for hiding this comment

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

good point, will do this

yt/geometry/particle_geometry_handler.py Show resolved Hide resolved
@matthewturk
Copy link
Member Author

Updated as per @AshKelly 's suggestion

@munkm munkm merged commit 37052e6 into yt-project:yt-4.0 Jun 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug demeshening Removing the global mesh for particles
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants