AFM-analysis / igor2

Python3 Igor Pro pxp and ibw file reader
GNU Lesser General Public License v3.0
8 stars 7 forks source link

Expand compatibility to older Python/NumPy versions #16

Closed TeetotalingTom closed 4 months ago

TeetotalingTom commented 4 months ago

The existing version of Igor2 is only compatible with Python >V3.9 - the pyproject.toml file suggests V3.8 is permitted, but NumPy V1.25.1 enforces Python V3.9. Unfortunately, many high performance computers and Ubuntu releases come with older Python versions, making Igor2 and packages depending on it incompatible without requiring a Python update.

The incompatibility of Igor2 currently exists because older combinations of Python+NumPy do not automatically show the data type if the data type size equals the default size for that type on the operating system. I have modified the functionality of pprint.pformat in helper.py file such that the data type of every array is now printed automatically. The tests have been updated accordingly to specify the data type automatically everywhere.

I have performed the tests with Python V3.7+NumPy V1.21.5 as well as Python V3.10+NumPy V1.26.4, and the code passes all the tests for both version combinations. It would probably work for even older versions of Python, but I have not tested that.

paulmueller commented 4 months ago

Thanks! It looks like we are having a numpy 2.0 compatibility issue with np.complex_ vs np.complex128 in the current code. -> #17