Skip to content
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

AttributeError: module 'numpy' has no attribute 'object'. #27

Open
pentyum opened this issue Jun 29, 2024 · 0 comments
Open

AttributeError: module 'numpy' has no attribute 'object'. #27

pentyum opened this issue Jun 29, 2024 · 0 comments

Comments

@pentyum
Copy link
Contributor

pentyum commented Jun 29, 2024

AttributeError                            Traceback (most recent call last)
Cell In[19], line 1
----> 1 spectra = desigal.specutils.get_spectra(targets, release="fuji", n_workers=-1, use_db = False)

File ~/miniconda3/envs/desi/lib/python3.12/site-packages/desigal/specutils/spectra_io.py:64, in get_spectra(targetids, release, n_workers, use_db, zcat_table, **kwargs)
     62     sel_data = _sel_objects_table(zcat_table, targetids)
     63 else:
---> 64     sel_data = _sel_objects_fits(release, release_path, targetids)
     66 sel_data = sel_data.set_index("TARGETID", drop=False)
     67 sel_data = sel_data.loc[targetids]

File ~/miniconda3/envs/desi/lib/python3.12/site-packages/desigal/specutils/spectra_io.py:129, in _sel_objects_fits(release, release_path, targetids, **kwargs)
    127 sel_data = sel_data[["SURVEY", "PROGRAM", "HEALPIX", "TARGETID"]].to_pandas()
    128 for col, dtype in sel_data.dtypes.items():
--> 129     if dtype == np.object:  # Only process object columns.
    130         # decode, or return original value if decode return Nan
    131         sel_data[col] = sel_data[col].str.decode("utf-8")
    133 return sel_data

File ~/miniconda3/envs/desi/lib/python3.12/site-packages/numpy/__init__.py:324, in __getattr__(attr)
    319     warnings.warn(
    320         f"In the future `np.{attr}` will be defined as the "
    321         "corresponding NumPy scalar.", FutureWarning, stacklevel=2)
    323 if attr in __former_attrs__:
--> 324     raise AttributeError(__former_attrs__[attr])
    326 if attr == 'testing':
    327     import numpy.testing as testing

AttributeError: module 'numpy' has no attribute 'object'.
`np.object` was a deprecated alias for the builtin `object`. To avoid this error in existing code, use `object` by itself. Doing this will not modify any behavior and is safe. 
The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at:
    https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations
pentyum added a commit to pentyum/desigal that referenced this issue Jun 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant