Preserve v0 species/reaction properties needed for v1 conversion#309
Merged
Conversation
In v0 configs the diffusion coefficient is defined on the species, but MICM reads it from the phase species (e.g. for surface reactions). When the v0 parser placed all species into the gas phase it copied only the name, dropping the diffusion coefficient. This caused MICM to throw "Diffusion coefficient for species '<name>' is not defined" for any v0 species used in a surface reaction. Forward the species-level diffusion coefficient onto each gas-phase PhaseSpecies and extend the v0 species test to cover it. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
boulderdaze
approved these changes
Jul 24, 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.
Problem
Converting a v0 (CAMP) config to v1 — or running one through MICM — dropped or omitted several fields the v1 representation needs. Three distinct v0-parser gaps, each surfaced while getting a real v0 music_box config to run on current musica:
Diffusion coefficient — parsed onto the species but dropped when v0 places all species into the gas phase (only the name was copied). MICM reads the coefficient from the phase species (e.g. for surface reactions), so any v0 surface-reaction species failed with
Diffusion coefficient for species '<name>' is not defined(e.g.GLYOXAL).THIRD_BODY tracer — a
CHEM_SPECwithtracer type: THIRD_BODYrecorded only the tracer-type string, which the unified type does not carry into v1 serialization (v1 represents a third body viais third body). Species likeMsilently lost their third-body role on conversion.Reaction gas phase — v0 reactions left
gas_phaseempty, but the v1 parser requires every reaction to name a non-empty gas phase, so a converted mechanism failed to re-parse withUnknown phase ''.Fix
In the v0 parser, when building the single gas phase that all v0 species/reactions belong to:
PhaseSpecies;is_third_bodywhen the tracer type isTHIRD_BODY;gas_phaseto"gas".Extends the v0 species and arrhenius unit tests to cover all three. All v0 tests pass.
🤖 Generated with Claude Code