-
Notifications
You must be signed in to change notification settings - Fork 10
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 spatial_data to csm serialization #364
Conversation
Codecov Report
@@ Coverage Diff @@
## master #364 +/- ##
==========================================
+ Coverage 97.56% 97.60% +0.04%
==========================================
Files 86 86
Lines 5376 5385 +9
==========================================
+ Hits 5245 5256 +11
+ Misses 131 129 -2
Continue to review full report at Codecov.
|
weldx/asdf/tags/weldx/core/transformations/coordinate_system_hierarchy.py
Outdated
Show resolved
Hide resolved
Hello @vhirtham! Thanks for updating this PR.
Comment last updated at 2021-06-22 09:34:23 UTC |
.../asdf/schemas/weldx.bam.de/weldx/core/transformations/coordinate_system_hierarchy-1.0.0.yaml
Outdated
Show resolved
Hide resolved
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.
asdf implementation LGTM 👍 (should be even easier once switching to graph backend for serialization)
I think it's a good time to implement __eq__
for SpatialData
assert np.allclose(sd.coordinates.data, sd_buffer.coordinates.data) | ||
if sd.triangles is not None: | ||
assert np.allclose(np.array(sd.triangles), np.array(sd_buffer.triangles)) |
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.
use ==
here once implemented
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.
Doesn't compare equal:
SpatialData(coordinates=<xarray.DataArray 'core/ndarray' (n: 2, c: 3)>
vs.
SpatialData(coordinates=<xarray.DataArray (n: 2, c: 3)>
The data seems to be equal, but since compare nested is using xarrays identical
function, we get a False
returned.
I remember that we had trouble with the identical
function before because it also considers the order of dimensions, coordinates etc. Alternatively, we can use equals
for a more relaxed comparison but I am not sure if this is really what we want.
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.
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'll try the workaround for now.
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.
Works now. Think we can merge
…rdinate_system_hierarchy-1.0.0.yaml Co-authored-by: Cagtay Fabry <[email protected]>
Changes
The data that is stored in the CSM is now also written to the asdf file.
Related Issues
Closes #348
Checks