@@ -210,10 +210,9 @@ def average(
210
210
The mode for the season that includes December.
211
211
212
212
* "DJF": season includes the previous year December.
213
- * "JFD": season includes the same year December. Xarray
214
- incorrectly labels the season with December as "DJF" when it
215
- should be "JFD". Refer to [1]_ for more information on this
216
- xarray behavior.
213
+ * "JFD": season includes the same year December.
214
+ Xarray labels the season with December as "DJF", but it is
215
+ actually "JFD".
217
216
218
217
* "drop_incomplete_djf" (bool, by default False)
219
218
If the "dec_mode" is "DJF", this flag drops (True) or keeps
@@ -304,10 +303,9 @@ def group_average(
304
303
The mode for the season that includes December.
305
304
306
305
* "DJF": season includes the previous year December.
307
- * "JFD": season includes the same year December. Xarray
308
- incorrectly labels the season with December as "DJF" when it
309
- should be "JFD". Refer to [1]_ for more information on this
310
- xarray behavior.
306
+ * "JFD": season includes the same year December.
307
+ Xarray labels the season with December as "DJF", but it is
308
+ actually "JFD".
311
309
312
310
* "drop_incomplete_djf" (bool, by default False)
313
311
If the "dec_mode" is "DJF", this flag drops (True) or keeps
@@ -339,10 +337,6 @@ def group_average(
339
337
xr.Dataset
340
338
Dataset with the average of a data variable by time group.
341
339
342
- References
343
- ----------
344
- .. [1] https://github.com/pydata/xarray/issues/810
345
-
346
340
Examples
347
341
--------
348
342
@@ -441,10 +435,9 @@ def climatology(
441
435
The mode for the season that includes December.
442
436
443
437
* "DJF": season includes the previous year December.
444
- * "JFD": season includes the same year December. Xarray
445
- incorrectly labels the season with December as "DJF" when it
446
- should be "JFD". Refer to [2]_ for more information on this
447
- xarray behavior.
438
+ * "JFD": season includes the same year December.
439
+ Xarray labels the season with December as "DJF", but it is
440
+ actually "JFD".
448
441
449
442
* "drop_incomplete_djf" (bool, by default False)
450
443
If the "dec_mode" is "DJF", this flag drops (True) or keeps
@@ -476,10 +469,6 @@ def climatology(
476
469
xr.Dataset
477
470
Dataset with the climatology of a data variable.
478
471
479
- References
480
- ----------
481
- .. [2] https://github.com/pydata/xarray/issues/810
482
-
483
472
Examples
484
473
--------
485
474
@@ -560,9 +549,8 @@ def departures(
560
549
561
550
xarray's grouped arithmetic operates over each value of the DataArray
562
551
corresponding to each grouping label without changing the size of the
563
- DataArra . For example,the original monthly time coordinates are
552
+ DataArray . For example,the original monthly time coordinates are
564
553
maintained when calculating seasonal departures on monthly data.
565
- Visit [3]_ to learn more about how xarray's grouped arithmetic works.
566
554
567
555
Parameters
568
556
----------
@@ -599,10 +587,9 @@ def departures(
599
587
The mode for the season that includes December.
600
588
601
589
* "DJF": season includes the previous year December.
602
- * "JFD": season includes the same year December. Xarray
603
- incorrectly labels the season with December as "DJF" when it
604
- should be "JFD". Refer to [4]_ for more information on this
605
- xarray behavior.
590
+ * "JFD": season includes the same year December.
591
+ Xarray labels the season with December as "DJF", but it is
592
+ actually "JFD".
606
593
607
594
* "drop_incomplete_djf" (bool, by default False)
608
595
If the "dec_mode" is "DJF", this flag drops (True) or keeps
@@ -634,10 +621,13 @@ def departures(
634
621
xr.Dataset
635
622
The Dataset containing the departures for a data var's climatology.
636
623
624
+ Notes
625
+ -----
626
+ Refer to [1]_ to learn more about how xarray's grouped arithmetic works.
627
+
637
628
References
638
629
----------
639
- .. [3] https://xarray.pydata.org/en/stable/user-guide/groupby.html#grouped-arithmetic
640
- .. [4] https://github.com/pydata/xarray/issues/810
630
+ .. [1] https://xarray.pydata.org/en/stable/user-guide/groupby.html#grouped-arithmetic
641
631
642
632
Examples
643
633
--------
@@ -1097,8 +1087,7 @@ def _get_df_dt_components(self, time_coords: xr.DataArray) -> pd.DataFrame:
1097
1087
1098
1088
This method extracts the applicable xarray datetime components from each
1099
1089
time coordinate based on the averaging mode and frequency, and stores
1100
- them in a DataFrame. Refer to [5]_ for information on xarray datetime
1101
- accessor components.
1090
+ them in a DataFrame.
1102
1091
1103
1092
Additional processing is performed for the seasonal frequency,
1104
1093
including:
@@ -1120,9 +1109,13 @@ def _get_df_dt_components(self, time_coords: xr.DataArray) -> pd.DataFrame:
1120
1109
pd.DataFrame
1121
1110
A DataFrame of datetime components.
1122
1111
1112
+ Notes
1113
+ -----
1114
+ Refer to [2]_ for information on xarray datetime accessor components.
1115
+
1123
1116
References
1124
1117
----------
1125
- .. [5 ] https://xarray.pydata.org/en/stable/user-guide/time-series.html#datetime-components
1118
+ .. [2 ] https://xarray.pydata.org/en/stable/user-guide/time-series.html#datetime-components
1126
1119
"""
1127
1120
df = pd .DataFrame ()
1128
1121
@@ -1331,7 +1324,7 @@ def _convert_df_to_dt(self, df: pd.DataFrame) -> np.ndarray:
1331
1324
1332
1325
If the default value of 1 is used for the years, datetime objects
1333
1326
must be created using `cftime.datetime` because year 1 is outside the
1334
- Timestamp-valid range. Refer to [6]_ and [7]_ for more information.
1327
+ Timestamp-valid range.
1335
1328
1336
1329
Parameters
1337
1330
----------
@@ -1343,11 +1336,15 @@ def _convert_df_to_dt(self, df: pd.DataFrame) -> np.ndarray:
1343
1336
np.ndarray
1344
1337
A numpy ndarray of datetime.datetime or cftime.datetime objects.
1345
1338
1339
+ Notes
1340
+ -----
1341
+ Refer to [3]_ and [4]_ for more information on Timestamp-valid range.
1342
+
1346
1343
References
1347
1344
----------
1348
- .. [6 ] https://docs.xarray.dev/en/stable/user-guide/weather-climate.html#non-standard-calendars-and-dates-outside-the-timestamp-valid-range
1345
+ .. [3 ] https://docs.xarray.dev/en/stable/user-guide/weather-climate.html#non-standard-calendars-and-dates-outside-the-timestamp-valid-range
1349
1346
1350
- .. [7 ] https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#timestamp-limitations
1347
+ .. [4 ] https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#timestamp-limitations
1351
1348
"""
1352
1349
df_new = df .copy ()
1353
1350
@@ -1394,11 +1391,11 @@ def _get_weights(self) -> xr.DataArray:
1394
1391
1395
1392
Notes
1396
1393
-----
1397
- Refer to [8 ]_ for the supported CF convention calendar types.
1394
+ Refer to [5 ]_ for the supported CF convention calendar types.
1398
1395
1399
1396
References
1400
1397
----------
1401
- .. [8 ] https://cfconventions.org/cf-conventions/cf-conventions.html#calendar
1398
+ .. [5 ] https://cfconventions.org/cf-conventions/cf-conventions.html#calendar
1402
1399
"""
1403
1400
# FIXME: This takes awhile ~1.5-2.2 seconds, not sure if there is a way
1404
1401
# around this because this is a vectorized operation already (to my
0 commit comments