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

Create _streamflow_flow_indices.py #1832

Merged
merged 25 commits into from
Oct 8, 2024
Merged

Conversation

faimahsho
Copy link
Contributor

@faimahsho faimahsho commented Jul 8, 2024

streamflow_flow_indice is a submodule in the xclim indices module to calculate streamflow signatures, representing individual watershed characteristics of large river/lake basins.

Pull Request Checklist:

  • This PR addresses an already opened issue (for bug fixes / features)
    • This PR fixes #xyz
  • Tests for the changes have been added (for bug fixes / features)
    • (If applicable) Documentation has been added / updated (for bug fixes / features)
  • CHANGELOG.rst has been updated (with summary of main changes)
    • Link to issue (:issue:number) and pull request (:pull:number) has been added

What kind of change does this PR introduce?

  • ...This PR introduces three hydrological signatures in xclim indices module. The functions included are to calculate the high and low flow variables of a data series of watersheds and generate a characteristic value of the catchment from the calculated hydrological signatures.

Does this PR introduce a breaking change?

This can develop unique watershed attributes.

Other information:

streamflow_flow_indice is a submodule in the xclim indices module to calculate streamflow signatures, representing individual watershed characteristics of large river/lake basins.
@github-actions github-actions bot added docs Improvements to documenation indicators Climate indices and indicators labels Jul 8, 2024
Copy link

github-actions bot commented Jul 8, 2024

Welcome, new contributor!

It appears that this is your first Pull Request. To give credit where it's due, we ask that you add your information to the AUTHORS.rst and .zenodo.json:

  • The relevant author information has been added to AUTHORS.rst and .zenodo.json

Please make sure you've read our contributing guide. We look forward to reviewing your Pull Request shortly ✨

@tlogan2000 tlogan2000 requested a review from huard July 9, 2024 14:23
Copy link

github-actions bot commented Jul 9, 2024

Warning
This Pull Request is coming from a fork and must be manually tagged approved in order to perform additional testing.

Copy link
Collaborator

@huard huard left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the flow_index is not in the literature, I suggest to remove it from this PR and keep it in your project scripts.

Once this PR is merged in, I think it would be interesting to look at additional indices that requires other variables like precipitation, as I think it would provide better physical understanding of processes.

The next step will be to write a test for each index to make sure it behaves as expected. You'll see plenty of examples in the test directory.

xclim/indices/_streamflow_flow_indices.py Outdated Show resolved Hide resolved
xclim/indices/_streamflow_flow_indices.py Outdated Show resolved Hide resolved
xclim/indices/_streamflow_flow_indices.py Outdated Show resolved Hide resolved
xclim/indices/_streamflow_flow_indices.py Outdated Show resolved Hide resolved
xclim/indices/_streamflow_flow_indices.py Outdated Show resolved Hide resolved
xclim/indices/_streamflow_flow_indices.py Outdated Show resolved Hide resolved
xclim/indices/_streamflow_flow_indices.py Outdated Show resolved Hide resolved
xclim/indices/_streamflow_flow_indices.py Outdated Show resolved Hide resolved
xclim/indices/_streamflow_flow_indices.py Outdated Show resolved Hide resolved
xclim/indices/_streamflow_flow_indices.py Outdated Show resolved Hide resolved
.DS_Store Outdated Show resolved Hide resolved
xclim/indices/_streamflow_flow_indices.py Outdated Show resolved Hide resolved
xclim/indices/_streamflow_flow_indices.py Outdated Show resolved Hide resolved
@faimahsho faimahsho force-pushed the Watershed-indices branch from 1a48fe2 to 70e0174 Compare July 16, 2024 16:50
docs/references.bib Outdated Show resolved Hide resolved
@faimahsho faimahsho force-pushed the Watershed-indices branch 2 times, most recently from 948fa30 to 0507d4c Compare July 16, 2024 21:01
@faimahsho faimahsho force-pushed the Watershed-indices branch from 8641c3b to bb69dd4 Compare July 16, 2024 22:23
Copy link
Collaborator

@huard huard left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Please review the changes I just pushed, and add tests for the "indicators" I created.

Note that I added an indexer argument, which lets you pick a season or specific months. Let me know if you believe this is useful or not.

I think the next step would be to have Louise review the finalized PR.

xclim/data/fr.json Outdated Show resolved Hide resolved
xclim/indices/_hydrology.py Outdated Show resolved Hide resolved
xclim/indices/_hydrology.py Outdated Show resolved Hide resolved
xclim/indices/_hydrology.py Outdated Show resolved Hide resolved
xclim/indices/_streamflow_flow_indices.py Outdated Show resolved Hide resolved
@faimahsho faimahsho force-pushed the Watershed-indices branch 3 times, most recently from d8ae74d to 7beffe9 Compare July 18, 2024 15:36
…ean over whole period. This part of the analysis can be done on the user-side. Added support for **indexer, allowing more freedom when selecting the period
@faimahsho faimahsho force-pushed the Watershed-indices branch from 7beffe9 to 4e086d6 Compare July 18, 2024 20:57
xclim/indices/_hydrology.py Outdated Show resolved Hide resolved
xclim/indices/_hydrology.py Show resolved Hide resolved
@huard huard requested a review from aulemahal September 17, 2024 21:33
Copy link
Collaborator

@aulemahal aulemahal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me.

Here are a few "incoherences" I see, but that may well be expected.

  • The high flow is computed with reference fo the median while the low flow is done with reference to the mean. Normal ?
  • The high and low flows have their reference computed over the whole period (year) and then the number of days is counted over the temporal subset. The flox index computes both the percentile and the median only over the subset.

xclim/indices/_hydrology.py Outdated Show resolved Hide resolved
xclim/indices/_hydrology.py Outdated Show resolved Hide resolved
xclim/indices/_hydrology.py Outdated Show resolved Hide resolved
xclim/indices/_hydrology.py Outdated Show resolved Hide resolved
@Zeitsperre Zeitsperre added the approved Approved for additional tests label Oct 2, 2024
@coveralls
Copy link

coveralls commented Oct 7, 2024

Coverage Status

coverage: 89.469% (+0.02%) from 89.445%
when pulling 6118234 on faimahsho:Watershed-indices
into dd37e5a on Ouranosinc:main.

@Zeitsperre Zeitsperre added this to the v0.53.0 milestone Oct 8, 2024
@huard huard merged commit cfdc49d into Ouranosinc:main Oct 8, 2024
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Approved for additional tests docs Improvements to documenation indicators Climate indices and indicators
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants