21cmfast / 21cmFAST

Official repository for 21cmFAST: a code for generating fast simulations of the cosmological 21cm signal
MIT License
58 stars 37 forks source link

fix: R_BUBBLE_MAX set to BOX_LEN if it's too large #286

Closed steven-murray closed 1 year ago

steven-murray commented 2 years ago

Fixes #112

In fixing this, I found that it was nice to have a standalone function where we put all the validation between different structs. This will make it easier in the future to do the validation between eg. user params and flag options.

I also found it useful to abstract out some of the logic in each of the high-level functions where we basically just configure/check inputs. Since each function had essentially the same pattern, it seemed easier just to make it a function (I called it _setup_inputs). This function now runs the new validate_all_inputs function.

codecov[bot] commented 2 years ago

Codecov Report

Base: 86.36% // Head: 86.31% // Decreases project coverage by -0.04% :warning:

Coverage data is based on head (7e05226) compared to base (4ff8d85). Patch coverage: 90.21% of modified lines in pull request are covered.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #286 +/- ## ========================================== - Coverage 86.36% 86.31% -0.05% ========================================== Files 12 13 +1 Lines 2786 2784 -2 ========================================== - Hits 2406 2403 -3 - Misses 380 381 +1 ``` | [Impacted Files](https://codecov.io/gh/21cmfast/21cmFAST/pull/286?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=21cmfast) | Coverage Δ | | |---|---|---| | [src/py21cmfast/\_cfg.py](https://codecov.io/gh/21cmfast/21cmFAST/pull/286/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=21cmfast#diff-c3JjL3B5MjFjbWZhc3QvX2NmZy5weQ==) | `96.87% <ø> (ø)` | | | [src/py21cmfast/inputs.py](https://codecov.io/gh/21cmfast/21cmFAST/pull/286/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=21cmfast#diff-c3JjL3B5MjFjbWZhc3QvaW5wdXRzLnB5) | `90.30% <85.00%> (+0.41%)` | :arrow_up: | | [src/py21cmfast/wrapper.py](https://codecov.io/gh/21cmfast/21cmFAST/pull/286/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=21cmfast#diff-c3JjL3B5MjFjbWZhc3Qvd3JhcHBlci5weQ==) | `88.74% <91.17%> (-0.33%)` | :arrow_down: | | [src/py21cmfast/\_version.py](https://codecov.io/gh/21cmfast/21cmFAST/pull/286/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=21cmfast#diff-c3JjL3B5MjFjbWZhc3QvX3ZlcnNpb24ucHk=) | `100.00% <100.00%> (ø)` | | | [src/py21cmfast/outputs.py](https://codecov.io/gh/21cmfast/21cmFAST/pull/286/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=21cmfast#diff-c3JjL3B5MjFjbWZhc3Qvb3V0cHV0cy5weQ==) | `92.18% <100.00%> (+0.01%)` | :arrow_up: | Help us with your feedback. Take ten seconds to tell us [how you rate us](https://about.codecov.io/nps?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=21cmfast). Have a feature suggestion? [Share it here.](https://app.codecov.io/gh/feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=21cmfast)

:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.