diff --git a/CHANGES.rst b/CHANGES.rst index 056b3b7b..d150ce00 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -4,6 +4,9 @@ - Provide existing ``AsdfFile`` instance to ``validate`` to speed up assignment validation ``check_value``. [#276] +- Deprecate ``deprecate_class`` unused by downstream. [#274] + + 1.10.0 (2024-02-29) =================== diff --git a/src/stdatamodels/jwst/datamodels/ramp.py b/src/stdatamodels/jwst/datamodels/ramp.py index 48cf6892..45d71858 100644 --- a/src/stdatamodels/jwst/datamodels/ramp.py +++ b/src/stdatamodels/jwst/datamodels/ramp.py @@ -1,5 +1,7 @@ +import warnings + from .model_base import JwstDataModel -from stdatamodels.jwst.library.basic_utils import deprecate_class + __all__ = ['RampModel', 'MIRIRampModel'] @@ -43,9 +45,14 @@ def __init__(self, init=None, **kwargs): self.err = self.err -@deprecate_class(RampModel) -class MIRIRampModel: +class MIRIRampModel(RampModel): """A data model for 4D MIRI ramps. This model has been deprecated. Please use `RampModel` instead. """ + def __init__(self, *args, **kwargs): + warnings.warn( + '"MIRIRampModel" is deprecated and will be removed. Use RampModel', + category=DeprecationWarning, + ) + return super(MIRIRampModel, self).__init__(*args, **kwargs) diff --git a/src/stdatamodels/jwst/library/basic_utils.py b/src/stdatamodels/jwst/library/basic_utils.py index 5d53c940..1e3f9a1c 100644 --- a/src/stdatamodels/jwst/library/basic_utils.py +++ b/src/stdatamodels/jwst/library/basic_utils.py @@ -1,5 +1,7 @@ """General utility objects""" +import warnings + def deprecate_class(new_class, message='"{old_class}" is deprecated and will be removed. Use {new_class}'): @@ -14,6 +16,8 @@ def deprecate_class(new_class, The deprecation warning message """ + warnings.warn("deprecate_class is deprecated and will be removed", DeprecationWarning) + # Implement the inner decorator def _decorator(old_class):