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

remove unneeded param structures before validation #409

Closed daviesje closed 1 month ago

daviesje commented 1 month ago

In _setup_params which is called for every output structure, if a certain parameter structure is not provided it will not be returned, however the default parameter structure is still passed into validate_inputs. This means that for structures which don't require some of the input parameters (InitialConditions and PertrubedField which don't need astro params). If the other provided structures conflict with the defaults (not the actual provided parameters), then an error will be raised or unexpected behaviour will occur.

This PR makes the small change that parameter structures which are not requested from the funcion are not passed into validate_inputs.

steven-murray commented 1 month ago

@daviesje I'm worried that this small change is breaking so many tests. What parameter is now getting passed through differently?

daviesje commented 1 month ago

@daviesje I'm worried that this small change is breaking so many tests. What parameter is now getting passed through differently?

Yeah this was unexpected, I'm looking into the way the parameters are setup in the integration tests, something might be fetching a default when it isn't meant to

codecov[bot] commented 1 month ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 82.51%. Comparing base (a16376c) to head (ade25a8). Report is 3 commits behind head on master.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #409 +/- ## ========================================== + Coverage 82.47% 82.51% +0.03% ========================================== Files 13 13 Lines 3121 3122 +1 Branches 842 842 ========================================== + Hits 2574 2576 +2 Misses 391 391 + Partials 156 155 -1 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.