marksgraham / OCT-Converter

Tools for extracting the raw optical coherence tomography (OCT) and fundus data from proprietary file formats.
https://pypi.org/project/oct-converter/
MIT License
195 stars 70 forks source link

oct_volume.peek() doesnt work with numpy 1.24 #75

Closed Atif-Anwer closed 1 year ago

Atif-Anwer commented 1 year ago

For numpy 1.24 and above, the error module 'numpy' has no attribute 'int' is thrown for oct_volume.peek() function.

The reason according to this SO answer is that numpy has removed the aliases np.int and np.float as of 1.24.

I can confirm the same by installing numpy ver 1.23 and below (which work fine) and 1.24.1 (which gives the error mentioned above).

Possible easy fix is to add a requirement for a numpy version lower than 1.24 i guess.

marksgraham commented 1 year ago

Thanks for spotting this. It looks like we can fix by specifying the type more explicitly, e.g. np.int16 rather than np.int. Can you confirm my fix works for you by installing with:

pip install git+https://github.com/marksgraham/OCT-Converter.git@refs/pull/76/merge

If so I'll merge and release

Atif-Anwer commented 1 year ago

Just tested with numpy 1.24.1. The commit works fine now and does not throw the error. 👍🏼

marksgraham commented 1 year ago

Thanks for checking, have released the fixed version