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

More clearly indicate the requirements for calculating indicators and indices #1438

Closed
Tracked by #1395
Zeitsperre opened this issue Jul 26, 2023 · 4 comments
Closed
Tracked by #1395
Assignees
Labels
docs Improvements to documenation
Milestone

Comments

@Zeitsperre
Copy link
Collaborator

Zeitsperre commented Jul 26, 2023

Problem

The primary method for determining what variables are needed to calculate a given index or indicator is to look at the call signature (sometimes very busy) and/or the Parameters entries. This can be annoying for users as they might want to calculate something and gloss over a variable that might be required.

Potential Solution

Each index or indicator could list before the Parameters section a block that lists these requirements. e.g.:

Requires
--------
# <standard_name> (variable)
temperature (tas), precipitation_flux (pr), geopotential (z)
@Zeitsperre Zeitsperre changed the title More clearly indicate the requirements for calculating indicators and indices, e.g. requires: tas, pr, snd (snow depth) to be calculated in input dataset (https://xclim.readthedocs.io/en/latest/api.html#xclim.indicators.atmos.drought_code, https://xclim.readthedocs.io/en/latest/indices.html#xclim.indices.fire._cffwis.drought_code) More clearly indicate the requirements for calculating indicators and indices, e.g. `requires: tas, pr, snd Jul 26, 2023
@Zeitsperre Zeitsperre changed the title More clearly indicate the requirements for calculating indicators and indices, e.g. `requires: tas, pr, snd More clearly indicate the requirements for calculating indicators and indices Jul 26, 2023
@aulemahal
Copy link
Collaborator

I don't get the "and indices" part of the issue ? Indices are documented through normal function docstrings, which explicitly lists the parameters ?

For indicators, we could simply add the required and optional variables to the short version of the indicator doc in the "Climate Indicators" page.

@Zeitsperre
Copy link
Collaborator Author

@SarahG-579462

Feel free to edit this issue and/or elaborate on how you'd like to see things change.

@Zeitsperre Zeitsperre added the docs Improvements to documenation label Aug 1, 2023
@huard
Copy link
Collaborator

huard commented Sep 8, 2023

I think we should stick with the numpy doc convention. https://numpydoc.readthedocs.io/en/latest/format.html

Question: does this relate to the HTML docs or the help you get within a Python shell ? If it's the HTML, we could possibly tweak the CSS to highlight some parameters.

@Zeitsperre Zeitsperre added this to the v0.46.0 milestone Oct 10, 2023
@Zeitsperre
Copy link
Collaborator Author

Fixed with #1454

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Improvements to documenation
Projects
None yet
Development

No branches or pull requests

3 participants