Skip to content
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

pysheds to whitebox #266

Merged
merged 25 commits into from
Sep 2, 2024
Merged

pysheds to whitebox #266

merged 25 commits into from
Sep 2, 2024

Conversation

barneydobson
Copy link
Collaborator

@barneydobson barneydobson commented Aug 23, 2024

Description

Need because pysheds is GNU.

  • Remove pysheds
  • Add whitebox
  • Update tests
  • Fix tempfile error according to suggestion in whitebox occasional error #268 (note to self - on the cluster, current setup seems to weirdly work when whitebox is verbose but not when its not... no clue what that's about - for now probably just make it always verbose).

Fixes #263
Fixes #212
Fixes #137
Fixes #141
Fixes #138
Fixes #268

whitebox seems super powerful and the most sensible way to accommodate many changes to catchment delineation. In the long run it seems that pyflwdir could be removed and everything done on whitebox - one thing at a time though. (Adding an issue to discuss whitebox #267 )

@barneydobson barneydobson linked an issue Aug 23, 2024 that may be closed by this pull request
@barneydobson barneydobson changed the title 263 looks like pysheds is gnu pysheds to whitebox Aug 23, 2024
tests/test_geospatial_utilities.py Outdated Show resolved Hide resolved
swmmanywhere/geospatial_utilities.py Outdated Show resolved Hide resolved
swmmanywhere/geospatial_utilities.py Outdated Show resolved Hide resolved
swmmanywhere/geospatial_utilities.py Outdated Show resolved Hide resolved
swmmanywhere/geospatial_utilities.py Outdated Show resolved Hide resolved
swmmanywhere/geospatial_utilities.py Outdated Show resolved Hide resolved
swmmanywhere/geospatial_utilities.py Outdated Show resolved Hide resolved
tests/test_geospatial_utilities.py Outdated Show resolved Hide resolved
@cheginit
Copy link
Collaborator

In whitebox documentaion this is what I found:

In comparison with the BreachDepressions tool, this breaching method often provides a more satisfactory, lower impact, breaching solution and is often more efficient. It is therefore advisable that users try the BreachDepressionsLeastCost tool to remove depressions from their DEMs first.

@barneydobson
Copy link
Collaborator Author

In whitebox documentaion this is what I found:

In comparison with the BreachDepressions tool, this breaching method often provides a more satisfactory, lower impact, breaching solution and is often more efficient. It is therefore advisable that users try the BreachDepressionsLeastCost tool to remove depressions from their DEMs first.

@cheginit I will stick with BreachDepressions for now because my new test values have been adjusted for it and I've verified that the subbasins created are sensible. We can investigate alternatives as part of #267 .

Did you want to rereview my calling of the wrapper?

I know it seems extravagant to have the WBT directory inside the temporary folder and redownload it each time - but it seems that all manner of strangeness can happen on the cluster and this just feels the most robust way to deal with it.

@barneydobson barneydobson requested a review from cheginit August 29, 2024 12:13
swmmanywhere/whitebox_utils.py Outdated Show resolved Hide resolved
swmmanywhere/geospatial_utilities.py Outdated Show resolved Hide resolved
@cheginit
Copy link
Collaborator

I packaged the wrapper that I wrote for whitebox as a python library called pywbt that doesn't have any dep, even requests. While testing it, I realized that the least cost version of the breaching depressions algorithm is not stable and has a couple of open issues. So for now just stick to using BreachDepressions but also pass --fillpits option.

@barneydobson
Copy link
Collaborator Author

@cheginit amazing thanks - all now good

@barneydobson barneydobson merged commit 5b74ed5 into main Sep 2, 2024
8 checks passed
@barneydobson barneydobson deleted the 263-looks-like-pysheds-is-gnu branch September 2, 2024 09:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants