diff --git a/chandra_cmd_states/__init__.py b/chandra_cmd_states/__init__.py index a55ad84..c0e4637 100644 --- a/chandra_cmd_states/__init__.py +++ b/chandra_cmd_states/__init__.py @@ -1,4 +1,23 @@ # Licensed under a 3-clause BSD style license - see LICENSE.rst +import os +import warnings + +message_warn = ( + "\n" + "The chandra_cmd_states package is no longer supported and is replaced\n" + "by kadi.commands.states. Please update your code accordingly.\n" +) +message_error = ( + "\n" + "To temporarily continue using this package set the environment variable\n" + "SKA_ALLOW_DISCONTINUED_PACKAGES=1" +) + +if os.environ.get("SKA_ALLOW_DISCONTINUED_PACKAGES") == "1": + warnings.warn(message_warn, FutureWarning) +else: + raise RuntimeError(message_warn + message_error) + import ska_helpers from .cmd_states import * from .get_cmd_states import fetch_states diff --git a/docs/index.rst b/docs/index.rst index 6a900c3..61effa0 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -1,25 +1,17 @@ Chandra commanded states database ================================== +.. Warning:: the commanded states database and package described here is + **discontinued and no longer supported**. Instead use the + `Kadi commands and states + package `_. + This suite of tools provides the interface for creation and maintenance of the Chandra commanded states database. This database provides the commanded state of Chandra from 2002 through to the end of all approved command loads that are ingested to the OFLS database. The database thus contains both the definitive state and a predictive state at any time. -.. Warning:: Use of the commanded states database described here is deprecated - in favor of the `Kadi commands and states - package `_. - The replacement for the :func:`~chandra_cmd_states.fetch_states` function is described - in the `Chandra states and continuity - `_ - section which makes use of the `get_states - `_ - function. - - The commanded states database is still being maintained, but no new development - is expected. - A commanded state is an interval of time over which certain parameters of interest (obsid, SIM-Z position, commanded attitude, ACIS power configuration, etc) are invariant. This database is useful for several reasons: