This package is under development. Use with extreme caution.
src/oops: Theoopslibrary.src/spicedb: Thespicedblibrary.programs/gold_master: The gold master backplane test framework, imported asprograms.gold_master. It is a runnable tool rather than part of theoopsAPI, so it lives outsidesrc.tests: The unit tests, mirroringsrc/oops, plus the host tests undertests/hostsand thespicedbtests undertests/spicedb.scripts:setup-venv.sh,run-all-checks.sh, and the automated test script CI runs.
The library packages live under src, so they are importable only after an editable
install (or with src on PYTHONPATH). To create the virtual environment the check
script expects and install the package with its development extras:
./scripts/setup-venv.sh
source venv/bin/activateTo run the checks:
./scripts/run-all-checks.shOOPS_RESOURCES: The top-level directory containing all files needed by OOPS. Unless overriden as described below, this environment variable is the only one that needs to be set. It is expected that the specified directory will contain the subdirectories:SPICE: SPICE kernels and associated database.HST: Reference and calibration files required for HST.JWST: Reference and calibration files required for JWST.gold_master: Gold master files for host tests.test_data: Test input files.
SPICE_PATH: The location of the SPICE kernel files; defaults to${OOPS_RESOURCES}/SPICE.SPICE_SQLITE_DB_NAME: The full path and filename of the SPICE SQlite database; defaults to${SPICE_PATH}/SPICE.db.OOPS_TEST_DATA_PATH: The location of the oops test files; defaults to${OOPS_RESOURCES}/test_data.OOPS_GOLD_MASTER_PATH: The location of the oops gold master test files; defaults to${OOPS_RESOURCES}/gold_master.OOPS_BACKPLANE_OUTPUT_PATH: The output path to use when writing backplanes for gold master tests; defaults to the current directory.HST_IDC_PATH: The location of HST IDC files; defaults to${OOPS_RESOURCES}/HST/IDC.HST_SYN_PATH: The location of HST SYN files; defaults to${OOPS_RESOURCES}/HST/SYN.
The tests use pytest.
- To run the main oops unit tests:
pytest tests --ignore=tests/hosts --ignore=tests/spicedb- To run the host tests, which are the gold master tests:
pytest tests/hosts- To run the spicedb tests:
pytest tests/spicedb- To run everything:
pytest tests- To run the full set of quality gates (ruff, flake8, mypy, stubtest, pyroma, bandit, vulture, the three test suites, and the documentation build):
./scripts/run-all-checks.sh- To build the documentation on its own, both the public copy in
docs/_build/htmland the private-members copy the Developer's Guide relies on, indocs/_build/private/html:
./scripts/run-all-checks.sh --sphinxThe documentation holds a User's Guide and a Developer's Guide alongside the API
reference; open docs/_build/html/index.html after the build.
- To run the gold master tests for one instrument with the ability to specify command line options:
export PYTHONPATH=.
python tests/hosts/cassini/iss/gold_master.py --help
python tests/hosts/galileo/ssi/gold_master.py --help- To compare against a set of gold master files somewhere other than the default, use
--gold-masteron either the instrument command or pytest. It overrides$OOPS_GOLD_MASTER_PATHand$OOPS_RESOURCESfor that run only:
pytest tests/hosts --gold-master=/path/to/masters
PYTHONPATH=. python tests/hosts/cassini/iss/gold_master.py --gold-master=/path/to/mastersThe directory must have the standard layout, in which the files for one observation
are found in <path>/<mission>.<instrument>/<basename>, such as
<path>/cassini.iss/W1573721822_1. The directory is named for the mission and the
instrument alone, not for the module's place in any import tree, so the files stay put
when the module moves. As with the environment variables, the path may name a cloud
resource such as gs://rms-oops-resources/gold_master.
- Generated backplanes are written to
$OOPS_BACKPLANE_OUTPUT_PATH(or--output) under that same<mission>.<instrument>/<basename>layout, so an output directory can be handed straight back to--gold-master. To build a complete set of masters somewhere else, adopt into it:--adoptwrites the full-resolution arrays that a comparison expects, along with thesummary.pyholding the backplanes whose value is constant.
export PYTHONPATH=.
python tests/hosts/cassini/iss/gold_master.py --adopt --gold-master=/path/to/new
python tests/hosts/cassini/iss/gold_master.py --gold-master=/path/to/new
pytest tests/hosts/cassini/iss --gold-master=/path/to/newNaming the directory with --gold-master is what keeps --adopt away from the real
masters, which it would otherwise overwrite in place.