DifferentiableUniverseInitiative / jax_cosmo

A differentiable cosmology library in JAX
MIT License
172 stars 36 forks source link

interp(x, xp, fp) #91

Open jecampagne opened 2 years ago

jecampagne commented 2 years ago

Hi, jax.numpy has an interp method since August 2020, with the same API, so I guess we can switch to this JAX implementation instead of https://github.com/DifferentiableUniverseInitiative/jax_cosmo/blob/master/jax_cosmo/scipy/interpolate.py

jecampagne commented 2 years ago

In def radial_comoving_distance ( background.py)

240:  a = np.atleast_1d(a)

is not useful using jnp.interp and more it prevents to make a grad.

eelregit commented 2 years ago

Maybe asarray is enough.