Skip to content
This repository has been archived by the owner on Sep 19, 2024. It is now read-only.

Discontinue support for chandra_cmd_states #68

Merged
merged 1 commit into from
Dec 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions chandra_cmd_states/__init__.py
Original file line number Diff line number Diff line change
@@ -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"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Picking nits, I think that's SKA_ALLOW_DISCONTINUED_PACKAGES='1'. but I'm good!

)

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
Expand Down
18 changes: 5 additions & 13 deletions docs/index.rst
Original file line number Diff line number Diff line change
@@ -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 <http://cxc.cfa.harvard.edu/mta/ASPECT/tool_doc/kadi/commands_states.html>`_.

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 <http://cxc.cfa.harvard.edu/mta/ASPECT/tool_doc/kadi/commands_states.html>`_.
The replacement for the :func:`~chandra_cmd_states.fetch_states` function is described
in the `Chandra states and continuity
<http://cxc.cfa.harvard.edu/mta/ASPECT/tool_doc/kadi/commands_states.html#states>`_
section which makes use of the `get_states
<http://cxc.cfa.harvard.edu/mta/ASPECT/tool_doc/kadi/api.html#kadi.commands.states.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:
Expand Down