Repository navigation
feat: results library phase 2 — completeness over a declared grid + enrich - #1753
Merged
Merged
Conversation
…nrich
- autofit/results/library.py: ResultsLibrary (grid / library.yaml / from_campaign),
ExpectedResult; campaign expectations match the zip at success.zip_complete
exactly, as collector.check_success does
- autofit/results/completeness.py: check() → CompletenessReport (done / missing /
incomplete / failed / duplicate with reasons, per-product gaps, unexpected
results), write_missing_csv (atomic)
- autofit/results/enrich.py + Aggregator.enrich: add files/<name> to finished
results atomically (zip and folder copies), skip existing, per-result errors
- autofit/results/shard.py: stable disjoint shards (i/N)
- tools/util.write_zip_member: shared atomic add-or-replace; _replace_zip_member
delegates to it
- CLI: python -m autofit.results {check,enrich}; af.ResultsLibrary
Refs #1752
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Collaborator
Author
|
Workspace PR: PyAutoLabs/autofit_workspace#180 |
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
Results-library phase 2 (closes #1752; epic ledger PyAutoMind
draft/feature/autofit/results_library_epic.md). Phase 1 indexed every result and its state; this phase answers "what is missing?" against a declared expectation and addsenrichto put a new product into thousands of finished results without rerunning fits. That replaces theforce_pickle_overwrite+ Slurm reload pass DR1 used forcoolest.json/wcs.json.API Changes
New, additive only — nothing removed or renamed.
af.ResultsLibrarydeclares the expected results (datasets × searches × required products) via.grid(...),.from_yaml("library.yaml")or.from_campaign("campaign.yaml")..check()returns aCompletenessReportwith a status and reason for every expected result, and.write_missing_csv()writes the gaps.Aggregator.enrich(fn, name, overwrite=False, shard=None)addsfiles/<name>to every result atomically.python -m autofit.results check library.yaml(exit 0 = complete, 1 = gaps, 2 = error) andpython -m autofit.results enrich ROOTS --fn module:function --name NAME [--shard i/N].autofit.tools.util.write_zip_memberis the shared atomic zip add-or-replace helper.See full details below.
Test Plan
test_autofit/resultscovers the following (58 passed, 22 new):.completed, missing product, interrupted, superseded sibling, failed beforesearch.json, duplicate, unexpected.library.yamlrefusals.from_campaignagreeing withcollector.check_successon every task, plus the short-manifest-line case.-n 8collides on shared/tmppaths in grid-search tests, and those pass serially.from_indexskipped the folder copy;check_success;no_result;Workspace/Science/scratch/results_library_p2_w1b/):files/coolest.json;_v5objects) showed up as 13 missing paired with 13 unexpected.scripts/features/results_library.pyruns in test mode (separate PR).Full API Changes (for automation & release notes)
Added
autofit.results.library:ResultsLibrary(expected, roots, index_dir=None, name="library", latest_key=...), with:.grid(datasets, searches, roots, **kw).from_campaign(campaign, stages=None, products=None, roots=None, **kw).from_yaml(path).index()and.check(update=True)ExpectedResult(dataset, search, products=(), location=None, exact=False, error=None)LibraryExceptionaf.ResultsLibraryand fromautofit.results.autofit.results.completeness:check(library, records)CompletenessReport, with.results,.unexpected,.counts(),.product_counts(),.is_complete,.gaps(),.write_missing_csv(directory=".")and.summary()ResultCheckhas_product(record, product, zip_only=False)autofit.results.enrich:enrich(search_outputs, fn, name, overwrite=False, shard=None),EnrichReportandmember_name.autofit.results.shard:parse_shard,shard_ofandin_shard.autofit.aggregator.Aggregator.enrich(fn, name, overwrite=False, shard=None).autofit.tools.util.write_zip_member(zip_path, arcname, data=None, file_path=None, compress_type=None).checkandenrichinpython -m autofit.results.Changed
autofit.non_linear.paths.abstract._replace_zip_membernow delegates towrite_zip_member. Its behaviour is unchanged; the temporary file is now named<zip>.<pid>.tmp.force_pickle_overwritedocstring now points toAggregator.enrich. The flag itself is unchanged; removing it is a later step.Migration
Decisions flagged:
scripts/features/results_library.py.index_dirwhen it is declared, not when it is checked.enrichpasses on the same results at once is unsupported and documented as such (no locking).Generated by the PyAutoLabs agent workflow.
🤖 Generated with Claude Code