Skip to content

fix: CTIAgg and database examples on multi-dataset (factor-graph) fits #121

Closed

Description

@Jammy2211

Overview

The dataset_1d database examples crash on multi-dataset (factor-graph) fits.

  • ac.agg.CTIAgg reads fit.instance.cti, but a factor-graph instance holds one child per dataset, so database/examples/models.py fails with AttributeError.
  • database/examples/samples.py reads .cti on the whole instance.

The per-fit aggregators already handle this structure; CTIAgg was missed. This is cti-upkeep phase 3.

Plan

  • CTIAgg works for multi-dataset fits: single-dataset fits keep returning one CTI, factor-graph fits return a list with one CTI per dataset (the same shape the fit aggregators use). Human-approved API decision.
  • The database samples.py example indexes the dataset before .cti and explains why.
  • The two Witness scripts (with database/start_here.py first) join smoke_tests.txt, so CI runs them.
  • Tier: glance — merge mode: auto-merge on green if the Witness passes, post-merge summary (PyAutoCTI first, then autocti_workspace)
Detailed implementation plan

Affected Repositories

  • PyAutoLabs/PyAutoCTI (primary)
  • PyAutoLabs/autocti_workspace

Branch Survey

Repository Current Branch Dirty?
./cti/PyAutoCTI main clean
./cti/autocti_workspace main clean

Suggested branch: feature/cti-database-examples-drift

Implementation Steps

  1. PyAutoCTI: move _cti_list_from into autocti/aggregator/abstract.py and import it in fit_dataset_1d.py and fit_imaging_ci.py. cti.py::_cti_from returns _cti_list_from(fit.instance, len(fit.children)) for factor-graph fits. Update the docstring and drop the stale "analysis summing" log message.
  2. Tests: a factor-graph case in test_autocti/aggregator/test_aggregator_cti.py that fails on main. Then run the full suite serially.
  3. autocti_workspace: fix scripts/dataset_1d/advanced/database/examples/samples.py, add 3 smoke entries, regenerate the affected notebooks.
  4. Witness: both scripts plus models.py end-to-end against the branch; all 8 dataset_1d results/database scripts pass; CI smoke passes.

Key Files

  • autocti/aggregator/cti.py, abstract.py, fit_dataset_1d.py, fit_imaging_ci.py
  • autocti_workspace/scripts/dataset_1d/advanced/database/examples/samples.py, smoke_tests.txt

Original Prompt

Click to expand starting prompt

autocti_workspace: the dataset_1d results/database example scripts have drifted

Type: bug
Target: autocti_workspace
Repos:

  • autocti
  • autocti_workspace
    Themes:
  • cti
  • notebooks
    Difficulty: large
    Autonomy: supervised
    Priority: normal
    Status: formalised
    Consequence: glance
    Witness: scripts/dataset_1d/advanced/database/examples/samples.py and scripts/dataset_1d/results/examples/samples.py run end-to-end against the installed autocti (FactorGraphModel instance structure, live plot API), and a minimal smoke workflow runs them in CI.
    Review-minutes: 3
    Unattended: ready
    Epic: cti-upkeep
    Phase: 3
    Filed: 2026-08-19 (backfilled from git)

Activity

  1. Jammy2211 commented on Nov 5, 2026

    @Jammy2211
    CollaboratorAuthor

    Shipped 2026-11-05

    Witness passed: all 9 dataset_1d results/database scripts run end-to-end, and smoke passes 6/6 under the smoke and release profiles and in CI. The independent review found LOW-severity items only, all resolved or judged. Glance-tier auto-merge (plan approved 2026-11-05).

    Follow-up filed: a PyAutoFit bug where Samples.with_paths / without_paths break on shared-prior factor-graph fits.

    🤖 Generated with Claude Code

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