Skip to content

Commit 9ca89b4

Browse files
committed
Move deprecation warning to inside DJF conditional
1 parent ecfa4d2 commit 9ca89b4

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

xcdat/temporal.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1030,15 +1030,15 @@ def _set_season_config_attr(self, season_config: SeasonConfigInput):
10301030

10311031
# TODO: Deprecate incomplete_djf.
10321032
drop_incomplete_djf = season_config.get("drop_incomplete_djf", False)
1033-
if drop_incomplete_djf is not False:
1034-
warnings.warn(
1035-
"The `season_config` argument 'drop_incomplete_djf' is being "
1036-
"deprecated. Please use 'drop_incomplete_seasons' instead.",
1037-
DeprecationWarning,
1038-
stacklevel=2,
1039-
)
1040-
10411033
if dec_mode == "DJF":
1034+
if drop_incomplete_djf is not False:
1035+
warnings.warn(
1036+
"The `season_config` argument 'drop_incomplete_djf' is being "
1037+
"deprecated. Please use 'drop_incomplete_seasons' instead.",
1038+
DeprecationWarning,
1039+
stacklevel=2,
1040+
)
1041+
10421042
self._season_config["drop_incomplete_djf"] = drop_incomplete_djf
10431043

10441044
def _is_valid_reference_period(self, reference_period: Tuple[str, str]):

0 commit comments

Comments
 (0)