Repository Layout
The importable distribution is everything under src/. Everything else –
tests/, import_tests/, integration_tests/, benchmarks/, scripts/,
docs/, perf_test/ and the root files – is supporting code that is not installed, with two
deliberate exceptions: manage.py at the root is a development convenience, and the
package data inside src/ (table schemas, dictionary sources, templates, static
assets) ships in the wheel because the code reads it at run time. How it is found
differs by package: opus_import uses importlib.resources, the log analyzer
loads its Jinja templates by package name, and the Django app’s templates and static
files are found by Django’s own loaders.
The tree below annotates the directories and files a developer works in. Where a directory has a chapter of its own, it is named beside it.
rms-opus/
├── pyproject.toml # project metadata, every dependency, the console
│ # scripts the distribution declares, and the
│ # configuration of every tool: ruff, mypy, pytest,
│ # coverage, bandit, vulture, pymarkdown,
│ # setuptools-scm
├── manage.py # Django's management command for this checkout; it
│ # calls the same code the installed opus_manage runs
├── vulture_whitelist.py # names vulture cannot see are used, so it stops
│ # reporting them
├── codecov.yml, .readthedocs.yaml
├── README.md, CONTRIBUTING.md, LICENSE
├── CLAUDE.md # orientation for an AI coding assistant working here
├── plans/archive/ # the design documents and the reviews of them behind
├── critiques/archive/ # the current tree; history, not a specification
├── .gitattributes # marks the vendored asset trees linguist-vendored
├── .gitmodules, .vscode/ # submodule pins and editor settings
├── browserstack-logo-600x315.png # used by the README's acknowledgment
├── .cursor/rules/ # the coding and documentation standards this repository follows
├── .github/workflows/
│ ├── run-tests.yml # GitHub-hosted: lint, type check, unit tests, docs build
│ ├── run-integration.yml # self-hosted: full import + golden-response API suite
│ └── publish_to_pypi.yml, publish_to_test_pypi.yml
├── src/
│ ├── opus_config/ # the TOML configuration loader, and the
│ │ # opus.toml.template it writes out as
│ │ # the opus_config_template command
│ ├── opus_support/ # unit, time, clock, angle and orbit conversions,
│ │ # and the server's string collation
│ ├── opus_import/ # the import pipeline
│ │ ├── cli.py, __main__.py # the command-line surface
│ │ ├── context.py # the per-run context every step is handed
│ │ ├── deferred.py # what a pool worker records in place of
│ │ │ # database calls and log writes
│ │ ├── config_data.py # which missions, instruments and bundles exist
│ │ ├── config_bundle_info.py # which obs class and index files a bundle uses
│ │ ├── config_targets/ # target names, classes and aliases
│ │ ├── instruments.py # per-instrument label parsing helpers
│ │ ├── import_util.py # helpers shared by the steps and the obs classes
│ │ ├── mult_fields.py # which columns hold mult ids, and field ids
│ │ ├── mult_rank.py # the order a mult field's values are listed in
│ │ ├── list_junctions.py # the junction tables of the mult_list columns
│ │ ├── import_all.py # opus_import_all, the full-holdings sequence
│ │ ├── coordinator.py # starts, tracks and recovers the importers
│ │ ├── bundle_registry.py # the bundle registry: id ranges and states
│ │ ├── import_processes.py # the importers' table, locks and status
│ │ ├── primary_index.py # a bundle's primary index files and sizes
│ │ ├── schema_version.py # the schema version this release serves
│ │ ├── generations.py # import generations: rows served and hidden
│ │ ├── table_keys.py # the keys a table schema declares
│ │ ├── table_swap.py # rebuilding tables beside the live ones
│ │ ├── surface_geometry.py # obs_surface_geometry_target's categories
│ │ ├── validation_queries.py # the rows validation reads, and how
│ │ ├── import_fault.py # named failure points for the recovery tests
│ │ ├── importdb/ # the SQL backend: super.py (the abstract base
│ │ │ # both brands inherit), mysql.py, and the
│ │ │ # unimplemented postgresql.py stub
│ │ ├── obs/ # the obs_* class hierarchy, one row per observation
│ │ ├── steps/ # the do_* steps; the do_import_* modules are
│ │ │ # internals of do_import, not steps
│ │ ├── table_schemas/ # package data: the JSON that defines every OPUS table
│ │ ├── dictionary_data/ # package data: contexts.csv, the dictionary's
│ │ │ # context tree
│ │ └── util/ # hand-run authoring tools, not part of a run
│ ├── opus_app/ # the Django project
│ │ ├── settings.py, urls.py, wsgi.py
│ │ ├── manage.py # Django's management command line, installed
│ │ │ # as opus_manage; the checkout's manage.py
│ │ │ # calls it
│ │ ├── clear_django_cache.py # a deployment helper, run as a module
│ │ ├── apps/{search,results,metadata,ui,cart,help,paraminfo,tools}/
│ │ │ # the Django apps; search/management/commands/
│ │ │ # holds the opus_manage commands OPUS adds
│ │ ├── templates/ # package data: the project-level templates
│ │ └── static/ # package data: the JavaScript, CSS and images
│ ├── opus_deploy/ # the server deploy chain, shipped so that a server
│ │ # needs no checkout; opus_deploy_scripts writes it
│ │ # out, and running it from inside an installation a
│ │ # deploy replaces is what that avoids
│ │ └── server/ # package data: the deploy and database
│ │ # scripts, the log-analyzer cron templates,
│ │ # and deploy.env.template, the contract for
│ │ # the secrets/deploy.env beside a copy
│ └── opus_log_analyzer/ # the log analyzer
│ ├── log_analyzer.py, error_analyzer.py # its two programs
│ ├── opus/ # what only OPUS logs need
│ └── templates/ # package data: the Jinja report templates
├── tests/ # the holdings-free suite; `pytest` alone runs this and
│ # nothing else, because testpaths names it
│ ├── fixtures/opus_ci.toml # the dummy configuration the GitHub-hosted jobs use
│ │ # (the self-hosted one writes a real opus.toml)
│ └── opus_packaging/ # what the distribution promises rather than what the
│ # code computes: the console-script entry points, and
│ # the deploy chain's two shell scripts, run as shell
├── import_tests/ # the import pipeline end to end against the checked-in
│ │ # mini-holdings fixture; needs MySQL, no holdings
│ ├── tools/ # the recorder, the builder and the golden generator
│ ├── goldens/ # the expected contents of every table the import writes
│ └── fixtures/ # the negative cases and the unexecuted-method whitelist
├── integration_tests/ # the suites that need an imported database and the
│ │ # holdings behind it; run them by naming this directory
│ ├── .coveragerc # the 100% gate's coverage configuration
│ ├── test_api/ # the golden-response API suite
│ ├── apps_db_tests/ # the per-app database tests
│ └── test_db_data/, test_perf/
├── benchmarks/ # the benchmark harness: import, database and web
│ │ # measurements on servers it starts itself
│ ├── scenarios/ # what is measured, and the owned servers' settings
│ └── scratch/ # each session's raw logs and captures; not committed
├── scripts/
│ ├── run-all-checks.sh # every check this repository gates on, in one command
│ ├── read-docs.sh # builds the docs with -W -n and opens the HTML index;
│ │ # a developer convenience, not a gate
│ ├── automated_tests/ # what the self-hosted integration workflow runs
│ ├── import/ # wrappers around the import pipeline
│ ├── models/ # regenerates apps/search/models.py from the database
│ └── releases/ # the version-tag flow
├── docs/ # this documentation
│ └── _ext/ # the two build-time generators, described below
└── perf_test/ # a standalone performance experiment, outside every gate
Part of docs/ is generated rather than written:
docs/_build/holds the rendered documentation and is never committed.Several pages under
docs/are written by the extensions indocs/_ext/before each build and are git-ignored: the API reference’sautomodulepages (api_reference.rstandapi_opus_*.rst) and the API guide’s metadata-field table (api_guide_fields_table.rst). Changing what they contain means changing the generator, not the file. See Testing for how to run them.
src/opus_app/apps/search/models.py is also generated – by
scripts/models/create_opus_models.sh, from a populated database – but it is
committed, because rebuilding it needs a database. It is excluded from ruff for the
same reason, and a hand edit to it does not survive the next regeneration.
The generated models describes what it holds and how to regenerate it.
Which chapter covers what
Directory |
Chapter |
|---|---|
|
|
|
|
|
|
|
The Obs Class Hierarchy, The Obs Classes, Mission by Mission |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|