Skip to content

Add compare_E_and_LCI_result test analogous to the same test in useeior - #562

Draft
jvendries wants to merge 1 commit into
mainfrom
jv_update_validations
Draft

Add compare_E_and_LCI_result test analogous to the same test in useeior#562
jvendries wants to merge 1 commit into
mainfrom
jv_update_validations

Conversation

@jvendries

@jvendries jvendries commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

cc:
Closes:

What changed? Why?

Adds compare_E_and_LCI_result — a port of useeior's compareEandLCIResult — 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: a Vnorm path (used by Cornerstone's scrap-corrected market shares) and the standard C_m path derived from the Make table.

Introduces eeio_year_alignment_precondition_ok and assert_eeio_year_alignment_precondition to enforce that model year, GHG data year, and B-matrix construction flags are aligned before running LCI≈E checks (replacing useeior's generateChiMatrix with an explicit χ=1 guard). Misaligned configs raise loudly rather than silently skipping.

Adds run_model_identity_validations (aliased as print_validation_results to 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 with stop_on_failure=False.

All new functions are exported from the validation package's __all__.

Testing

  • Unit tests cover eeio_year_alignment_precondition_ok passing and failing cases, assert_eeio_year_alignment_precondition raising on misaligned config, and compare_E_and_LCI_result passing with a minimal toy LCI system and failing when E_ind is perturbed.
  • An integration test (test_v0_3_domestic_lci_equals_e) runs the full domestic LCI≈E check against the live v0.3 Cornerstone pipeline using the Vnorm path, asserting zero failing sectors at 1% tolerance.

Copy link
Copy Markdown
Contributor Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant