Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changed complex data type in table #18

Merged
merged 1 commit into from
Jun 17, 2024

Conversation

TeetotalingTom
Copy link

This change of data type should make Igor2 compatible with NumPy V2.0, while being backwards compatible down to at least NumPy V1.19.

Type 1 does not seem to have an actual purpose, but exists due to how the type table was historically structured. It appears that the type number read from files is decremented by 1 when the type is complex. Therefore, type 5 maps to twice type 4 (real and imaginary), type 3 maps two twice type 2, and interestingly, type 1 would be mapped to two text types, which suggests that it doesn't exist at all. At least it is not used in the tests and any IGOR Pro files I encountered. Further evidence for this claim can be found in the MATLAB code found here. For completeness, we map it to numpy.complex128, but it appears one could map it to anything - perhaps completely eliminate the statement entirely to avoid future confusion (we don't need an Igor3).

(This ironically makes it all the more painful that this single line of code is the raison d'être of Igor2, as the assigned type in Igor was the cause of compatibility with later NumPy versions.)

@paulmueller paulmueller merged commit b9003f8 into AFM-analysis:master Jun 17, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants