Repository navigation
Description
Overview
Enumerate fixed model values once. Selected as one of four PyAutoFit model-inspection and test-reliability tasks authorized on 2026-10-25.
Plan
- Reproduce the reported defect against current main.
- Enumerate float attributes once (Constant subclasses float), retaining raw floats. Test fixed scalar and tuple values, mixed free/fixed models and unchanged identifiers.
- Run focused regressions and the full library suite; record any environmental or pre-existing failures honestly.
Tier: glance (notify for test-only task) — merge mode: human /prm; no merge requested.
Detailed implementation plan
Enumerate float attributes once (Constant subclasses float), retaining raw floats. Test fixed scalar and tuple values, mixed free/fixed models and unchanged identifiers.
Repository: PyAutoFit; main clean at discovery; no existing active PyAutoFit claim or open PR found. Branch: feature/fixed-instance-tuples. Each task retains a separate branch and PR. The four branches are coordinated within this user-authorized group, with no overlapping source edits committed together. Existing identifiers/output-directory identity must remain stable.
Original Prompt
direct_instance_tuples double-counts Constants
Type: bug
Target: PyAutoFit
Repos:
- PyAutoFit
Themes: - visualization
Difficulty: small
Autonomy: safe
Priority: normal
Status: formalised
Consequence: glance
Witness: on a model with one fixed float (af.Model(Gaussian, centre=0.0)), direct_instance_tuples returns that centre once, not twice.
Review-minutes: 3
Unattended: ready
Filed: 2026-09-10
direct_instance_tuples returns every fixed value twice.
Model.__setattr__ wraps an assigned float in a Constant, which is a subclass
of both float and ModelObject. direct_instance_tuples gathers with
direct_tuples_with_type(Constant) and with direct_tuples_with_type(float)
(or equivalent), so each Constant matches both passes and appears twice in the
result.
One-line fix: direct_tuples_with_type(Constant) alone suffices, because
Constant is a float — the extra float pass adds nothing but duplicates.
Consequence: any caller that counts fixed parameters gets double. The
model-figures work (draft/feature/autofit/model_figures_epic.md) counts them
for the footer ("63 fixed parameters hidden"), and the group-scale lens model
has 291 fixed leaf slots, so the error is not subtle.
Add a test asserting the length of direct_instance_tuples on a model with a
known number of fixed floats, including the tuple case (centre=(0.0, 0.0)),
where the duplication compounds.
Found on 2026-09-10 by execution while auditing the PyAutoFit model API for the
model-figures design (research leg B, "What is missing from the PyAutoFit model
API", item 6).
Activity
Jammy2211 commentedon Oct 25, 2026
Shipped
Merged in #1722 at eda10ad, unchanged from the reviewed head, following the user's /prm command. All workflow jobs at that head passed. Combined validation: 3913 passed, 1 skipped, 1 xfailed; identifier parity checked. Downstream workspace smoke was not run and remains an explicit validation limitation. Pending PyAutoFit release; no release performed.