skypy
skypy copied to clipboard
ENH: Input consistency across examples in Boltzmann codes
Description
Examples across different modules use different arbitrary input arrays and values.
For instance, the Eisenstein & Hu module uses a log-spaced input for the wavenumbers
wavenumber = np.logspace(-3, 1, num=5, base=10.0)
whereas halofit and camb use completely different inputs
wavenumber = np.array([1.e-2, 1.e-1, 1e0])
kvec = np.array([1.00000000e-04, 1.01000000e+01])
This is also observed with redshift input arrays in the galaxy modules.
Depending on the context, it could be a good idea to have a set of predefined inputs and values for the examples, in order to make it easy for us developers and users when building a pipeline.
I noticed some examples and tests use custom defined cosmologies which detract from what's actually important in those cases. I would suggest using e.g. Planck15 to simplify and improve consistency (except in those cases where a specific cosmology is required). Definitely low priority.
We could use the default cosmology in modules, in which case the examples have less noise in them. See the astropy.cosmology
recommendation, in particular the note at the end.
(The driver could then set the default cosmology as specified instead of passing it around, but that's another discussion.)
If we use default_cosmology
in our docstring examples, astropy could redefine it in the future and cause our tests to fail. I think we should define our own default cosmology or set it explicitly to e.g. Planck15
. Then if we choose to update it ourselves we can update our docstrings at the same time.
If we use
default_cosmology
in our docstring examples, astropy could redefine it in the future and cause our tests to fail.
The intended default cosmology would be set in the test setup.
I think we should define our own default cosmology or set it explicitly to e.g.
Planck15
. Then if we choose to update it ourselves we can update our docstrings at the same time.
But why duplicate the effort if astropy has a very functional "default cosmology" mechanism?
Reviewed on 22/11/22 and kept as an intention for future development.