-
Notifications
You must be signed in to change notification settings - Fork 128
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< T > as attributes #1908
Comments
8 tasks
The specialization you need for #include <complex>
namespace std
{
// std::complex handling
template< class T > void to_json(nlohmann::json &j, const std::complex< T > &p) {
j = nlohmann::json {p.real(), p.imag()};
}
template< class T > void from_json(const nlohmann::json &j, std::complex< T > &p) {
p.real(j.at(0));
p.imag(j.at(1));
}
} |
ax3l
added a commit
to openPMD/openPMD-api
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi,
is there a specific reason why we do not allow
std::complex< T >
types as attributes in ADIOS2?Those are primitive types and according to my tests in openPMD-api, using complex types as attributes was possible in ADIOS1.
Can we potentially just update the macros that specialize the overloads to allow complex types for attributes as well?
The text was updated successfully, but these errors were encountered: