Skip to content

difference: dev's diffimmeta table, one row per difference job, with the quality gate's numbers - #698

Merged
rusholme merged 2 commits into
mainfrom
diffimmeta
Dec 4, 2026
Merged

rusholme merged 2 commits into
mainfrom
diffimmeta

Conversation

@RussLaher

@RussLaher RussLaher commented Dec 4, 2026 •

Copy link
Copy Markdown
Collaborator

Implements rapid_docs decision-diffimmeta (Caltech-IPAC/rapid_docs#256: decisions.md, foundation.md, migration.md, difference.md).

Change.

  • database/schema.sql gains diffimmeta: dev's 12 DiffImMeta columns (rapidOpsTables.sql), keyed by pid, plus job. It also gains seven nullable columns (n_xsources_read_positive, n_xsources_prefiltered, n_xsources_snr_gt20, usable_fraction, registration_offset, core_fraction, ring_fraction), their indexes, and diffimmeta_official through the diffimages binding.
  • database/2026-12-04-diffimmeta.sql brings an existing database to the new schema, with no backfill. It is listed in database/README.md.
  • rapidpipe/stages/difference.py declares one row per job (diffimmeta_row).
    • nsexcatsources is the positive plus negative SFFT SExtractor rows before the prefilter; dev counts positive only.
    • The gain match's scalefacref, dxrmsfin, dyrmsfin, dxmedianfin and dymedianfin are stored as measured; dev's code registers 0.0 for the two RMS values.
    • hp6 and hp9 are of the field's centre.
    • The gate's numbers come from the job's metrics, null when not computed.
  • Also updated: the publisher, validate_run.py, the schema diagram (regenerated) and AGENTS.md list the table.

Reason. The migration dropped DiffImMeta with no recorded reason. The new columns give the quality gate's inputs in one row per difference. The gate itself still reads job_metrics.

Testing. All run locally (Python 3.14, PostgreSQL 17):

  • Unit:
    • the row's values against the manifest;
    • nulls when a value is not computed;
    • hp6 and hp9 for a field centred at RA 0, reached from RA 359.99 (the RA wrap check);
    • the parquet columns against schema.sql.
  • db: the row is official with its difference image (tests/db/test_difference_job.py), and the schema test lists the table.
  • Dated file: applied to main's schema at ced8ee2, it gives a schema dump identical to the new schema.sql (sorted comparison), writes no row, and fails on a fresh schema.sql.
  • Full suites: tests/db and tests/cli: 211 passed (test_publish_pool not run, needs pgbouncer). Full tests/unit: 1424 passed, 1 failed (test_run_job_workdir, which also fails on the unmodified baseline on macOS). check-public-safety.sh: clean.
  • After the nsexcatsources change: the affected files were re-run (86 passed).

Not tested: no real difference job has written a row, and the dated file has not been applied on SMDC.

🤖 Generated with Claude Code

RussLaher and others added 2 commits December 4, 2026 12:11
…the quality gate's numbers (decision-diffimmeta)

schema.sql gains diffimmeta, dev's DiffImMeta (rapidOpsTables.sql) with its
12 columns by name and type and its indexes, the difference's job beside
them, seven new nullable columns (n_xsources_read_positive,
n_xsources_prefiltered, n_xsources_snr_gt20, usable_fraction,
registration_offset, core_fraction, ring_fraction), and diffimmeta_official
through the diffimages binding. The difference stage declares one row
(diffimmeta_row): nsexcatsources the SFFT positive SExtractor catalog's
rows, the gain match's values (dxrmsfin and dyrmsfin measured, where dev
registers 0.0), hp6 and hp9 of the field's centre. database/2026-12-04-
diffimmeta.sql brings an existing database to it; no row is backfilled.
The publisher, validate_run.py and the schema diagram list the table.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…e the prefilter (decision-diffimmeta)

The positive and negative catalogs' rows summed, where dev counts the
positive catalog alone.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@rusholme
rusholme merged commit 693c2b0 into main Dec 4, 2026
5 checks passed
@rusholme
rusholme deleted the diffimmeta branch December 4, 2026 23:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants