feat: allow random_seed and node_redshifts to be set in TOML profiles, with CLI support#618
feat: allow random_seed and node_redshifts to be set in TOML profiles, with CLI support#618steven-murray wants to merge 47 commits intorelease-v4.2from
Conversation
|
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
|
@DanielaBreitman you might be interested in this too |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## release-v4.2 #618 +/- ##
================================================
+ Coverage 88.42% 90.66% +2.24%
================================================
Files 32 32
Lines 4777 4831 +54
Branches 811 827 +16
================================================
+ Hits 4224 4380 +156
+ Misses 394 293 -101
+ Partials 159 158 -1 ☔ View full report in Codecov by Sentry. |
Reducing more memory with MINIMIZE_MEMORY
ci: add gpu labels
ci: add high-effort label
fix: segfault when using photoncons
Fixed halo_sfr unit typo in tutorial
Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 5 to 6. - [Release notes](https://github.com/codecov/codecov-action/releases) - [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md) - [Commits](codecov/codecov-action@v5...v6) --- updated-dependencies: - dependency-name: codecov/codecov-action dependency-version: '6' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com>
…ov/codecov-action-6 build(deps): bump codecov/codecov-action from 5 to 6
…d6/action-download-artifact-19 build(deps): bump dawidd6/action-download-artifact from 16 to 19
Bumps [release-drafter/release-drafter](https://github.com/release-drafter/release-drafter) from 6.2.0 to 7.1.1. - [Release notes](https://github.com/release-drafter/release-drafter/releases) - [Commits](release-drafter/release-drafter@v6.2.0...v7.1.1) --- updated-dependencies: - dependency-name: release-drafter/release-drafter dependency-version: 7.1.1 dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com>
Agent-Logs-Url: https://github.com/21cmfast/21cmFAST/sessions/e0cbd364-2c5c-41e3-95a6-0284d00a13fb Co-authored-by: steven-murray <1272030+steven-murray@users.noreply.github.com>
Agent-Logs-Url: https://github.com/21cmfast/21cmFAST/sessions/ad988f36-9a93-4ad7-af4b-d6d857c3feff Co-authored-by: steven-murray <1272030+steven-murray@users.noreply.github.com>
…se-drafter/release-drafter-7.1.1 build(deps): bump release-drafter/release-drafter from 6.2.0 to 7.1.1
|
@copilot please add the ability for the CLI command but where Furthermore, let there be another possible argument, Finally, let there be an argument Add the new functionality to the CLI documentation in the |
Agent-Logs-Url: https://github.com/21cmfast/21cmFAST/sessions/01ba284c-682b-4df6-abf6-b6fe8d317818 Co-authored-by: steven-murray <1272030+steven-murray@users.noreply.github.com>
Done in commit
CLI (
Example usage: Documentation added to |
steven-murray
left a comment
There was a problem hiding this comment.
Thank you @copilot for the new feature. I have made one comment for modification, and there are two other things to accomplish also:
- Please also add a
random_seed(aliased to both--random-seedand--seed) argument to the21cmfast template createcommand. This way the user can get a fully specified template from this command. - Once the new feature and modification are implemented, ensure that the CI checks pass (including the pre-commit checks)
src/py21cmfast/cli.py
Outdated
| zmax: Annotated[float | None, Parameter(name="--zmax")] = None, | ||
| zstep: Annotated[float | None, Parameter(name="--zstep")] = None, | ||
| nz: Annotated[int | None, Parameter(name="--nz")] = None, | ||
| zscroll_func: Annotated[ |
There was a problem hiding this comment.
Let's actually change the name of this parameter to znode_func to be more consistent with naming throughout the code.
There was a problem hiding this comment.
Renamed in commit 4b5e46d: zscroll_func → znode_func and --zscroll-func → --znode-func (in cli.py, cli_usage.rst, and test_cli.py).
…template create Agent-Logs-Url: https://github.com/21cmfast/21cmFAST/sessions/eb992d1f-029a-43fa-a6bb-a720207c7a45 Co-authored-by: steven-murray <1272030+steven-murray@users.noreply.github.com>
Done in commit
|
…temp Fix NaN in brightness_temp caused by tau21=0 division by zero
|
@copilot please merge the main branch into this one, and ensure that all pre-commit checks pass. |
# Conflicts: # uv.lock Co-authored-by: steven-murray <1272030+steven-murray@users.noreply.github.com>
Agent-Logs-Url: https://github.com/21cmfast/21cmFAST/sessions/7c4b15d6-469a-43df-8033-1f6aab783039 Co-authored-by: steven-murray <1272030+steven-murray@users.noreply.github.com>
Done in commit |
|
@jordanflitter I believe this one is ready for review again. Unfortunately after merging the current I think the best test will be a quick play with it. |
This updates the reading/writing of TOML "template" files to allow
random_seedandnode_redshiftsto be written there.In particular, this allows for much easier loading of cached coeval boxes after running a simulation. E.g. in the run script you might have...
Now, after running that very large simulation, you would like to read some boxes with the nifty
RunCachetool in a separate script. Before this PR you must do:And hope that you kept the random seed and node redshifts in sync between the two scripts.
Now you can just do:
By default if
mode='full'inwrite_template()the full information is written (including random seed and node redshifts). However, ifmode="minimal"then these are not written. A minimal template is meant to be more like a "physical model" (like our built in templates) which doesn't try to specify what the exact random seed is.CLI: Embedding Node Redshifts and Random Seed in a Template
The
21cmfast template createcommand can now embednode_redshiftsandrandom_seeddirectly into the template file by specifying one or more of the following new options:--random-seed/--seed--zmin--zmaxZ_HEAT_MAXfrom model--zstepZPRIME_STEP_FACTORfrom model--nz--zstep--znode-funclogspacelogspaceorlinearExample usage:
The
--znode-func logspaceoption callsInputParameters.with_logspaced_redshifts(which also gains a newnzparameter). The--znode-func linearoption calls the newInputParameters.with_linear_redshiftsmethod.Documentation for the new options has been added to
docs/tutorials/cli_usage.rst.