Skip to content

NESTML dependency astropy not happy with new numpy

This issue was found in current 23.09-rc when trying NESTML (py-nestml), but is related to an upstream dependency. Maybe this can be solved by downgrading py-numpy, but developers are notified in issue https://github.com/nest/nestml/issues/967 to fix the root of the problem.

File /srv/main-spack-instance-2309/spack/var/spack/environments/ebrains-23-09/.spack-env/view/lib/python3.8/site-packages/astropy/units/quantity_helper/function_helpers.py:126
    118 UNSUPPORTED_FUNCTIONS |= {np.linalg.slogdet}
    120 # The following are not just unsupported, but so unlikely to be thought
    121 # to be supported that we ignore them in testing.  (Kept in a separate
    122 # variable so that we can check consistency in the test routine -
    123 # test_quantity_non_ufuncs.py)
    124 IGNORED_FUNCTIONS = {
    125     # Deprecated
--> 126     np.asscalar,
    127     # I/O - useless for Quantity, since no way to store the unit.
    128     np.save, np.savez, np.savetxt, np.savez_compressed,
    129     # Polynomials
    130     np.poly, np.polyadd, np.polyder, np.polydiv, np.polyfit, np.polyint,
    131     np.polymul, np.polysub, np.polyval, np.roots, np.vander,
    132     # financial
    133     np.fv, np.ipmt, np.irr, np.mirr, np.nper, np.npv, np.pmt, np.ppmt,
    134     np.pv, np.rate}
    135 if NUMPY_LT_1_18:
    136     IGNORED_FUNCTIONS |= {np.rank}

File /srv/main-spack-instance-2309/spack/opt/spack/linux-ubuntu20.04-x86_64/gcc-10.3.0/py-numpy-1.23.5-rm3niouf5xjbvqy74ubkcuewixomy5ds/lib/python3.8/site-packages/numpy/__init__.py:311, in __getattr__(attr)
    308     from .testing import Tester
    309     return Tester
--> 311 raise AttributeError("module {!r} has no attribute "
    312                      "{!r}".format(__name__, attr))

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