Either support passing of all Quantified
-like objects to all functions supporting them or create a new TypeVar
#1726
Labels
information
For development/intsructional purposes
invalid
This doesn't seem right
standards / conventions
Suggestions on ways forward
Milestone
Description
We currently use the
Quantified
type alias in almost all the threshold-based indicators to specify that this variable should conform to something resembling a string with units (str | pint.Quantity
), but this alias also includesxarray.DataArray
. Does this mean that we can pass (or would like to enable passing) DataArrays of grids denoting thresholds? No, we currently don't support that behaviour, but maybe we would want to?If not, we may need to create a new, more constrained custom variable (
str2pint
often takes variables of this type but does not supportpint.Quantity
orxarray.DataArray
). Solving this issue alone will resolve at least 1/4 of all errors associated withmypy
typing (~300+).See also: #1719 and #1721
The text was updated successfully, but these errors were encountered: