Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR refactors the key validation mechanism by replacing the old keys struct with static constexpr const char* variables for keys, and updates all parser files (both v0 and v1) to use the new syntax.
- Replaces old brace-initialized key structures with std::vectorstd::string initializations using static constexpr key variables.
- Updates all usage of validation::keys. to validation:: in parser files.
- Revises header files in v0 and v1 to reflect the new key definitions.
Reviewed Changes
Copilot reviewed 31 out of 31 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/v1/emission_parser.cpp | Updates key references to use static constexpr variables. |
| src/v1/condensed_phase_photolysis_parser.cpp | Updates key references and vector initializations. |
| src/v1/condensed_phase_arrhenius_parser.cpp | Refactors key usage and error message updates for mutually exclusive options. |
| src/v1/branched_parser.cpp | Replaces old key syntax with new static constexpr key variable usage. |
| src/v1/arrhenius_parser.cpp | Consistent update of Arrhenius key references using new definitions. |
| src/v1/aqueous_equilibrium_parser.cpp | Refactors key references and vector initialization. |
| (v0 files) | All parser files updated uniformly replacing key struct access. |
| include/mechanism_configuration/v1/validation.hpp | Removes the keys struct and defines keys as static constexpr variables. |
| include/mechanism_configuration/v0/validation.hpp | Updates key definitions to use static constexpr const char*. |
boulderdaze
approved these changes
Apr 15, 2025
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.
This replaces the validation keys struct in both v0 and v1 with
static constexpr const char*variables for keys.When using
std::string, we were running into a static initialization problem (also see the linked article in the answer for more detail). This apparently isn't a problem within the library, but attempting to use those values in the musica performance repo caused this issue to pop up here and in micm.