Expand BPX GitHub file tests to cover all fields with warnings for mapping gaps#2
Draft
Expand BPX GitHub file tests to cover all fields with warnings for mapping gaps#2
Conversation
Co-authored-by: augustjohansson <9196210+augustjohansson@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix input argument parsing and enhance converter tests
Fix CLI argument parsing; add BPX GitHub example files, Chen 2020 round-trip tests, and validation data extraction utility
Feb 27, 2026
…tched Co-authored-by: augustjohansson <9196210+augustjohansson@users.noreply.github.com>
Copilot
AI
changed the title
Fix CLI argument parsing; add BPX GitHub example files, Chen 2020 round-trip tests, and validation data extraction utility
Expand BPX GitHub file tests to cover all fields with warnings for mapping gaps
Feb 28, 2026
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.
test_bpx_github_files.pyonly spot-checked ~7 fields per conversion, leaving the majority of each parameter set untested and giving no signal about fields silently dropped due to missing ontology mappings.Changes
Three new test helpers
_get_nested_value(data, path)— traverse a nested dict by tuple path, returningNoneon any missing key_check_all_mapped_fields(bpx_raw, converted, mappings, output_type)— iterates every field inbpx_raw["Parameterisation"]; hard-asserts mapped fields are present with correct values (numeric: 1 ppm tolerance; string/function: non-empty expression); emitsUserWarningfor each unmapped field_check_round_trip(converted, reference, mapped_output_paths)— compares converted output against a reference along every mapped path; emitsUserWarningon key or value mismatchUpdated test classes
Spot-check methods in
TestNMCBPXToBattMo,TestLFPBPXToBattMo,TestChen2020BPXToBattMo, andTestChen2020BattMoToBPXreplaced with comprehensive tests:Warning behaviour
Running with
-W default::UserWarningnow surfaces 33 actionable warnings:BPX field ... has no mapping to 'battmo.m'— the 16 known-unmapped fields per BPX file (thermal params, transport efficiency, entropic coefficients; seeWORKAROUNDS.md)Tests hard-fail only on genuine mapping regressions; gaps in the ontology are visible but non-blocking.
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.