Added NR yields, updated defaut yields treatment#357
Conversation
cfuselli
left a comment
There was a problem hiding this comment.
Looks great thanks Daniel.
It will require us to update the configs to default to -1 now instead of a list of -1s (much better approach ofc).
Except for the one type looks very good.
|
@WenzDaniel I changed to this PR the default sim config version for the tests from SR1 to SR2 dev. |
Pull Request Test Coverage Report for Build 21473361224Details
💛 - Coveralls |
for more information, see https://pre-commit.ci
|
Hey @WenzDaniel I modified the tests in here, if we can merge https://github.com/XENONnT/private_nt_aux_files/pull/474 I think all the tests will pass. |
There was a problem hiding this comment.
Pull request overview
This pull request adds support for customizing Nuclear Recoil (NR) yields in NEST v2 simulations and improves the clarity of default yield parameter handling. The changes enable users to modify NR yields similarly to how ER yields can currently be modified, and refactors the yields parameter initialization to make the default handling more explicit.
Changes:
- Added
nest_nr_yields_parametersconfiguration parameter with support for custom values or default NEST parameters - Refactored yields parameter handling to explicitly check for list values, -1 default flag, or raise errors for unsupported values
- Updated default simulation configuration from sr1_dev to sr2_dev across test utilities and context definitions
- Modified CI configuration to use environment variables for test configuration, supporting both sr1_dev (lowest dependencies) and sr2_dev (latest dependencies)
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| fuse/plugins/micro_physics/yields.py | Added NR yields parameter configuration, refactored parameter initialization logic for both ER and NR yields, and integrated NR yields into NEST GetYields call |
| tests/_utils.py | Changed test configuration to use environment variable with sr2_dev as default |
| fuse/context.py | Updated default simulation config file from sr1_dev to sr2_dev |
| .github/workflows/pytest.yml | Added FUSE_TEST_SIMULATION_CONFIG environment variable that switches between sr1_dev and sr2_dev based on dependency version |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| type=(int, list), | ||
| help="Set to modify default NEST ER yields parameters. Use -1 to keep default value. \ | ||
| From NEST code https://github.com/NESTCollaboration/nest/blob/v2.4.0/src/NEST.cpp \ | ||
| Used in the calcuations of BetaYieldsGR.", |
There was a problem hiding this comment.
Spelling error: 'calcuations' should be 'calculations'.
| Used in the calcuations of BetaYieldsGR.", | |
| Used in the calculations of BetaYieldsGR.", |
| "SIMULATION_CONFIG_FILE.json?&fmt=json" | ||
| "&take=nest_nr_yields_parameters", | ||
| type=(int, list), | ||
| help="Set to modify default NEST NR yields parameters. Use -1 to keep default value.", |
There was a problem hiding this comment.
The help text for nest_nr_yields_parameters is less detailed than for nest_er_yields_parameters. Consider adding similar documentation about the NEST code source and its usage to maintain consistency.
| help="Set to modify default NEST NR yields parameters. Use -1 to keep default value.", | |
| help="Set to modify default NEST NR yields parameters. Use -1 to keep default value. \ | |
| From NEST code https://github.com/NESTCollaboration/nest/blob/v2.4.0/src/NEST.cpp \ | |
| Used in the calculations of NR yields.", |
* Added NR yields, updated defaut yields treatment * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Fix typo * Update test simulation config from sr1_dev to sr2_dev * Update simulation config file for microphysics context * env var in tests * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * fix precommit * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Carlo Fuselli <cfuselli@nikhef.nl>
What does the code in this PR do / what does it improve?
Adds the possibility to update NR yields of NESTv2. Makes default yield setting treatment more clear.
Also: