Fix parsing for grid spacing with type long double#1137
Merged
ax3l merged 2 commits intoopenPMD:devfrom Nov 6, 2021
Merged
Conversation
Contributor
Author
|
Python seems to be really committed to using temperature.grid_spacing = np.array([1, 1], dtype=np.double)Even this one creates long doubles. This could mean that it is currently impossible in our API to specify a dataset's grid spacing in Python. |
5fdb09b to
964561c
Compare
Contributor
Author
|
It looks like the CI is again in a mood |
ax3l
added a commit
to ax3l/openPMD-api
that referenced
this pull request
Jun 8, 2022
In `pybind11`, overloads on types are order-dependent (first wins). pybind/pybind11#1512 We specialize `double` here generically and cast in read if needed (see openPMD#345 openPMD#1137). Later on, we could add support for 1D numpy arrays with distinct type.
ax3l
added a commit
that referenced
this pull request
Dec 20, 2022
In `pybind11`, overloads on types are order-dependent (first wins). pybind/pybind11#1512 We specialize `double` here generically and cast in read if needed (see #345 #1137). Later on, we could add support for 1D numpy arrays with distinct type.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Mesh.cpphas an explicit instantiation for long double grid spacings:This is important for our Python API as floats default to
long doublethere:Result of that:
But upon trying to open that Series again:
Because our reading routines only check for float and double.
First commit: Failing test
Second commit: Fix
We should maybe scan our codebase for similar errors.