diff --git a/grudge/dof_desc.py b/grudge/dof_desc.py index 13db8e80a5cc7815e2da257659733e157ca84e00..fd3b9b605770b9bdc9dd360a3b7bfa5c308e521d 100644 --- a/grudge/dof_desc.py +++ b/grudge/dof_desc.py @@ -306,9 +306,24 @@ def as_dofdesc(dd): # {{{ Deprecated tags -# FIXME: These are deprecated and will be removed -QTAG_NONE = DISCR_TAG_BASE -QTAG_MODAL = DISCR_TAG_MODAL +_deprecated_names = {"QTAG_NONE": "DISCR_TAG_BASE", + "QTAG_MODAL": "DISCR_TAG_MODAL"} + + +def __getattr__(name): + if name in _deprecated_names: + warn(f"{name} is deprecated and will be dropped " + f"in version 2022.x. Use {_deprecated_names[name]} instead.", + DeprecationWarning, stacklevel=2) + return globals()[f"{_deprecated_names[name]}"] + + raise AttributeError(f"module {__name__} has no attribute {name}") + +import sys + +if sys.version_info < (3, 7): + QTAG_NONE = DISCR_TAG_BASE + QTAG_MODAL = DISCR_TAG_MODAL # }}}