-
Notifications
You must be signed in to change notification settings - Fork 27
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
Add Complex Number Support #233
Conversation
Hi @calgray , |
Hi @constantinpape, I've yet build and update the tests locally (looks like |
I see, thanks for the clarification! Then this seems to be just due to missing includes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @calgray ,
I only had time to check this now, but it looks good to go from my side now. Anything else you want to add? Otherwise I can merge it.
I noticed there is some dtype related code in |
src/python/test/test_dataset.py
Outdated
'float32', 'float64' | ||
'float32', 'float64', # 'float128', | ||
'complex64', 'complex128', # 'complex256', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've observed good behaviour with complex64 and complex128 in both Zarr and N5 format, but complex256 is problematic, possibly due to a dependency's limited support for float128. I don't particularly need that precision level, but it is the last precision level supported by npy and could be a good addition in the future once the problem is better understood.
Happy to remove all mentions of float128 and complex256, or leave them as is to raise visibility about missing functionality.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think leaving it as a comment is good to point to the possibility of adding it.
The tests are now broken because it tries to run them for
Could you fix that by removing
It looks like you took care of this already, or am I missing something? |
Looks like some of these tests got skipped in my testing due to not installing The main issue seems to be the writer defaulting to |
Interesting, that's indicative that the Windows test run is using a numpy version prior to |
Thanks for fixing the tests. I agree it's best to do the python bindings in a separate PR. |
NPY and Zarr support complex floating point tensors with the
<c
dtype prefix, but are not yet supported by z5. This changeset adds support for 3 fixed sized complex dtypes made available and tested using the C++ standard librarystd::complex<T>
.External to this PR I've tested loading complex tensors from Zarr but not N5, if there's evidence N5 does support complex numbers I'd be open to exploring support for N5 too.