Add compare_E_and_LCI_result test analogous to the same test in useeior - #562
Draft
jvendries wants to merge 1 commit into
Draft
Add compare_E_and_LCI_result test analogous to the same test in useeior#562jvendries wants to merge 1 commit into
jvendries wants to merge 1 commit into
Conversation
Contributor
Author
This stack of pull requests is managed by Graphite. Learn more about stacking. |
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.

cc:
Closes:
What changed? Why?
Adds
compare_E_and_LCI_result— a port of useeior'scompareEandLCIResult— which validates that the direct-perspective LCI matrix (B·diag(L·y)) matches the commodity-transformed satellite totals (E_c). Two commodity transformation paths are supported: aVnormpath (used by Cornerstone's scrap-corrected market shares) and the standardC_mpath derived from the Make table.Introduces
eeio_year_alignment_precondition_okandassert_eeio_year_alignment_preconditionto enforce that model year, GHG data year, and B-matrix construction flags are aligned before running LCI≈E checks (replacing useeior'sgenerateChiMatrixwith an explicit χ=1 guard). Misaligned configs raise loudly rather than silently skipping.Adds
run_model_identity_validations(aliased asprint_validation_resultsto mirror useeior naming) as an orchestrator that collects domestic and total Ly≈q, LCI≈E, CPI market-share, and q≈U_d+y_d checks into a single report-style run withstop_on_failure=False.All new functions are exported from the
validationpackage's__all__.Testing
eeio_year_alignment_precondition_okpassing and failing cases,assert_eeio_year_alignment_preconditionraising on misaligned config, andcompare_E_and_LCI_resultpassing with a minimal toy LCI system and failing whenE_indis perturbed.test_v0_3_domestic_lci_equals_e) runs the full domestic LCI≈E check against the live v0.3 Cornerstone pipeline using theVnormpath, asserting zero failing sectors at 1% tolerance.