From 5eecd5000bca2a9ff74c8eb2c43cf602c99454a1 Mon Sep 17 00:00:00 2001 From: John Krasting Date: Thu, 14 Aug 2025 11:50:02 -0400 Subject: [PATCH] Added DeprecationWarning for old CaseExperiment and CaseGroup funcs --- src/esnb/core/CaseExperiment.py | 7 +++++++ src/esnb/core/CaseGroup.py | 6 ++++++ 2 files changed, 13 insertions(+) diff --git a/src/esnb/core/CaseExperiment.py b/src/esnb/core/CaseExperiment.py index 86c229b..c2a3030 100644 --- a/src/esnb/core/CaseExperiment.py +++ b/src/esnb/core/CaseExperiment.py @@ -1,3 +1,5 @@ +import warnings + import yaml try: @@ -28,6 +30,11 @@ def __init__( self.source = source self.catalog = catalog + warnings.warn( + "`CaseExperiment` is deprecated and will be REMOVED on 18-Aug-25. Use `CaseExperiment2` instead", + DeprecationWarning, + ) + # TODO - make conformant to MDTF keys where possible if source == "dora": if verbose: diff --git a/src/esnb/core/CaseGroup.py b/src/esnb/core/CaseGroup.py index ad921bc..7723261 100644 --- a/src/esnb/core/CaseGroup.py +++ b/src/esnb/core/CaseGroup.py @@ -1,5 +1,6 @@ import os import tempfile +import warnings import xarray as xr @@ -20,6 +21,11 @@ def __init__( source="dora", verbose=True, ): + warnings.warn( + "`CaseGroup` is deprecated and will be REMOVED on 18-Aug-25. Use `CaseGroup2` instead", + DeprecationWarning, + ) + self.locations = [locations] if not isinstance(locations, list) else locations if len(self.locations) > 1: assert concat_dim is not None, (