Adding BGS filter to prepare_sim#212
Open
SBouchard01 wants to merge 8 commits into
Open
Conversation
…ter override option when no MT
…hen used outside of the folder
for more information, see https://pre-commit.ci
lgarrison
requested changes
Jun 15, 2026
lgarrison
left a comment
Member
There was a problem hiding this comment.
Thanks @SBouchard01! This looks good to me, just some minor nits below.
Also, any reason we need a __init__.py file? Previously we had been using namespace packages. This is probably a harmless addition, but just confirming it was intentional.
|
|
||
| DEFAULT_BATCH_SIZE = 10**5 | ||
|
|
||
| logger = logging.getLogger(__file__) |
Member
There was a problem hiding this comment.
I think this should use __name__ instead of __file__?
| DEFAULTS = {} | ||
| DEFAULTS['path2config'] = 'config/abacus_hod.yaml' | ||
|
|
||
| logger = logging.getLogger(__file__) |
Member
|
I think @SandyYuan can answer the questions about the different magic values and the |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
At Sandy's suggestion, I had a custom filter on the halos & particles subsamples to allow the BGS density to be reached in my branch of the package (it exists in the current file, but commented out). Given the recent changes in
prepare_simthat need to re-run it, I propose an implementation of that filter as an option in the official pipeline.This branch also replaces most of the print statements by logger calls for clarity and stdout buffering delays in
prepare_simandmenv.Open questions & remarks:
subsample_halosandsubmask_particlesare commented out in the code. They are functionally the same as the current ones but with some magic values changed.submask_particleshas an extra line when calling the MT (or BGS) filter:ntarget = np.minimum(ntarget, 100)that is not called for the ST usual filter. Is that intentional ? If yes, why ? If not, the statement can be moved before thesubmaskinitialization to avoid duplicate code.