You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Simplify the CoDICE unit-test suite. The current tests are highly coupled and complex, which makes them hard for future contributors to work with and extend. This was requested by Tenzin, and the work is unit-test-only — no changes to processing code.
Why now
Recent test-data churn (issues #3242 / #3251 / #3262) surfaced how brittle and coupled these tests are. A concrete example uncovered while working #3262: imap_processing/tests/codice/conftest.py's codice_lut_path_side_effect is inconsistent about validation dates — 8 L0 paths are built from the VALIDATION_FILE_DATE constant while 5 are hardcoded (conftest.py:110, 119, 128, 137, 146). That kind of split forces error-prone manual edits every time the validation epoch is rev'd, and is a symptom of broader coupling in the fixtures. #3262 does only the minimal correction; the deeper cleanup belongs here.
Ideas from Tenzin
Captured so we don't lose them. Tenzin explicitly encouraged starting fresh with a new look rather than treating these as a fixed checklist — a clean redesign may benefit contributors more.
Take in Joey's L0 file, process up to L1A or L1B or L2 and compare with Joey's then. E.g. if a product only gets processed up to L1B, then process L0 → L1B directly and compare with Joey's at L1B. Ignore intermediate levels in tests. Same for others: if a product only goes up to L2, process L0 → L2 and compare with L2. This gives us intermediate-product correctness along the path "for free."
If it's easier to use L0 data from the SDC directly and pass the unpacked xr.Dataset[apid] to each test, that can be helpful too.
IALiRT test fixtures are now stale (surfaced in #3262)
While finishing #3262 we hit a deeper issue with the CoDICE-IALiRT test (imap_processing/tests/ialirt/unit/test_process_codice.py):
It feeds on legacy imap_codice_l0_*-ialirt_*.pkts fixtures, but IALiRT no longer comes from that kind of L0 packet — per Joey (CoDICE), IALiRT is now its own thing, sourced from a LASP-developed API. So the test's input format no longer reflects how IALiRT data is actually produced; matching the science products' new 20260204 epoch would have required fabricating synthetic packets, which we declined to do.
As a stopgap, Restore strict CoDICE L2 spin_angle validation once 20260204 L0 packets are uploaded #3262decouples the IALiRT test from the shared validation constants and pins it at the existing 20250814_v015 IALiRT data via dedicated IALIRT_VALIDATION_FILE_DATE/IALIRT_VALIDATION_FILE_VERSION constants. That keeps it passing but adds yet another date split — exactly the coupling smell this refactor should eliminate.
This refactor should reconcile the IALiRT test fixtures with the real (LASP-API) data source rather than legacy packet files. The IALiRT team (e.g. @laspsandoval) should weigh in on how that test data ought to be produced going forward.
Scope
In scope: restructuring/simplifying CoDICE unit tests and their fixtures (imap_processing/tests/codice/), and the related CoDICE-IALiRT test (imap_processing/tests/ialirt/unit/test_process_codice.py); decoupling fixtures; removing the mixed-date / hardcoded-fixture patterns (including the IALiRT date split introduced as a Restore strict CoDICE L2 spin_angle validation once 20260204 L0 packets are uploaded #3262 stopgap); reconciling the IALiRT test fixtures with the LASP-API data source; reducing the amount of get_file_paths mocking; collapsing redundant intermediate-level assertions where a single L0→highest-level comparison covers them.
Goal
Simplify the CoDICE unit-test suite. The current tests are highly coupled and complex, which makes them hard for future contributors to work with and extend. This was requested by Tenzin, and the work is unit-test-only — no changes to processing code.
Why now
Recent test-data churn (issues #3242 / #3251 / #3262) surfaced how brittle and coupled these tests are. A concrete example uncovered while working #3262:
imap_processing/tests/codice/conftest.py'scodice_lut_path_side_effectis inconsistent about validation dates — 8 L0 paths are built from theVALIDATION_FILE_DATEconstant while 5 are hardcoded (conftest.py:110, 119, 128, 137, 146). That kind of split forces error-prone manual edits every time the validation epoch is rev'd, and is a symptom of broader coupling in the fixtures. #3262 does only the minimal correction; the deeper cleanup belongs here.Ideas from Tenzin
Captured so we don't lose them. Tenzin explicitly encouraged starting fresh with a new look rather than treating these as a fixed checklist — a clean redesign may benefit contributors more.
IALiRT test fixtures are now stale (surfaced in #3262)
While finishing #3262 we hit a deeper issue with the CoDICE-IALiRT test (
imap_processing/tests/ialirt/unit/test_process_codice.py):imap_codice_l0_*-ialirt_*.pktsfixtures, but IALiRT no longer comes from that kind of L0 packet — per Joey (CoDICE), IALiRT is now its own thing, sourced from a LASP-developed API. So the test's input format no longer reflects how IALiRT data is actually produced; matching the science products' new20260204epoch would have required fabricating synthetic packets, which we declined to do.20250814_v015IALiRT data via dedicatedIALIRT_VALIDATION_FILE_DATE/IALIRT_VALIDATION_FILE_VERSIONconstants. That keeps it passing but adds yet another date split — exactly the coupling smell this refactor should eliminate.This refactor should reconcile the IALiRT test fixtures with the real (LASP-API) data source rather than legacy packet files. The IALiRT team (e.g. @laspsandoval) should weigh in on how that test data ought to be produced going forward.
Scope
imap_processing/tests/codice/), and the related CoDICE-IALiRT test (imap_processing/tests/ialirt/unit/test_process_codice.py); decoupling fixtures; removing the mixed-date / hardcoded-fixture patterns (including the IALiRT date split introduced as a Restore strict CoDICE L2 spin_angle validation once 20260204 L0 packets are uploaded #3262 stopgap); reconciling the IALiRT test fixtures with the LASP-API data source; reducing the amount ofget_file_pathsmocking; collapsing redundant intermediate-level assertions where a single L0→highest-level comparison covers them.spin_anglerestoration handled in Restore strict CoDICE L2 spin_angle validation once 20260204 L0 packets are uploaded #3262.Context / related
spin_anglevalidation check).20260204_v016validation epoch and restore the strict check. This refactor builds on the same files but is intentionally separate so Restore strict CoDICE L2 spin_angle validation once 20260204 L0 packets are uploaded #3262 stays small and low-risk.