Skip to content

Commit 1fcd080

Browse files
committed
Fixes
1 parent 9799d87 commit 1fcd080

File tree

1 file changed

+21
-21
lines changed

1 file changed

+21
-21
lines changed

xarray/util/generate_reductions.py

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ def {method}(
121121
_NUMERIC_ONLY_NOTES = "Non-numeric variables will be removed prior to reducing."
122122

123123
ExtraKwarg = collections.namedtuple("ExtraKwarg", "docs kwarg call example")
124-
skipna = extra_kwarg(
124+
skipna = ExtraKwarg(
125125
docs=_SKIPNA_DOCSTRING,
126126
kwarg="skipna: bool = None,",
127127
call="skipna=skipna,",
@@ -130,7 +130,7 @@ def {method}(
130130
131131
>>> {calculation}(skipna=False)""",
132132
)
133-
min_count = extra_kwarg(
133+
min_count = ExtraKwarg(
134134
docs=_MINCOUNT_DOCSTRING,
135135
kwarg="min_count: Optional[int] = None,",
136136
call="min_count=min_count,",
@@ -139,7 +139,7 @@ def {method}(
139139
140140
>>> {calculation}(skipna=True, min_count=2)""",
141141
)
142-
ddof = extra_kwarg(
142+
ddof = ExtraKwarg(
143143
docs=_DDOF_DOCSTRING,
144144
kwarg="ddof: int = 0,",
145145
call="ddof=ddof,",
@@ -319,7 +319,7 @@ class DataStructure:
319319
example_var_name="ds",
320320
numeric_only=True,
321321
)
322-
DataArrayObject = DataStructure(
322+
DATAARRAY_OBJECT = DataStructure(
323323
name="DataArray",
324324
docstring_create="""
325325
>>> da""",
@@ -329,50 +329,50 @@ class DataStructure:
329329

330330
DATASET_GENERATOR = GenericReductionGenerator(
331331
cls="",
332-
datastructure=DatasetObject,
332+
datastructure=DATASET_OBJECT,
333333
methods=REDUCTION_METHODS,
334334
docref="agg",
335335
docref_description="reduction or aggregation operations",
336336
example_call_preamble="",
337337
see_also_obj="DataArray",
338338
)
339-
DataArrayGenerator = GenericReductionGenerator(
339+
DATAARRAY_GENERATOR = GenericReductionGenerator(
340340
cls="",
341-
datastructure=DataArrayObject,
341+
datastructure=DATAARRAY_OBJECT,
342342
methods=REDUCTION_METHODS,
343343
docref="agg",
344344
docref_description="reduction or aggregation operations",
345345
example_call_preamble="",
346346
see_also_obj="Dataset",
347347
)
348348

349-
DataArrayGroupByGenerator = GenericReductionGenerator(
349+
DATAARRAY_GROUPBY_GENERATOR = GenericReductionGenerator(
350350
cls="GroupBy",
351-
datastructure=DataArrayObject,
351+
datastructure=DATAARRAY_OBJECT,
352352
methods=REDUCTION_METHODS,
353353
docref="groupby",
354354
docref_description="groupby operations",
355355
example_call_preamble='.groupby("labels")',
356356
)
357-
DataArrayResampleGenerator = GenericReductionGenerator(
357+
DATAARRAY_RESAMPLE_GENERATOR = GenericReductionGenerator(
358358
cls="Resample",
359-
datastructure=DataArrayObject,
359+
datastructure=DATAARRAY_OBJECT,
360360
methods=REDUCTION_METHODS,
361361
docref="resampling",
362362
docref_description="resampling operations",
363363
example_call_preamble='.resample(time="3M")',
364364
)
365-
DatasetGroupByGenerator = GenericReductionGenerator(
365+
DATASET_GROUPBY_GENERATOR = GenericReductionGenerator(
366366
cls="GroupBy",
367-
datastructure=DatasetObject,
367+
datastructure=DATASET_OBJECT,
368368
methods=REDUCTION_METHODS,
369369
docref="groupby",
370370
docref_description="groupby operations",
371371
example_call_preamble='.groupby("labels")',
372372
)
373-
DatasetResampleGenerator = GenericReductionGenerator(
373+
DATASET_RESAMPLE_GENERATOR = GenericReductionGenerator(
374374
cls="Resample",
375-
datastructure=DatasetObject,
375+
datastructure=DATASET_OBJECT,
376376
methods=REDUCTION_METHODS,
377377
docref="resampling",
378378
docref_description="resampling operations",
@@ -389,12 +389,12 @@ class DataStructure:
389389
with open(filepath, mode="w", encoding="utf-8") as f:
390390
f.write(MODULE_PREAMBLE + "\n")
391391
for gen in [
392-
DatasetGenerator,
393-
DataArrayGenerator,
394-
DatasetGroupByGenerator,
395-
DatasetResampleGenerator,
396-
DataArrayGroupByGenerator,
397-
DataArrayResampleGenerator,
392+
DATASET_GENERATOR,
393+
DATAARRAY_GENERATOR,
394+
DATASET_GROUPBY_GENERATOR,
395+
DATASET_RESAMPLE_GENERATOR,
396+
DATAARRAY_GROUPBY_GENERATOR,
397+
DATAARRAY_RESAMPLE_GENERATOR,
398398
]:
399399
for lines in gen.generate_methods():
400400
for line in lines:

0 commit comments

Comments
 (0)