timothydmorton / isochrones

Pythonic stellar model grid access; easy MCMC fitting of stellar properties
http://isochrones.readthedocs.org
MIT License
123 stars 63 forks source link

`import isochrones` fails on readthedocs #176

Closed TomWagg closed 5 months ago

TomWagg commented 2 years ago

Love the package! I'm trying to document my own package which uses isochrones but there seems to be a bug that causes my build to fail.

When the environment variable "READTHEDOCS" is True, the package fails on import. This seems to be because you define LOG_ONE_OVER_ROOT_2PI using numpy but you don't import it when on_rtd=True (see here)

To reproduce:

export READTHEDOCS=True
python
    import isochrones

And you'll get the error:

LOG_ONE_OVER_ROOT_2PI = np.log(1.0 / np.sqrt(2 * np.pi)) NameError: name 'np' is not defined