-
Notifications
You must be signed in to change notification settings - Fork 1
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
Readthedocs/API #111
Readthedocs/API #111
Conversation
render logging example
…d-bias' into 105-readthedocsapi
fix again..
…d-bias' into 105-readthedocsapi
…d-bias' into 105-readthedocsapi
- enable null address_overrides - use demo_config for load_config default
Publish mkdocs on release (copied from wsimod)
format equations properly
format list
swmmanywhere/geospatial_utilities.py
Outdated
Use a lower `subcatchment_derivation.subbasin_streamorder` and | ||
probably check your DEM.""") | ||
streamorder_ = streamorder | ||
while np.unique(subbasins.reshape(-1)).shape[0] == 1: |
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.
You don't need to use reshape
, by default (with axis=None
), unique
returns the unique elements as a 1D array, regardless of the array shape.
It's fine at this stage since for the paper, we eventually have to have notebooks for reproducing the results.
I am always in favor of setting default values for parameters with secondary effects on the model output.
Have you tested this automatic approach that was in the notebook that I shared? idxs, _ = flw.snap(xy=(x, y))
subbasins = flw.basins(idxs=np.unique(idxs)) where |
@cheginit Hmm it does look like it would handle anything. If I understand it's returning basins that contain the most points, so that all points are contained. If I understood it properly it will tend towards the largest possible basins, for me then I think it makes sense as an alternative fallback instead of the |
@barneydobson It doesn't necessarily favor larger basins. The snap tool tries to find the immediate downstream. So, if a collection of points are located upstream of a large river segment, they get assigned the same subbasin. So, it depends on the river network. If this approach works for the test cases that you have right now, then my suggestion is to use it as the default option and keep the stream order for cases where it fails. |
@cheginit OK converted to your proposed method above - maybe I made it more cumbersome than necessary but it seems to pass the tests at least |
It appears that you implemented it the opposite way, i.e., stream order is the default and the snap when it fails? I meant something like this: By default the min stream order arg is |
@cheginit Ahh I misread - yes this is a much better suggestion, allowing customisation if desired and using the default otherwise |
@@ -663,13 +671,24 @@ def derive_subbasins_streamorder(fid: Path, | |||
check_ftype = False, | |||
transform = grid.affine, | |||
) |
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.
@cheginit flipped them around 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.
Yeah, this is much better!
fix again
remove coverage link for now
try new relative link for images
Description
This PR is not supposed to be the comprehensive complete documentation - just a starting point to which new things can be added.
Addedsee belowquickstart.py
(I know it needs some love - it is more to have a starting point)pip install -r doc-requirements.txt
andmkdocs serve
(the initial one may take some time asquickstart
takes a few mins)I know the way I've done API keys in the- addressed in API keys via env variables #94quickstart
is dumb- no longer relevant for this - though will possibly have to return to it in other notebooks.tqdm
looks rough in themknotebooks
(similar to in WSIMOD ) - I had a go but I've got no clue how to fix it short of turning off verbosity, but I think the verbosity is useful so people can see the logs of what is going on.I could addquickstart
to tests... but it does involve data downloads, which as we've established is not ideal in a test. I could provide the download data, but then that isn't the best demonstration since the downloads won't run... not sure on this one.coverage.md
issue in thegaurav-nelson/github-action-markdown-link-check@v1
action - the file is generated after that CI action is run as part of the testing (I think... I admit I don't super follow every step of the CI)real
data providedUpdate 2024-06-21
OK sorry this has added a bit more than anticipated, but hopefully you'll find it to be an improvement, set out below.
config
as @cheginit suggested (quickstart.md
). Hopefully this is a bit more understandable.config
(specifically,graphfcn_list
,metric_list
,run_settings
andprecipitation
). Thus, I use the 'default' values for these if they are not provided. By doing this, it really enables a super minimal but validconfig
file for a user to get started with.streamorder
calculation insidederive_subbasins_streamorder
. I am still in agreement with you that this is not ideal, but 1) it does flag a warning message, and 2) we are agreed that the delineation will one day need further improvement (ideally when we have access to a few more high quality urban drainage network data) - at which point this automaticstreamorder
selection can be removed.Fixes #105 #210