MCPcopy Index your code
hub / github.com/pydata/xarray / ImplementsDatasetReduce

Class ImplementsDatasetReduce

xarray/core/common.py:105–146  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

103
104
105class ImplementsDatasetReduce:
106 __slots__ = ()
107
108 @classmethod
109 def _reduce_method(cls, func: Callable, include_skipna: bool, numeric_only: bool):
110 if include_skipna:
111
112 def wrapped_func(self, dim=None, skipna=None, **kwargs):
113 return self.reduce(
114 func=func,
115 dim=dim,
116 skipna=skipna,
117 numeric_only=numeric_only,
118 **kwargs,
119 )
120
121 else:
122
123 def wrapped_func(self, dim=None, **kwargs): # type: ignore[misc]
124 return self.reduce(
125 func=func, dim=dim, numeric_only=numeric_only, **kwargs
126 )
127
128 return wrapped_func
129
130 _reduce_extra_args_docstring = dedent(
131 """
132 dim : str or sequence of str, optional
133 Dimension(s) over which to apply `{name}`. By default `{name}` is
134 applied over all dimensions.
135 """
136 ).strip()
137
138 _cum_extra_args_docstring = dedent(
139 """
140 dim : str or sequence of str, optional
141 Dimension over which to apply `{name}`.
142 axis : int or sequence of int, optional
143 Axis over which to apply `{name}`. Only one of the 'dim'
144 and 'axis' arguments can be supplied.
145 """
146 ).strip()
147
148
149class AbstractArray:

Callers

nothing calls this directly

Calls 1

stripMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…