nikolasibalic / ARC-Alkali-Rydberg-Calculator

Object-oriented Python library for computation of properties of highly-excited Rydbeg states of alkali and divalent atoms.
https://atomcalc.org
BSD 3-Clause "New" or "Revised" License
86 stars 72 forks source link

AttributeError: module 'numpy' has no attribute 'int'. #146

Closed HumpyBlumpy closed 9 months ago

HumpyBlumpy commented 1 year ago
def get_vdw_arc(state1,state2,theta=0,phi=0,dn=10,deltaMax=25e9):
    calculation = arc.PairStateInteractions(atom, state1[0],state1[1],state1[2],
                                            state2[0],state2[1],state2[2], state1[3],state2[3])
    C6 = calculation.getC6perturbatively(theta,phi, dn, deltaMax)
    return C6

print(get_vdw_arc([n2,0,0.5,0.5],[n2,0,0.5,0.5]))

    C6 = calculation.getC6perturbatively(theta,phi, dn, deltaMax)

  File ~\anaconda3\envs\arc\Lib\site-packages\arc\calculations_atom_pairstate.py:1237 in getC6perturbatively
    self.__initializeDatabaseForMemoization()

  File ~\anaconda3\envs\arc\Lib\site-packages\arc\calculations_atom_pairstate.py:1075 in __initializeDatabaseForMemoization
    self.__loadAngularMatrixElementsFile()

  File ~\anaconda3\envs\arc\Lib\site-packages\arc\calculations_atom_pairstate.py:583 in __loadAngularMatrixElementsFile
    data = np.array(np.rint(data), dtype=np.int)

  File ~\anaconda3\envs\arc\Lib\site-packages\numpy\__init__.py:305 in __getattr__
    raise AttributeError(__former_attrs__[attr])

AttributeError: module 'numpy' has no attribute 'int'.
`np.int` was a deprecated alias for the builtin `int`. To avoid this error in existing code, use `int` by itself. Doing this will not modify any behavior and is safe. When replacing `np.int`, you may wish to use e.g. `np.int64` or `np.int32` to specify the precision. If you wish to review your current use, check the release note link for additional information.
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

Using numpy 1.24.3, arc 3.3.0

Also np.complex, etc...

dehond commented 11 months ago

I have the same problem when using ARC (3.2.8) with new versions of numpy. The solution is ostensibly simple: replace the deprecated numpy types with their native Python equivalents, but perhaps some higher-level coordination is required here since I don't know to what extent this problem permeates the ARC code.

nikolasibalic commented 9 months ago

Should be resolved in ARC v3.4.0