Skip to content

fix: five autocti_workspace scripts fail on main (cti-upkeep 3) #45

Closed

Description

@Jammy2211

Overview

The cti-upkeep 3a smoke triage (autocti_workspace#43) found five scripts failing on main. A fresh re-run in dependency order shows that four really fail, all fixable inside the workspace, and one (plot/fpa/imaging_ci/database.py) passes when its simulator and fit run first. This task fixes the four and adds the scripts to smoke_tests.txt, so CI catches them if they break again. Phase 3 of the cti-upkeep epic.

Plan

  • Fix the four failing scripts in the workspace. No library change is needed.
  • Add each fixed script to smoke_tests.txt in its group, after the scripts that produce its data.
  • Time the FPA chain (simulator, fit, database: ~220 s in test mode) and add it only if it fits the smoke budget; otherwise list it commented out, with the timing as the reason.
  • Check both smoke profiles (profile_smoke, profile_release) and CI on 3.12 and 3.13.
  • Out of scope: the slow non_uniform_cosmic_rays simulator, which stays a note on the epic.
  • Tier: glance. Merge mode: auto-merge on green if the Witness passes, then a post-merge summary.
Detailed implementation plan

Affected Repositories

  • autocti_workspace (primary, and the only repo changed)

Branch Survey

Repository Current Branch Dirty?
./cti/autocti_workspace main (a92e524) clean

Suggested branch: feature/cti-five-failing-scripts

Re-run evidence (2026-11-06, PyAutoCTI main 804ddebd, profile_smoke env, fresh clone)

script result
plot/fpa/imaging_ci/simulator.py → fit.py → database.py all rc=0 (61 s, 71 s, 87 s). The PIXSCAY error does not reproduce.
plot/diagnostics/imaging_ci/well_filling.py TypeError: only 0-dimensional arrays can be converted to Python scalars (float() on a 1-element binned EPER array, raised from autoarray abstract_ndarray.__float__)
dataset_1d/advanced/temporal/database.py AttributeError: 'ModelInstance' object has no attribute 'time'
dataset_1d/advanced/temporal/plot.py AttributeError: 'ModelInstance' object has no attribute 'cti' (the same root cause; the SQLAlchemy error does not reproduce)
imaging_ci/advanced/chaining/noise_scaling.py reads poisson/simple/norm_*, but poisson_traps.py writes poisson/norm_*

Implementation Steps

  1. scripts/imaging_ci/advanced/chaining/noise_scaling.py: read from dataset/imaging_ci/poisson/norm_* and drop the stray "simple".
  2. scripts/plot/diagnostics/imaging_ci/well_filling.py: take element [0] of the pixels=(0,1) binned array instead of calling float(array).
  3. scripts/dataset_1d/advanced/temporal/database.py: samps.max_log_likelihood() on the combined fit returns one entry per dataset ([0]–[3]) plus factor. Use [0] (the per-dataset instance carrying time and cti, as fit.py does with result_list[0].instance) and explain why in the prose.
  4. scripts/dataset_1d/advanced/temporal/plot.py: the same [0] fix for median_pdf and errors_at_upper/lower_sigma. The database query also returns the 20 per-dataset sub-fits beside the 5 top-level fits ("25 fits matching"), whose samples fail to load, so restrict it to top-level fits.
  5. smoke_tests.txt: add poisson_traps.py + noise_scaling.py, well_filling.py, and temporal/database.py + temporal/plot.py, each after its producers. Add the FPA chain only if its timing fits.
  6. Notebooks: follow the workspace AGENTS.md convention; no hand edits to .ipynb files.
  7. Verify: each fixed script from a fresh clone in dependency order, python .github/scripts/run_smoke.py under both profiles, then PR CI.

Key Files

  • scripts/imaging_ci/advanced/chaining/noise_scaling.py: dataset path
  • scripts/plot/diagnostics/imaging_ci/well_filling.py: EPER scalar extraction
  • scripts/dataset_1d/advanced/temporal/{database,plot}.py: per-dataset instance from the combined fit
  • smoke_tests.txt: promoted entries

Original Prompt

Click to expand starting prompt

autocti_workspace: five scripts fail on current main (from the 3a smoke triage)

Type: bug
Target: autocti_workspace
Repos:

  • autocti
  • autocti_workspace
    Themes:
  • cti
  • smoke
    Difficulty: medium
    Autonomy: supervised
    Priority: normal
    Status: formalised
    Consequence: glance
    Witness: each of the five scripts below runs end-to-end under config/build/profile_smoke.yaml from a fresh clone, run after its producer scripts in dependency order (simulator → fit → database → plot); each is then added to smoke_tests.txt in its group, and CI smoke stays green.
    Review-minutes: 5
    Unattended: ready
    Epic: cti-upkeep
    Phase: 3
    Filed: 2026-11-05

Found by the cti-upkeep 3a triage on 2026-11-05 (autocti_workspace#43). The 79 scripts were run under
profile_smoke against PyAutoCTI main 804ddebd, in dependency order. These five fail for reasons other
than ordering:

script error
plot/fpa/imaging_ci/database.py KeyError: "Keyword 'PIXSCAY' not found." (FITS header read on the database-loaded dataset)
plot/diagnostics/imaging_ci/well_filling.py TypeError: only 0-dimensional arrays can be converted to Python scalars
dataset_1d/advanced/temporal/database.py AttributeError: 'ModelInstance' object has no attribute 'time' (likely the FactorGraphModel instance structure; see complete/2026/11/cti-database-examples-drift.md)
dataset_1d/advanced/temporal/plot.py SQLAlchemy error (https://sqlalche.me/e/20/gkpj), probably downstream of the database.py failure
imaging_ci/advanced/chaining/noise_scaling.py FileNotFoundError: dataset/imaging_ci/poisson/simple/norm_100/data.fits; no simulator writes that path (simulators/examples/poisson_traps.py writes elsewhere)

Speed note (not a failure): imaging_ci/simulators/overview/non_uniform_cosmic_rays.py takes ~200–430 s,
which keeps it and overview/overview_4_charge_injection_data.py (which calls it) out of smoke. A faster
simulation (smaller frame or fewer cosmic rays under test mode) would let both be promoted.

Activity

  1. Jammy2211 commented on Nov 6, 2026

    @Jammy2211
    CollaboratorAuthor

    Shipped — 2026-11-06

    PRs

    Summary

    All five scripts run from a fresh clone in dependency order and are in smoke_tests.txt (36 → 44). Fixes: per-dataset [0] instances from the FactorGraphModel fits (temporal database/plot); scalar EPER via [0] (well_filling); noise_scaling's dataset path, dataset_full wiring and noise-scaling maps on the full datasets (set_noise_scaling_map_dict no longer exists). plot/fpa/imaging_ci/database.py did not reproduce once run in order and was promoted with its simulator and fit.

    Session Notes

    • Smoke profile 44/44 (573 s); release profile 43/44, then the one failure (full-dataset noise scaling) fixed and re-run green; PR CI smoke green on 3.12 and 3.13.
    • The FPA chain costs about 230 s smoke / 430 s release: a /ci_speedup candidate.
    • Filed separately: PyAutoMind/draft/bug/autocti_workspace/database_scripts_stale_sqlite_under_test_mode.md (database scripts delete the wrong .sqlite under test mode, so a second local run fails).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions