don't save HaloField by default in high level functions #436
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Since halo fields can get quite large, and since the classes
HaloFIeld
andPerturbHaloField
hold similar information, we really only want to cache one most of the time. So I've changed the default behaviour inrun_coeval
andrun_lightcone
to only writePerturbHaloField
. This could save up to ~10% time and halve the cache requirements._get_config_options
is now only called on the lower-level structures, this was done to have more control over writing behaviour.hooks
are passed orwrite
is set to true or false, the behaviour is the same as beforewrite==None
(default) we write everything except forHaloField
.This also fixes an unrelated problem where we overpurged the ICs for the halofield since we need the velocity fields for
perturb_halo_list
.In the longer term it might be a better idea to have the halo field perturbation be an in-place operation. Where we have subclasses of HaloField to indicate Lagrangian or Eulerian, which can point to the same backend arrays.