forked from TopoToolbox/pytopotoolbox
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make fillsinks memory-order agnostic (TopoToolbox#125)
This change represents one way that we might make our interface with libtopotoolbox agnostic to the memory order of our underlying numpy arrays. I have added a property dims to GridObject, which reverses the order of the dimensions if the array is in row-major layout. GridObject.shape still returns (rows, columns). If we pass self.dims instead of self.shape to the fillsinks wrapper, we will now get the same, correct, answer if the GridObject.z array is column- or row-major. There is also a test that confirms this behavior.
- Loading branch information
Showing
2 changed files
with
51 additions
and
3 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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