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

std::complex #203

Closed
ax3l opened this issue May 24, 2018 · 7 comments · Fixed by #639
Closed

std::complex #203

ax3l opened this issue May 24, 2018 · 7 comments · Fixed by #639

Comments

@ax3l
Copy link
Member

ax3l commented May 24, 2018

Although not part of the openPMD standard yet, handling of types for std::complex< T > with float, double and long double could be investigated.

Keep in mind:

@CFGrote
Copy link
Contributor

CFGrote commented Jun 18, 2019

yep, i need this for wavefront data. any progress here?

@ax3l
Copy link
Member Author

ax3l commented Jun 18, 2019 via email

@CFGrote
Copy link
Contributor

CFGrote commented Jun 19, 2019 via email

@ax3l
Copy link
Member Author

ax3l commented Jul 1, 2019

For the interested reader of this issue that would like to work on this:
the first step is to define new data types in include/openPMD/Datatype.hpp

Then, e.g. starting with HDF5, one defines new types in the backends such as src/IO/HDF5/HDF5IOHandler.cpp. For HDF5 in particular, we want to be compatible with h5py's representation of types [1] [2] (more general info on compound types).

In ADIOS1 (https://github.com/ornladios/ADIOS/search?q=complex&unscoped_q=complex) as well as ADIOS2, complex data types are supported by default: https://adios2.readthedocs.io/en/latest/components/components.html#variables-data-types

In JSON we probably just write a real-imaginary tuple.

@ax3l
Copy link
Member Author

ax3l commented Dec 18, 2019

Implementation started in #639

@ax3l
Copy link
Member Author

ax3l commented Feb 12, 2020

The implementation is mainly done, just waiting for a new ADIOS2 release to be tagged. We contributed support for complex types in attributes: ornladios/ADIOS2#1908

@ax3l ax3l closed this as completed in #639 Sep 3, 2020
ax3l added a commit that referenced this issue Sep 3, 2020
Add support for complex numbers as fundamental data type.

Close #203 

- [x] Tests
- [x] internals: new types, comparisons, allowed casts, record components, patches and attributes, etc.
- [x] JSON (writes to pairs, read re-identification as complex is todo)
- [x] HDF5
- [x] ADIOS1 (no long double complex; no attributes of arrays of complex: ornladios/ADIOS#212)
- [x] ADIOS2: (complex attributes: ornladios/ADIOS2#1908);  (no long double complex ornladios/ADIOS2#1907)
- [x] Python bindings
@ax3l
Copy link
Member Author

ax3l commented Sep 3, 2020

Standardization agreed upon and documented here: openPMD/openPMD-standard#29 (comment)

#639 adds the implementation in the API and will be shipped with the next release, openPMD-api 0.12.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants