imr-framework / pypulseq

Pulseq in Python
https://pypulseq.readthedocs.io
GNU Affero General Public License v3.0
117 stars 63 forks source link

np.int is deprecated in numpy>=1.20.0 #100

Closed skarrea closed 1 year ago

skarrea commented 1 year ago

With the current requirements in setup.py numpy >=1.20 will be installed where np.int is deprecated.

Changing all occurrences of np.int to np.int32 is compatible with both 1.19.5 <= numpy <= 1.20.0, and numpy >= 1.20.0 (tested with 1.23.5). np.int can also be changed to np.int64 if necessary.

sravan953 commented 1 year ago

Oops I closed this by mistake. Thanks for catching this! According to the release notes, np.int is the same as int. In that case, would it make a difference if we switched to 'int'?

skarrea commented 1 year ago

Not really. I would guess it comes with a minimal performance penalty since int will be interpreted as np.int_ (since numpy arrays can't contain int). np.int_ will then default to np.int32 or np.int64 depending on the system.

sravan953 commented 1 year ago

You're right; it's best to avoid that penalty by directly specifying np.int32 ourselves.