pynbody / genetIC

The GM initial conditions generator
GNU General Public License v3.0
21 stars 8 forks source link

Fixing ordering of grafic grids #72

Closed Martin-Rey closed 4 years ago

Martin-Rey commented 4 years ago

This PR fixes the bug noted in issue #71, in which the ordering of virtual grids was wrong in a grafIC hierarchy when requesting multiple subsampled virtual grids.

I used this opportunity to refactor (and hopefully simplify) the logic of https://github.com/ucl-cosmoparticles/genetIC/blob/5f0982c62b9433e0b2c096395c47dee2266b5dd4/genetIC/src/simulation/multilevelcontext/multilevelcontext.hpp#L338

I also added two additional tests, catching these previously untested use cases. Specifically, requesting multiple subsampling, through subsample 4 and/or a deep zoom grid, and multiple supersampling through e.g. supersample 4.

Feel free to comment on the refactoring if need be Martin