Skip to content

Commit

Permalink
Add docstring
Browse files Browse the repository at this point in the history
  • Loading branch information
Zeitsperre committed May 31, 2023
1 parent e31ae6b commit f3e9447
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion xclim/core/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -582,9 +582,16 @@ class InputKind(IntEnum):
"""


def infer_kind_from_parameter(param: Parameter, has_units: bool = False) -> InputKind:
def infer_kind_from_parameter(param, has_units: bool = False) -> InputKind:
"""Return the appropriate InputKind constant from an ``inspect.Parameter`` object.
Parameters
----------
param : Parameter
has_units : bool
Notes
-----
The correspondence between parameters and kinds is documented in :py:class:`xclim.core.utils.InputKind`.
The only information not inferable through the `inspect` object is whether the parameter
has been assigned units through the :py:func:`xclim.core.units.declare_units` decorator.
Expand Down

0 comments on commit f3e9447

Please sign in to comment.