-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix jax.config
, remove astropy import
#20
Conversation
- `from jax.config import config` raised an ImportError in JAX 0.4.25. Specifically: Importing the jax.config submodule via `import jax.config` is deprecated. To configure JAX use `import jax` and then reference the config object via `jax.config`. - `star.py` imports `import astropy.units as u`, but astropy was not listed as a dependency in `pyproject.toml`.
Hi @dgegen and thanks for the changes, both relevant. |
Thanks! Regarding >>> import nuance
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/usr/pydev/nuance/nuance/nuance/__init__.py", line 11, in <module>
from nuance.star import Star
File "/Users/usr/pydev/nuance/nuance/nuance/star.py", line 3, in <module>
import astropy.units as u
ModuleNotFoundError: No module named 'astropy' |
Sure, it makes sense since it is imported in this file. Unless I am missing something I think you can remove the import in |
Oh my – I am being silly again! For some reason I had thought you just wanted me to take out the dependency, but re-reading it now, I see that you clearly said to take out the import as well 🙈 Sorry for the inconvenience – writing your last message must have been a bit disturbing :)) |
No worries at all :) Thanks a lot for these additions! |
Oh one last thing before merging. Can you bump the minor version of the package in the pyproject file? It should be |
Done! |
jax.config
, add astropy as dependencyjax.config
, remove astropy import
Two small changes to ensure that nuance runs without errors after installation via
pip
.from jax.config import config
raises anImportError
in the newest version of JAX (0.4.25). It turns out that importing thejax.config
submodule viaimport jax.config
is deprecated and referencing the config object viajax.config
is encouraged. Thus,config = jax.config
was added to__init__.py
, so thatnuance.config
can still be used to accessjax.config
as was the case previously, although one could probably debate whether this is desirable conceptually.star.py
importsimport astropy.units as u
, but astropy was not listed as a dependency inpyproject.toml
.Keep up the inspiring work!