feat(batch): typed LoadPolicy/CellSpec + resolve_specs (#699) - #728
Merged
Conversation
Third arc of Epic A (batch v3, #696). Replaces the legacy update() kwargs tunnels (79 kwargs.pop/get; precedence smeared across ~200 lines) with: - SourcePreference/LoadPolicy: typed batch-wide loading options (force_cellpy/force_raw/force_recalc -> fields). - CellSpec: fully resolved per-cell loading instructions. - resolve_specs(): the single, pure precedence merge journal columns < journal `argument` < policy overrides < per-cell, reproducing the legacy {**cell_spec_page, **kwargs, **cell_spec} (batch_experiments.py:361). parse_argument() coerces the string/dict argument form exactly like _get_cell_spec_from_page. 9 tests: argument coercion, three-layer precedence (property-style), cell_type->cycle_mode fallback, resolution over a real journal. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Bugbot is not enabled for your account, so this pull request was not reviewed. Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs. |
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.
A3 — batch v3:
policy.pyThird arc of Epic A (batch v3, #696), on top of A2's package. Replaces the legacy
update()kwargs tunnels (79kwargs.pop/get, precedence documented only in a docstring) with typed options and one pure resolver. Additive — nothing removed.cellpy/batch/policy.pySourcePreference—AUTO/CELLPY_ONLY/RAW_ONLY(replacesforce_cellpy/force_raw).LoadPolicy— batch-wide loading options (recalc,max_cycle,accept_errors,all_in_memory,skip_bad_cells,selector,loader_kwargs, per-fieldoverrides).CellSpec— fully resolved per-cell loading instructions.resolve_specs()— the single precedence merge:journal columns < journal argument < policy overrides < per-cell, reproducing the legacy{**cell_spec_page, **kwargs, **cell_spec}(batch_experiments.py:361).parse_argument()coerces the"recalc=False;data_points=(1, 10000)"/ dict forms exactly like_get_cell_spec_from_page.Tests —
tests/test_batch_v3_policy.py(9, all green)Argument coercion (string/dict/null), three-layer precedence (property-style: journal→policy→per-cell each winning in turn),
cell_type→cycle_modefallback, resolution over a real journal,LoadPolicydefaults.Next: A4 (#700) —
runner/result/storeconsuming these specs. Part of #696.🤖 Generated with Claude Code