refactor(regression): collapse path-placeholder clump into PlaceholderMap#759
Open
lewisjared wants to merge 3 commits into
Open
refactor(regression): collapse path-placeholder clump into PlaceholderMap#759lewisjared wants to merge 3 commits into
lewisjared wants to merge 3 commits into
Conversation
…rMap Introduce a frozen PlaceholderMap value object in climate_ref_core.output_files that owns the (token, directory) placeholder set. Config-stable tokens come from for_baseline(); the per-execution <OUTPUT_DIR> is late-bound via with_output(); sanitise()/hydrate()/as_replacements() replace the to_placeholders/from_placeholders/_placeholder_pairs free functions, which are removed. Every caller now passes a single placeholders argument instead of threading output_dir/test_data_dir/software_root_dir through ~8 signatures, and the verification side (RegressionValidator, conftest ExecutionRegression/DiagnosticValidator) derives its replacements from the same map so capture and verification can no longer declare different token sets and drift apart. Behaviour-preserving.
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
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.
Description
Behaviour-preserving refactor stacked on #756. It collapses the regression-test path-placeholder data clump into a single
PlaceholderMapvalue object.Previously the placeholder set (
<OUTPUT_DIR>/<TEST_DATA_DIR>/<SOFTWARE_ROOT_DIR>) was expressed three ways: looseoutput_dir/test_data_dir/software_root_dirparameters threaded through ~8 signatures, a private_placeholder_pairslist, and hand-built{real: token}dicts at the verification call sites. Adding the third placeholder (<SOFTWARE_ROOT_DIR>, in #756) had to be threaded through every layer, and the verification side had already drifted — it only knew two of the three tokens.PlaceholderMap(inclimate_ref_core.output_files) now owns the(token, directory)set. The configuration-stable tokens come fromPlaceholderMap.for_baseline(...); the per-execution<OUTPUT_DIR>is late-bound via.with_output(...); and.sanitise()/.hydrate()/.as_replacements()replace the old free functions. The three free functions (to_placeholders,from_placeholders,_placeholder_pairs) are deleted, and every caller now passes a singleplaceholdersargument. The verification side (RegressionValidator, plus the conftestExecutionRegression/DiagnosticValidator) derives its replacements from the same map, so capture and verification can no longer declare different token sets and drift apart.No behaviour change: the path rewriting, longest-match-first ordering, and float/provenance handling are identical. Verified with
ruff,ruff format,mypy, and the existing unit + integration suites (241 passed, 1 skipped), plus an independent review pass.Checklist
Please confirm that this pull request has done the following:
changelog/(759.trivial.md)