Repository navigation
fix: CTIAgg on multi-dataset fits, and honour the input instance - #122
Merged
Merged
Conversation
- cti.py _cti_from: a FactorGraphModel fit's instance has one child per dataset, so reading instance.cti crashed. Factor-graph fits now return a list with one CTI per dataset; single-dataset fits still return one CTI. - object_via_gen_from ignored its `instance` argument, so randomly_drawn_via_pdf_gen_from and all_above_weight_gen_from returned the max likelihood CTI for every sample. It now uses the input instance. The existing all_above_weight test asserted 10.0 for both samples, which only held because of this bug; it now expects each sample's own value (1.0, 10.0). - _cti_list_from moves to aggregator/abstract.py, shared by the CTI and fit aggregators (the two copies were identical). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…h fits (#121) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Nov 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes
ac.agg.CTIAggfor multi-dataset fits. Closes #121 (cti-upkeep phase 3).FactorGraphModelfit's instance holds one child per dataset, so_cti_fromcrashed readinginstance.cti. Factor-graph fits now return a list with oneCTIper dataset. Single-dataset fits still return oneCTI. This is the same shape the fit aggregators already use; the human approved the return-type split.object_via_gen_fromignored itsinstanceargument. As a resultrandomly_drawn_via_pdf_gen_fromandall_above_weight_gen_fromsilently returned the max-likelihood CTI for every sample. They now use each sample's own instance._cti_list_frommoves toaggregator/abstract.py, shared by the CTI and fit aggregators. The two copies were byte-identical.CTIAggdocstrings now describe the per-dataset list.API Changes
CTIAgggenerators yield a list ofCTIobjects (one per dataset) forFactorGraphModelfits. Before this change they crashed on such fits. Single-dataset fits are unchanged.randomly_drawn_via_pdf_gen_fromandall_above_weight_gen_fromnow return the drawn or above-weight samples' own CTI models, where before they repeated the max-likelihood one.Tests
object_via_gen_fromhonours an input instance. Both fail on unchanged main.test__cti_all_above_weight_gen: its first expected density changes 10.0 → 1.0. Thesamples_1dfixture's first sample is all 1.0 (weight 0), and the old 10.0 only held because of the ignored-instance bug.test_autocti(serial): 279 passed.profile_smokeandprofile_release.models.pyto smoke: declined. The new unit test covers the list behaviour directly, and the review rubric counts smoke-list growth without need as a defect.Tier: glance — auto-merge on green with the Witness passed (plan approved by the human 2026-11-05).
🤖 Generated with Claude Code