skypy icon indicating copy to clipboard operation
skypy copied to clipboard

ENH: Input consistency across examples in Boltzmann codes

Open jucordero opened this issue 4 years ago • 5 comments

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.

jucordero avatar Apr 15 '20 14:04 jucordero

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.

rrjbca avatar Apr 23 '20 14:04 rrjbca

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.)

ntessore avatar May 09 '20 08:05 ntessore

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.

rrjbca avatar May 18 '20 15:05 rrjbca

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?

ntessore avatar May 18 '20 15:05 ntessore

Reviewed on 22/11/22 and kept as an intention for future development.

itrharrison avatar Nov 22 '22 11:11 itrharrison