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

The phase parameter of precip_accumulation is not included in the indicator docstring but discussed in the docstring #1763

Open
1 of 2 tasks
huard opened this issue May 27, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@huard
Copy link
Collaborator

huard commented May 27, 2024

Setup Information

  • Xclim version: 0.49
  • Python version: 3.12.2

Description

Here is the docstring from indicator precip_accumulation. Note that the phase parameter is referenced, and its docstring exist for the corresponding indice, but it's not included in the indicator.

Signature:      
xclim.indicators.atmos.precip_accumulation(
    pr: Union[xarray.core.dataarray.DataArray, str] = 'pr',
    *,
    thresh: 'Quantified' = '0 degC',
    freq: 'str' = 'YS',
    ds: xarray.core.dataset.Dataset = None,
    **indexer,
) -> xarray.core.dataarray.DataArray
Call signature:  xclim.indicators.atmos.precip_accumulation(*args, **kwds)
Type:            PRCPTOT
String form:     <xclim.indicators.atmos._precip.PRCPTOT object at 0x7f89e5211130>
File:            ~/.conda/envs/ing12/lib/python3.12/site-packages/xclim/indicators/atmos/_precip.py
Docstring:      
Total accumulated precipitation (solid and liquid) (realm: atmos)

Total accumulated precipitation. If the average daily temperature is given, the phase parameter can be used to restrict the calculation to precipitation of only one phase (liquid or solid). Precipitation is considered solid if the average daily temperature is below 0°C (and vice versa).

This indicator will check for missing values according to the method "from_context".
Based on indice :py:func:`~xclim.indices._multivariate.precip_accumulation`.
With injected parameters: tas=None, phase=None.
Keywords : precipitation.

Parameters
----------
pr : str or DataArray
    Mean daily precipitation flux.
    Default : `ds.pr`. [Required units : [precipitation]]
thresh : quantity (string or DataArray, with units)
    Threshold of `tas` over which the precipication is assumed to be liquid rain.
    Default : 0 degC. [Required units : [temperature]]
freq : offset alias (string)
    Resampling frequency. See https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases for available options.
    Default : YS. 
ds : Dataset, optional
    A dataset with the variables given by name.
    Default : None. 
indexer 
    Indexing parameters to compute the indicator on a temporal subset of the data. It accepts the same arguments as :py:func:`xclim.indices.generic.select_time`.
    Required. 

Steps To Reproduce

No response

Additional context

No response

Contribution

  • I would be willing/able to open a Pull Request to address this bug.

Code of Conduct

  • I agree to follow this project's Code of Conduct
@huard huard added the bug Something isn't working label May 27, 2024
@huard
Copy link
Collaborator Author

huard commented May 27, 2024

I think that what is confusing is that the phase is correctly set to None to return both liquid and solid precip, but the thresh parameter is still there, although it's useless when phase is None.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant