@@ -121,7 +121,7 @@ def {method}(
121
121
_NUMERIC_ONLY_NOTES = "Non-numeric variables will be removed prior to reducing."
122
122
123
123
ExtraKwarg = collections .namedtuple ("ExtraKwarg" , "docs kwarg call example" )
124
- skipna = extra_kwarg (
124
+ skipna = ExtraKwarg (
125
125
docs = _SKIPNA_DOCSTRING ,
126
126
kwarg = "skipna: bool = None," ,
127
127
call = "skipna=skipna," ,
@@ -130,7 +130,7 @@ def {method}(
130
130
131
131
>>> {calculation}(skipna=False)""" ,
132
132
)
133
- min_count = extra_kwarg (
133
+ min_count = ExtraKwarg (
134
134
docs = _MINCOUNT_DOCSTRING ,
135
135
kwarg = "min_count: Optional[int] = None," ,
136
136
call = "min_count=min_count," ,
@@ -139,7 +139,7 @@ def {method}(
139
139
140
140
>>> {calculation}(skipna=True, min_count=2)""" ,
141
141
)
142
- ddof = extra_kwarg (
142
+ ddof = ExtraKwarg (
143
143
docs = _DDOF_DOCSTRING ,
144
144
kwarg = "ddof: int = 0," ,
145
145
call = "ddof=ddof," ,
@@ -319,7 +319,7 @@ class DataStructure:
319
319
example_var_name = "ds" ,
320
320
numeric_only = True ,
321
321
)
322
- DataArrayObject = DataStructure (
322
+ DATAARRAY_OBJECT = DataStructure (
323
323
name = "DataArray" ,
324
324
docstring_create = """
325
325
>>> da""" ,
@@ -329,50 +329,50 @@ class DataStructure:
329
329
330
330
DATASET_GENERATOR = GenericReductionGenerator (
331
331
cls = "" ,
332
- datastructure = DatasetObject ,
332
+ datastructure = DATASET_OBJECT ,
333
333
methods = REDUCTION_METHODS ,
334
334
docref = "agg" ,
335
335
docref_description = "reduction or aggregation operations" ,
336
336
example_call_preamble = "" ,
337
337
see_also_obj = "DataArray" ,
338
338
)
339
- DataArrayGenerator = GenericReductionGenerator (
339
+ DATAARRAY_GENERATOR = GenericReductionGenerator (
340
340
cls = "" ,
341
- datastructure = DataArrayObject ,
341
+ datastructure = DATAARRAY_OBJECT ,
342
342
methods = REDUCTION_METHODS ,
343
343
docref = "agg" ,
344
344
docref_description = "reduction or aggregation operations" ,
345
345
example_call_preamble = "" ,
346
346
see_also_obj = "Dataset" ,
347
347
)
348
348
349
- DataArrayGroupByGenerator = GenericReductionGenerator (
349
+ DATAARRAY_GROUPBY_GENERATOR = GenericReductionGenerator (
350
350
cls = "GroupBy" ,
351
- datastructure = DataArrayObject ,
351
+ datastructure = DATAARRAY_OBJECT ,
352
352
methods = REDUCTION_METHODS ,
353
353
docref = "groupby" ,
354
354
docref_description = "groupby operations" ,
355
355
example_call_preamble = '.groupby("labels")' ,
356
356
)
357
- DataArrayResampleGenerator = GenericReductionGenerator (
357
+ DATAARRAY_RESAMPLE_GENERATOR = GenericReductionGenerator (
358
358
cls = "Resample" ,
359
- datastructure = DataArrayObject ,
359
+ datastructure = DATAARRAY_OBJECT ,
360
360
methods = REDUCTION_METHODS ,
361
361
docref = "resampling" ,
362
362
docref_description = "resampling operations" ,
363
363
example_call_preamble = '.resample(time="3M")' ,
364
364
)
365
- DatasetGroupByGenerator = GenericReductionGenerator (
365
+ DATASET_GROUPBY_GENERATOR = GenericReductionGenerator (
366
366
cls = "GroupBy" ,
367
- datastructure = DatasetObject ,
367
+ datastructure = DATASET_OBJECT ,
368
368
methods = REDUCTION_METHODS ,
369
369
docref = "groupby" ,
370
370
docref_description = "groupby operations" ,
371
371
example_call_preamble = '.groupby("labels")' ,
372
372
)
373
- DatasetResampleGenerator = GenericReductionGenerator (
373
+ DATASET_RESAMPLE_GENERATOR = GenericReductionGenerator (
374
374
cls = "Resample" ,
375
- datastructure = DatasetObject ,
375
+ datastructure = DATASET_OBJECT ,
376
376
methods = REDUCTION_METHODS ,
377
377
docref = "resampling" ,
378
378
docref_description = "resampling operations" ,
@@ -389,12 +389,12 @@ class DataStructure:
389
389
with open (filepath , mode = "w" , encoding = "utf-8" ) as f :
390
390
f .write (MODULE_PREAMBLE + "\n " )
391
391
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 ,
398
398
]:
399
399
for lines in gen .generate_methods ():
400
400
for line in lines :
0 commit comments