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

Update Numpy: np.asscalar -> numpy.ndarray.item() instead #29

Open
royforestano opened this issue Nov 6, 2022 · 0 comments
Open

Update Numpy: np.asscalar -> numpy.ndarray.item() instead #29

royforestano opened this issue Nov 6, 2022 · 0 comments

Comments

@royforestano
Copy link

royforestano commented Nov 6, 2022

This error arises upon:

import taurex


AttributeError Traceback (most recent call last)
in
5 import sys
6
----> 7 import taurex
8 taurex.log.disableLogging()

/opt/anaconda3/lib/python3.8/site-packages/taurex/init.py in
1
2 from ._version import version
----> 3 from ._citation import citations
4 from .taurexdefs import OutputSize

/opt/anaconda3/lib/python3.8/site-packages/taurex/_citation.py in
----> 1 from taurex.core import Citable
2
3
4 class TauREXCitations(Citable):
5

/opt/anaconda3/lib/python3.8/site-packages/taurex/core/init.py in
----> 1 from taurex.data.fittable import fitparam, Fittable, derivedparam
2 from taurex.data.citation import Citable, unique_citations_only, to_bibtex
3 from taurex.output.output import Output
4
5

/opt/anaconda3/lib/python3.8/site-packages/taurex/data/init.py in
----> 1 from .planet import Planet

/opt/anaconda3/lib/python3.8/site-packages/taurex/data/planet.py in
1 from taurex.log import Logger
----> 2 from taurex.constants import G, RJUP, MJUP, AU
3 from .fittable import fitparam, Fittable, derivedparam
4 from taurex.output.writeable import Writeable
5 import math

/opt/anaconda3/lib/python3.8/site-packages/taurex/constants.py in
2 from taurex.util.util import conversion_factor
3 import numpy as np
----> 4 import astropy.constants as c
5
6 AMU = conversion_factor('u', 'kg')

/opt/anaconda3/lib/python3.8/site-packages/astropy/constants/init.py in
21
22 # Hack to make circular imports with units work
---> 23 from astropy import units
24 del units
25

/opt/anaconda3/lib/python3.8/site-packages/astropy/units/init.py in
15 # where most time is spent (e.g., using python -X importtime).
16 from .core import *
---> 17 from .quantity import *
18
19 from . import si

/opt/anaconda3/lib/python3.8/site-packages/astropy/units/quantity.py in
27 from astropy.utils.data_info import ParentDtypeInfo
28 from astropy import config as _config
---> 29 from .quantity_helper import (converters_and_unit, can_have_arbitrary_unit,
30 check_output)
31 from .quantity_helper.function_helpers import (

/opt/anaconda3/lib/python3.8/site-packages/astropy/units/quantity_helper/init.py in
8 # By importing helpers, all the unit conversion functions needed for
9 # numpy ufuncs and functions are defined.
---> 10 from . import helpers, function_helpers
11 # For scipy.special and erfa, importing the helper modules ensures
12 # the definitions are added as modules to UFUNC_HELPERS, to be loaded

/opt/anaconda3/lib/python3.8/site-packages/astropy/units/quantity_helper/function_helpers.py in
125 IGNORED_FUNCTIONS = {
126 # Deprecated
--> 127 np.asscalar,
128 # I/O - useless for Quantity, since no way to store the unit.
129 np.save, np.savez, np.savetxt, np.savez_compressed,

/opt/anaconda3/lib/python3.8/site-packages/numpy/init.py in getattr(attr)
309 return Tester
310
--> 311 raise AttributeError("module {!r} has no attribute "
312 "{!r}".format(name, attr))
313

AttributeError: module 'numpy' has no attribute 'asscalar'

This function, numpy.asscalar needs to be changed to numpy.ndarray.item() instead. I cannot seem to do this manually or from source.

For now, I will open up a new environment and install the version of numpy that is compatible.

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