Add a snapshot test for the auxiliary topography #39
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.
@wschwanghart: Adding the snapshot test is not such a big change, but it did require moving the private functions
createAuxiliaryTopoandgetPreSillPixels. Let me know if you would prefer to keep those functions private or put them somewhere else.--
This adds a snapshot test that calls
createAuxiliaryTopoon the test DEM and either saves the resulting auxiliary topography or compares it to the saved snapshot. The TopoToolbox/snapshot_data repository will need to be updated manually if this PR is merged.createAuxiliaryTopowas previously a private function under@FLOWobj/, which means it was not accessible from outside ofFLOWobjmethods and could not be tested on its own. It is useful to have the snapshot of the auxiliary topography, because it can help distinguish problems in flow routing over the auxiliary topography from problems in generating the auxiliary topography itself, which I think are important to rule out for TopoToolbox/libtopotoolbox#122.This PR moves
createAuxiliaryTopo.mandgetPreSillPixels.mtotoolbox/internalso they can be accessed from the test. They could also be conceivably be methods on@GRIDobj, but if we do not want users to rely on them, we should probably keep them ininternal.It might also make sense to move
getPreSillPixelsintoidentifyflats. libtopotoolbox returns the presills along with the flats and sills in itsidentifyflats. However, this might complicate how sills are identified for internal drainage basins, so I have left that for future work, especially once we are able to label closed basins in libtopotoolbox'sidentifyflats(TopoToolbox/libtopotoolbox#141).