-
Notifications
You must be signed in to change notification settings - Fork 8
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
Create arrays that represent the dimension of each grid axis #40
Conversation
f713669
to
6cf7cfd
Compare
@RemiLehe can you please rebase? It collides with your previous whitespace changes :) |
openpmd_validator/check_h5.py
Outdated
@@ -599,7 +599,7 @@ def check_meshes(f, iteration, v, extensionStates): | |||
result_array += test_attr(field, v, "required", | |||
"gridGlobalOffset", np.ndarray, [np.float32, np.float64]) | |||
result_array += test_attr(field, v, "required", | |||
"gridUnitSI", np.float64) | |||
"gridUnitSI", np.ndarray, np.float64) |
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.
gridUnitDimension
needs to be verified now as well
rho.attrs["position"] = np.array([0.0, 0.0], dtype=np.float32) | ||
rho.attrs["gridUnitSI"] = np.float64(1.0) | ||
rho.attrs["gridUnitSI"] = np.array([1.0]*2, dtype=np.float64) |
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.
Wow, interesting syntax...
maybe we can write [1.0, 1.0]
for clarity?
or define a variable named dataDim = 2
for 2
so it's not a magic number?
rho.attrs["gridUnitSI"] = np.float64(1.0) | ||
rho.attrs["gridUnitSI"] = np.array([1.0]*2, dtype=np.float64) | ||
rho.attrs["gridUnitDimension"] = \ | ||
np.array( [1.,0.,0.,0.,0.,0.,0.]*2, dtype=np.float64 ) |
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.
maybe add comment behind: # x: spatial (L), y: spatial (L)
E.attrs["gridGlobalOffset"] = np.array([0.0, 0.0], dtype=np.float32) | ||
E.attrs["gridUnitSI"] = np.float64(1.0) | ||
E.attrs["gridGlobalOffset"] = np.array([0.0, 0.0], dtype=np.float32) | ||
E.attrs["gridUnitSI"] = np.array([1.0]*3, dtype=np.float64 ) |
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.
this is 2D as well
E.attrs["gridGlobalOffset"] = np.array([0.0, 0.0], dtype=np.float32) | ||
E.attrs["gridUnitSI"] = np.array([1.0]*3, dtype=np.float64 ) | ||
E.attrs["gridUnitDimension"] = \ | ||
np.array( [1.,0.,0.,0.,0.,0.,0.]*3, dtype=np.float64 ) |
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.
this is 2D as well
6cf7cfd
to
5d297d5
Compare
thank you so much! :) |
This implements the changes proposed in openPMD/openPMD-standard#193
See this PR for more details.