diff --git a/.flake8 b/.flake8 index 6aa94ce03..db12200fe 100644 --- a/.flake8 +++ b/.flake8 @@ -10,6 +10,8 @@ ignore = D, E, F, + RST210, + RST213, W503 per-file-ignores = xclim/core/locales.py:RST399 diff --git a/xclim/analog.py b/xclim/analog.py index 35d7cc854..239856463 100644 --- a/xclim/analog.py +++ b/xclim/analog.py @@ -46,7 +46,7 @@ def spatial_analogs( The dimension over which the *distributions* are constructed. This can be a multi-index dimension. method : {'seuclidean', 'nearest_neighbor', 'zech_aslan', 'kolmogorov_smirnov', 'friedman_rafsky', 'kldiv'} Which method to use when computing the dissimilarity statistic. - \*\*kwargs : dict + **kwargs : dict Any other parameter passed directly to the dissimilarity method. Returns diff --git a/xclim/core/bootstrapping.py b/xclim/core/bootstrapping.py index 00a2a946a..b7dab3353 100644 --- a/xclim/core/bootstrapping.py +++ b/xclim/core/bootstrapping.py @@ -95,7 +95,7 @@ def bootstrap_func(compute_index_func: Callable, **kwargs) -> xarray.DataArray: ---------- compute_index_func : Callable Index function. - \*\*kwargs : dict + **kwargs : dict Arguments to `func`. Returns diff --git a/xclim/core/formatting.py b/xclim/core/formatting.py index 428094559..e76e6502c 100644 --- a/xclim/core/formatting.py +++ b/xclim/core/formatting.py @@ -86,9 +86,9 @@ def format(self, format_string: str, /, *args: Any, **kwargs: dict) -> str: ---------- format_string : str The string to format. - \*args : Any + *args : Any Arguments to format. - \*\*kwargs : dict + **kwargs : dict Keyword arguments to format. Returns @@ -352,7 +352,7 @@ def merge_attributes( ---------- attribute : str The attribute to merge. - \*inputs_list : xr.DataArray or xr.Dataset + *inputs_list : xr.DataArray or xr.Dataset The datasets or variables that were used to produce the new object. Inputs given that way will be prefixed by their `name` attribute if available. new_line : str @@ -361,7 +361,7 @@ def merge_attributes( missing_str : str A string that is printed if an input doesn't have the attribute. Defaults to None, in which case the input is simply skipped. - \*\*inputs_kws : xr.DataArray or xr.Dataset + **inputs_kws : xr.DataArray or xr.Dataset Mapping from names to the datasets or variables that were used to produce the new object. Inputs given that way will be prefixes by the passed name. @@ -405,12 +405,12 @@ def update_history( ---------- hist_str : str The string describing what has been done on the data. - \*inputs_list : xr.DataArray or xr.Dataset + *inputs_list : xr.DataArray or xr.Dataset The datasets or variables that were used to produce the new object. Inputs given that way will be prefixed by their "name" attribute if available. new_name : str, optional The name of the newly created variable or dataset to prefix hist_msg. - \*\*inputs_kws : xr.DataArray or xr.Dataset + **inputs_kws : xr.DataArray or xr.Dataset Mapping from names to the datasets or variables that were used to produce the new object. Inputs given that way will be prefixes by the passed name. @@ -511,9 +511,9 @@ def gen_call_string(funcname: str, *args, **kwargs) -> str: ---------- funcname : str Name of the function. - \*args : Any + *args : Any Arguments given to the function. - \*\*kwargs : dict + **kwargs : dict Keyword arguments given to the function. Returns diff --git a/xclim/core/indicator.py b/xclim/core/indicator.py index 4259ba397..0ce7e8e2e 100644 --- a/xclim/core/indicator.py +++ b/xclim/core/indicator.py @@ -547,7 +547,7 @@ def _parse_indice(compute, passed_parameters): # noqa: F841 # Remove the \\* symbols from the parameter names _sanitized_params_dict = {} for param in params_dict.keys(): - _sanitized_params_dict[param.replace("\\*", "")] = params_dict[param] + _sanitized_params_dict[param.replace("*", "")] = params_dict[param] params_dict = _sanitized_params_dict # Check that the `Parameters` section of the docstring does not include parameters @@ -1353,7 +1353,7 @@ def cfcheck(self, **das) -> None: Parameters ---------- - \*\*das : dict + **das : dict A dictionary of DataArrays to check. """ for varname, vardata in das.items(): @@ -1377,7 +1377,7 @@ def datacheck(self, **das) -> None: Parameters ---------- - \*\*das : dict + **das : dict A dictionary of DataArrays to check. Raises diff --git a/xclim/core/locales.py b/xclim/core/locales.py index fd6c15c64..ff086c407 100644 --- a/xclim/core/locales.py +++ b/xclim/core/locales.py @@ -157,7 +157,7 @@ def get_local_attrs( Indicator's class name, usually the same as in `xc.core.indicator.registry`. If multiple names are passed, the attrs from each indicator are merged, with the highest priority set to the first name. - \*locales : str or tuple of str + *locales : str or tuple of str IETF language tag or a tuple of the language tag and a translation dict, or a tuple of the language tag and a path to a json file defining translation of attributes. names : sequence of str, optional diff --git a/xclim/core/missing.py b/xclim/core/missing.py index 65ae8536f..ed644b3ce 100644 --- a/xclim/core/missing.py +++ b/xclim/core/missing.py @@ -70,7 +70,7 @@ class MissingBase: Resampling frequency. src_timestep : str, Optional The expected input frequency. If not given, it will be inferred from the input array. - \*\*indexer : Indexer + **indexer : Indexer Time attribute and values over which to subset the array. For example, use season='DJF' to select winter values, month=1 to select January, or month=[6,7,8] to select summer months. If not indexer is given, all values are considered. @@ -153,7 +153,7 @@ def is_null( Input data. freq : str Resampling frequency, from the periods defined in :ref:`timeseries.resampling`. - \*\*indexer : {dim: indexer}, optional + **indexer : {dim: indexer}, optional The time attribute and values over which to subset the array. For example, use season='DJF' to select winter values, month=1 to select January, or month=[6,7,8] to select summer months. @@ -191,7 +191,7 @@ def prepare( Resampling frequency, from the periods defined in :ref:`timeseries.resampling`. src_timestep : str Expected input frequency, from the periods defined in :ref:`timeseries.resampling`. - \*\*indexer : {dim: indexer}, optional + **indexer : {dim: indexer}, optional Time attribute and values over which to subset the array. For example, use season='DJF' to select winter values, month=1 to select January, or month=[6,7,8] to select summer months. If not indexer is given, all values are considered. @@ -279,7 +279,7 @@ def validate(**kwargs) -> bool: Parameters ---------- - \*\*kwargs : dict + **kwargs : dict Options arguments. Returns @@ -312,7 +312,7 @@ class MissingAny(MissingBase): Resampling frequency. src_timestep : {"D", "h", "M"} Expected input frequency. - \*\*indexer : {dim: indexer, }, optional + **indexer : {dim: indexer, }, optional Time attribute and values over which to subset the array. For example, use season='DJF' to select winter values, month=1 to select January, or month=[6,7,8] to select summer months. If not indexer is given, all values are considered. @@ -337,7 +337,7 @@ def is_missing( Boolean array indicating which values are null. count : xr.DataArray Array of expected number of valid values. - \*\*kwargs : dict + **kwargs : dict Additional arguments. Returns @@ -375,7 +375,7 @@ class MissingWMO(MissingAny): Number of consecutive missing values per month that should not be exceeded. src_timestep : {"D"} Expected input frequency. Only daily values are supported. - \*\*indexer : {dim: indexer, }, optional + **indexer : {dim: indexer, }, optional Time attribute and values over which to subset the array. For example, use season='DJF' to select winter Time attribute and values over which to subset the array. For example, use season='DJF' to select winter values, month=1 to select January, or month=[6,7,8] to select summer months. @@ -480,7 +480,7 @@ class MissingPct(MissingBase): Fraction of missing values that are tolerated [0,1]. src_timestep : {"D", "h"} Expected input frequency. - \*\*indexer : {dim: indexer, }, optional + **indexer : {dim: indexer, }, optional Time attribute and values over which to subset the array. For example, use season='DJF' to select winter values, month=1 to select January, or month=[6,7,8] to select summer months. If not indexer is given, all values are considered. diff --git a/xclim/core/options.py b/xclim/core/options.py index 4993b0d75..20547b9b7 100644 --- a/xclim/core/options.py +++ b/xclim/core/options.py @@ -133,9 +133,9 @@ def run_check(func, option, *args, **kwargs): Function to run. option : str Option to use. - \*args : tuple + *args : tuple Positional arguments to pass to the function. - \*\*kwargs : dict + **kwargs : dict Keyword arguments to pass to the function. Raises diff --git a/xclim/core/units.py b/xclim/core/units.py index fa7bc15fb..0e3237d05 100644 --- a/xclim/core/units.py +++ b/xclim/core/units.py @@ -1295,7 +1295,7 @@ def declare_relative_units(**units_by_name) -> Callable: Parameters ---------- - \*\*units_by_name : dict + **units_by_name : dict Mapping from the input parameter names to dimensions relative to other parameters. The dimensions can be a single parameter name as `` or more complex expressions, such as ` * [time]`. @@ -1407,7 +1407,7 @@ def declare_units(**units_by_name) -> Callable: Parameters ---------- - \*\*units_by_name : dict + **units_by_name : dict Mapping from the input parameter names to their units or dimensionality ("[...]"). If this decorates a function previously decorated with :py:func:`declare_relative_units`, the relative unit declarations are made absolute with the information passed here. diff --git a/xclim/core/utils.py b/xclim/core/utils.py index 383a4f8a7..612f6a69b 100644 --- a/xclim/core/utils.py +++ b/xclim/core/utils.py @@ -130,7 +130,7 @@ def ensure_chunk_size(da: xr.DataArray, **minchunks: int) -> xr.DataArray: ---------- da : xr.DataArray The input DataArray, with or without the dask backend. Does nothing when passed a non-dask array. - \*\*minchunks : dict[str, int] + **minchunks : dict[str, int] A kwarg mapping from dimension name to minimum chunk size. Pass -1 to force a single chunk along that dimension. @@ -178,7 +178,7 @@ def uses_dask(*das: xr.DataArray | xr.Dataset) -> bool: Parameters ---------- - \*das : xr.DataArray or xr.Dataset + *das : xr.DataArray or xr.Dataset DataArrays or Datasets to check. Returns diff --git a/xclim/ensembles/_base.py b/xclim/ensembles/_base.py index 25990657b..823d10b0b 100644 --- a/xclim/ensembles/_base.py +++ b/xclim/ensembles/_base.py @@ -72,7 +72,7 @@ def create_ensemble( cal_kwargs : dict, optional Additional arguments to pass to py:func:`xclim.core.calendar.convert_calendar`. For conversions involving '360_day', the align_on='date' option is used by default. - \*\*xr_kwargs : dict + **xr_kwargs : dict Any keyword arguments to be given to `xr.open_dataset` when opening the files (or to `xr.open_mfdataset` if `multifile` is True). Returns @@ -410,7 +410,7 @@ def _ens_align_datasets( the align_on='date' option is used. See :py:func:`xclim.core.calendar.convert_calendar`. 'default' is the standard calendar using np.datetime64 objects. - \*\*xr_kwargs + **xr_kwargs Any keyword arguments to be given to xarray when opening the files. Returns diff --git a/xclim/ensembles/_filters.py b/xclim/ensembles/_filters.py index 4f2d0c475..8a72db7a4 100644 --- a/xclim/ensembles/_filters.py +++ b/xclim/ensembles/_filters.py @@ -16,7 +16,7 @@ def _concat_hist(da: xr.DataArray, **hist) -> xr.DataArray: ---------- da : xr.DataArray Input data where the historical scenario is stored alongside other, future, scenarios. - \*\*hist : dict + **hist : dict Mapping of the scenario dimension name to the historical scenario coordinate, e.g. `scenario="historical"`. Returns diff --git a/xclim/ensembles/_reduce.py b/xclim/ensembles/_reduce.py index ebe27e6dd..e73d431f9 100644 --- a/xclim/ensembles/_reduce.py +++ b/xclim/ensembles/_reduce.py @@ -150,7 +150,7 @@ def kkz_reduce_ensemble( standardize : bool Whether to standardize the input before running the selection or not. Standardization consists in translation as to have a zero mean and scaling as to have a unit standard deviation. - \*\*cdist_kwargs : dict + **cdist_kwargs : dict All extra arguments are passed as-is to `scipy.spatial.distance.cdist`, see its docs for more information. Returns diff --git a/xclim/ensembles/_robustness.py b/xclim/ensembles/_robustness.py index 677e1e5fe..309e3d1be 100644 --- a/xclim/ensembles/_robustness.py +++ b/xclim/ensembles/_robustness.py @@ -89,7 +89,7 @@ def robustness_fractions( # noqa: C901 Name of the statistical test used to determine if there was significant change. See notes. weights : xr.DataArray Weights to apply along the 'realization' dimension. This array cannot contain missing values. - \*\*kwargs : dict + **kwargs : dict Other arguments specific to the statistical test. See notes. Returns diff --git a/xclim/indicators/atmos/_conversion.py b/xclim/indicators/atmos/_conversion.py index a8b86da33..cb0259d13 100644 --- a/xclim/indicators/atmos/_conversion.py +++ b/xclim/indicators/atmos/_conversion.py @@ -42,7 +42,7 @@ def cfcheck(self, **das) -> None: Parameters ---------- - \*\*das : Mapping[str, xarray.DataArray] + **das : Mapping[str, xarray.DataArray] The input data arrays. """ for varname, vardata in das.items(): diff --git a/xclim/indices/_agro.py b/xclim/indices/_agro.py index 1b82d9340..fcff347a0 100644 --- a/xclim/indices/_agro.py +++ b/xclim/indices/_agro.py @@ -1151,7 +1151,7 @@ def standardized_precipitation_index( Fit parameters. The `params` can be computed using ``xclim.indices.stats.standardized_index_fit_params`` in advance. The output can be given here as input, and it overrides other options. - \*\*indexer : {dim: indexer}, optional + **indexer : {dim: indexer}, optional 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`. @@ -1286,7 +1286,7 @@ def standardized_precipitation_evapotranspiration_index( Fit parameters. The `params` can be computed using ``xclim.indices.stats.standardized_index_fit_params`` in advance. The output can be given here as input, and it overrides other options. - \*\*indexer : {dim: indexer}, optional + **indexer : {dim: indexer}, optional 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`. @@ -1599,7 +1599,7 @@ def chill_portions( Hourly temperature. freq : str Resampling frequency. - \*\*indexer : {dim: indexer}, optional + **indexer : {dim: indexer}, optional 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`. diff --git a/xclim/indices/_conversion.py b/xclim/indices/_conversion.py index 032e66e4c..39d6c8f63 100644 --- a/xclim/indices/_conversion.py +++ b/xclim/indices/_conversion.py @@ -2106,7 +2106,7 @@ def wind_profile( Reference height. method : {"power_law"} Method to use. Currently only "power_law" is implemented. - \*\*kwds : dict + **kwds : dict Additional keyword arguments to pass to the method.For power_law, this is alpha, which takes a default value of 1/7, but is highly variable based on topography, surface cover and atmospheric stability. diff --git a/xclim/indices/_simple.py b/xclim/indices/_simple.py index c13ab9e7e..f9697e9cd 100644 --- a/xclim/indices/_simple.py +++ b/xclim/indices/_simple.py @@ -336,7 +336,7 @@ def frost_days( Freezing temperature. freq : str Resampling frequency. - \*\*indexer : {dim: indexer}, optional + **indexer : {dim: indexer}, optional Indexing parameters to compute the frost days on a temporal subset of the data. It accepts the same arguments as :py:func:`xclim.indices.generic.select_time`. diff --git a/xclim/indices/_threshold.py b/xclim/indices/_threshold.py index 25bca2407..6495056ac 100644 --- a/xclim/indices/_threshold.py +++ b/xclim/indices/_threshold.py @@ -3193,7 +3193,7 @@ def dry_spell_frequency( threshold. "max" checks that the maximal daily precipitation amount within the window is less than the threshold. This is the same as verifying that each individual day is below the threshold. - \*\*indexer : {dim: indexer}, optional + **indexer : {dim: indexer}, optional 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`. Indexing is done after finding the dry days, but before finding the spells. @@ -3261,7 +3261,7 @@ def dry_spell_total_length( Resampling frequency. resample_before_rl : bool Determines if the resampling should take place before or after the run length encoding (or a similar algorithm) is applied to runs. - \*\*indexer : {dim: indexer}, optional + **indexer : {dim: indexer}, optional 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`. Indexing is done after finding the dry days, but before finding the spells. @@ -3328,7 +3328,7 @@ def dry_spell_max_length( resample_before_rl : bool Determines if the resampling should take place before or after the run length encoding (or a similar algorithm) is applied to runs. - \*\*indexer : {dim: indexer}, optional + **indexer : {dim: indexer}, optional 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`. Indexing is done after finding the dry days, but before finding the spells. @@ -3398,7 +3398,7 @@ def wet_spell_frequency( threshold. "min" checks that the maximal daily precipitation amount within the window is more than the threshold. This is the same as verifying that each individual day is above the threshold. - \*\*indexer : {dim: indexer}, optional + **indexer : {dim: indexer}, optional 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`. Indexing is done after finding the wet days, but before finding the spells. @@ -3465,7 +3465,7 @@ def wet_spell_total_length( Resampling frequency. resample_before_rl : bool Determines if the resampling should take place before or after the run length encoding (or a similar algorithm) is applied to runs. - \*\*indexer : {dim: indexer}, optional + **indexer : {dim: indexer}, optional 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`. Indexing is done after finding the wet days, but before finding the spells. @@ -3534,7 +3534,7 @@ def wet_spell_max_length( Resampling frequency. resample_before_rl : bool Determines if the resampling should take place before or after the run length encoding (or a similar algorithm) is applied to runs. - \*\*indexer : {dim: indexer}, optional + **indexer : {dim: indexer}, optional 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`. Indexing is done after finding the wet days, but before finding the spells. diff --git a/xclim/indices/fire/_cffwis.py b/xclim/indices/fire/_cffwis.py index 25be1bcda..feffbe97c 100644 --- a/xclim/indices/fire/_cffwis.py +++ b/xclim/indices/fire/_cffwis.py @@ -1354,7 +1354,7 @@ def cffwis_indices( If True (default), gridpoints where the fire season is active on the first timestep go through a start_up phase for that time step. Otherwise, previous codes must be given as a continuing fire season is assumed for those points. - \*\*params : dict + **params : dict Any other keyword parameters as defined in :py:func:`fire_weather_ufunc` and in :py:data:`default_params`. Returns @@ -1465,7 +1465,7 @@ def drought_code( If True (default), grid points where the fire season is active on the first timestep go through a start_up phase for that time step. Otherwise, previous codes must be given as a continuing fire season is assumed for those points. - \*\*params : dict + **params : dict Any other keyword parameters as defined in `xclim.indices.fire.fire_weather_ufunc` and in :py:data:`default_params`. Returns @@ -1560,7 +1560,7 @@ def duff_moisture_code( If True (default), grid points where the fire season is active on the first timestep go through a start_up phase for that time step. Otherwise, previous codes must be given as a continuing fire season is assumed for those points. - \*\*params : dict + **params : dict Any other keyword parameters as defined in `xclim.indices.fire.fire_weather_ufunc` and in :py:data:`default_params`. Returns diff --git a/xclim/indices/generic.py b/xclim/indices/generic.py index c7657a45a..510c6eb45 100644 --- a/xclim/indices/generic.py +++ b/xclim/indices/generic.py @@ -83,7 +83,7 @@ def select_resample_op( Resampling frequency defining the periods as defined in :ref:`timeseries.resampling`. out_units : str, optional Output units to assign. Only necessary if `op` is function not supported by :py:func:`xclim.core.units.to_agg_units`. - \*\*indexer : {dim: indexer, }, optional + **indexer : {dim: indexer, }, optional Time attribute and values over which to subset the array. For example, use season='DJF' to select winter values, month=1 to select January, or month=[6,7,8] to select summer months. If not indexer is given, all values are considered. @@ -144,7 +144,7 @@ def select_rolling_resample_op( Resampling frequency defining the periods as defined in :ref:`timeseries.resampling`. Applied after the rolling window. out_units : str, optional Output units to assign. Only necessary if `op` is function not supported by :py:func:`xclim.core.units.to_agg_units`. - \*\*indexer : {dim: indexer, }, optional + **indexer : {dim: indexer, }, optional Time attribute and values over which to subset the array. For example, use season='DJF' to select winter values, month=1 to select January, or month=[6,7,8] to select summer months. If not indexer is given, all values are considered. @@ -209,7 +209,7 @@ def default_freq(**indexer) -> str: Parameters ---------- - \*\*indexer : {dim: indexer, } + **indexer : {dim: indexer, } The indexer to use to compute the frequency. Returns @@ -618,7 +618,7 @@ def spell_length_statistics( resample_before_rl : bool Determines if the resampling should take place before or after the run length encoding (or a similar algorithm) is applied to runs. - \*\*indexer : {dim: indexer, }, optional + **indexer : {dim: indexer, }, optional 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`. Indexing is done after finding the days part of a spell, but before taking the spell statistics. @@ -725,7 +725,7 @@ def bivariate_spell_length_statistics( resample_before_rl : bool Determines if the resampling should take place before or after the run length encoding (or a similar algorithm) is applied to runs. - \*\*indexer : {dim: indexer, }, optional + **indexer : {dim: indexer, }, optional 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`. Indexing is done after finding the days part of a spell, but before taking the spell statistics. diff --git a/xclim/indices/run_length.py b/xclim/indices/run_length.py index e5cb3e54d..df1646676 100644 --- a/xclim/indices/run_length.py +++ b/xclim/indices/run_length.py @@ -99,13 +99,13 @@ def resample_and_rl( or after the run length algorithms are applied. compute : Callable Run length function to apply. - \*args : Any + *args : Any Positional arguments needed in `compute`. freq : str Resampling frequency. dim : str The dimension along which to find runs. - \*\*kwargs : dict + **kwargs : dict Keyword arguments needed in `compute`. Returns diff --git a/xclim/indices/stats.py b/xclim/indices/stats.py index 51250e3b9..a1709ca6d 100644 --- a/xclim/indices/stats.py +++ b/xclim/indices/stats.py @@ -98,7 +98,7 @@ def fit( The PWM method is usually more robust to outliers. dim : str The dimension upon which to perform the indexing (default: "time"). - \*\*fitkwargs : dict + **fitkwargs : dict Other arguments passed directly to :py:func:`_fitstart` and to the distribution's `fit`. Returns @@ -403,7 +403,7 @@ def frequency_analysis( Fitting method, either maximum likelihood (ML or MLE), method of moments (MOM) or approximate method (APP). Also accepts probability weighted moments (PWM), also called L-Moments, if `dist` is an instance from the lmoments3 library. The PWM method is usually more robust to outliers. - \*\*indexer : {dim: indexer, }, optional + **indexer : {dim: indexer, }, optional Time attribute and values over which to subset the array. For example, use season='DJF' to select winter values, month=1 to select January, or month=[6,7,8] to select summer months. If indexer is not provided, all values are considered. @@ -473,7 +473,7 @@ def _fit_start(x, dist: str, **fitkwargs: Any) -> tuple[tuple, dict]: Name of the univariate distribution, e.g. `beta`, `expon`, `genextreme`, `gamma`, `gumbel_r`, `lognorm`, `norm`. (see :py:mod:scipy.stats). Only `genextreme` and `weibull_exp` distributions are supported. - \*\*fitkwargs + **fitkwargs Kwargs passed to fit. Returns @@ -574,13 +574,13 @@ def _dist_method_1D( # noqa: N802 Parameters ---------- - \*args + *args The arguments for the requested scipy function. dist : str or rv_continuous distribution object The scipy name of the distribution. function : str The name of the function to call. - \*\*kwargs : dict + **kwargs : dict Other parameters to pass to the function call. Returns @@ -615,7 +615,7 @@ def dist_method( The first argument for the requested function if different from `fit_params`. dist : str or rv_continuous distribution object, optional The distribution name or instance. Defaults to the `scipy_dist` attribute or `fit_params`. - \*\*kwargs : dict + **kwargs : dict Other parameters to pass to the function call. Returns @@ -666,7 +666,7 @@ def preprocess_standardized_index( window : int Averaging window length relative to the resampling frequency. For example, if `freq="MS"`, i.e. a monthly resampling, the window is an integer number of months. - \*\*indexer : {dim: indexer, }, optional + **indexer : {dim: indexer, }, optional 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`. @@ -754,7 +754,7 @@ def standardized_index_fit_params( If True, the zeroes of `da` are treated separately when fitting a probability density function. fitkwargs : dict, optional Kwargs passed to ``xclim.indices.stats.fit`` used to impose values of certains parameters (`floc`, `fscale`). - \*\*indexer : {dim: indexer, }, optional + **indexer : {dim: indexer, }, optional 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`. @@ -873,7 +873,7 @@ def standardized_index( Fit parameters. The `params` can be computed using ``xclim.indices.stats.standardized_index_fit_params`` in advance. The output can be given here as input, and it overrides other options. - \*\*indexer : {dim: indexer, }, optional + **indexer : {dim: indexer, }, optional 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`. diff --git a/xclim/sdba/_adjustment.py b/xclim/sdba/_adjustment.py index 5800b72bf..238058824 100644 --- a/xclim/sdba/_adjustment.py +++ b/xclim/sdba/_adjustment.py @@ -696,7 +696,7 @@ def npdf_transform(ds: xr.Dataset, **kwargs) -> xr.Dataset: hist : simulated timeseries on the reference period sim : Simulated timeseries on the projected period. rot_matrices : Random rotation matrices. - \*\*kwargs : dict + **kwargs : dict pts_dim : multivariate dimension name base : Adjustment class base_kws : Kwargs for initialising the adjustment object diff --git a/xclim/sdba/adjustment.py b/xclim/sdba/adjustment.py index c7611fddb..2f16cc26e 100644 --- a/xclim/sdba/adjustment.py +++ b/xclim/sdba/adjustment.py @@ -245,7 +245,7 @@ def train(cls, ref: DataArray, hist: DataArray, **kwargs) -> TrainAdjust: Training target, usually a reference time series drawn from observations. hist : DataArray Training data, usually a model output whose biases are to be adjusted. - \*\*kwargs : dict + **kwargs : dict Algorithm-specific keyword arguments, see class doc. """ kwargs = parse_group(cls._train, kwargs) @@ -278,9 +278,9 @@ def adjust(self, sim: DataArray, *args: xr.DataArray, **kwargs): ---------- sim : DataArray Time series to be bias-adjusted, usually a model output. - \*args : xr.DataArray + *args : xr.DataArray Other DataArrays needed for the adjustment (usually none). - \*\*kwargs : dict + **kwargs : dict Algorithm-specific keyword arguments, see class doc. """ skip_checks = kwargs.pop("skip_input_checks", False) @@ -358,7 +358,7 @@ def adjust( Training data, usually a model output whose biases are to be adjusted. sim : DataArray Time series to be bias-adjusted, usually a model output. - \*\*kwargs : dict + **kwargs : dict Algorithm-specific keyword arguments, see class doc. Returns diff --git a/xclim/sdba/base.py b/xclim/sdba/base.py index 3e66c33aa..c060a054b 100644 --- a/xclim/sdba/base.py +++ b/xclim/sdba/base.py @@ -346,7 +346,7 @@ def apply( (if False, default) (including the window and dimensions given through `add_dims`). The dimensions used are also written in the "group_compute_dims" attribute. If all the input arrays are missing one of the 'add_dims', it is silently omitted. - \*\*kwargs : dict + **kwargs : dict Other keyword arguments to pass to the function. Returns @@ -524,7 +524,7 @@ def map_blocks( # noqa: C901 ---------- reduces : sequence of strings Name of the dimensions that are removed by the function. - \*\*out_vars + **out_vars Mapping from variable names in the output to their *new* dimensions. The placeholders ``Grouper.PROP``, ``Grouper.DIM`` and ``Grouper.ADD_DIMS`` can be used to signify ``group.prop``,``group.dim`` and ``group.add_dims`` respectively. @@ -747,7 +747,7 @@ def map_groups( if main_only is False, and [Grouper.DIM] if main_only is True. See :py:func:`map_blocks`. main_only : bool Same as for :py:meth:`Grouper.apply`. - \*\*out_vars + **out_vars Mapping from variable names in the output to their *new* dimensions. The placeholders ``Grouper.PROP``, ``Grouper.DIM`` and ``Grouper.ADD_DIMS`` can be used to signify ``group.prop``,``group.dim`` and ``group.add_dims``, respectively. diff --git a/xclim/testing/utils.py b/xclim/testing/utils.py index d2ea0da89..83fa276ec 100644 --- a/xclim/testing/utils.py +++ b/xclim/testing/utils.py @@ -609,7 +609,7 @@ def open_dataset( URL of the repository to use when fetching testing datasets. cache_dir : Path The directory in which to search for and write cached data. - \*\*kwargs : dict + **kwargs : dict For NetCDF files, keywords passed to :py:func:`xarray.open_dataset`. Returns