Check data location, not size==n_face, in UxDataArray.to_geodataframe() and .integrate() - #1628
Draft
Sevans711 wants to merge 1 commit into
Draft
Check data location, not size==n_face, in UxDataArray.to_geodataframe() and .integrate()#1628Sevans711 wants to merge 1 commit into
size==n_face, in UxDataArray.to_geodataframe() and .integrate()#1628Sevans711 wants to merge 1 commit into
Conversation
Addresses #1616 TODO: regression tests
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.
Closes #1616
Overview
Switches to using
self._face_centered()instead ofself.values.size == self.uxgrid.n_face, insideUxDataArray.to_geodataframe()andUxDataArray.integrate(). The comparison toself.uxgrid.n_faceis brittle; it might get messed up by any grids which happen to have the same number of nodes as faces, or same number of edges as faces.Entirely removes the
... == self.uxgrid.n_edgeand... == self.uxgrid.n_nodechecks, and rewrites corresponding error messages. Those checks were just being used to provide a different error message based on size-based guess of data location; ultimately the errors were all ValueErrors with different ways to say "data that is not face_centered is not yet supported".Adds a comment inside the integrate() method suggesting that it should support integration of face_centered data regardless of the n_face dimension position. In the meantime, the method continues to only support integration where the n_face dimension is the last dimension. (Possibly related: #1461.)
Still draft PR because still need to add regression tests, as discussed in issue 1616.
PR Checklist
General
Testing