-
Notifications
You must be signed in to change notification settings - Fork 3
Add emissions configuration schema (inventories, species maps, sources) to mechanism v1 #281
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
7dd4271
feat: add emissions::v1 config parser for MIEM integration
smeechncar 5e52840
refactor: move emissions public headers out of versioned include path
smeechncar e48af6b
refactor: fold emissions into mechanism — no separate namespace, pars…
smeechncar 3ee8da4
fix: add Parse(string) overload to public API for in-memory documents
smeechncar 44ef925
fix: pass emissions section through ResolveFileConfig and use v1::Par…
smeechncar 51c4647
refactor: reshape emissions schema to name-keyed lists, split parser,…
smeechncar 42f29c2
Merge origin/main into feature/emissions-v1
smeechncar File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| // Copyright (C) 2023–2026 University Corporation for Atmospheric Research | ||
| // University of Illinois at Urbana-Champaign | ||
| // SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| #pragma once | ||
|
|
||
| #include <mechanism_configuration/errors.hpp> | ||
| #include <mechanism_configuration/types.hpp> | ||
|
|
||
| #include <yaml-cpp/yaml.h> | ||
|
|
||
| namespace mechanism_configuration::v1 | ||
| { | ||
| // Structural (schema) validation of the emissions section. Checks required/optional keys, | ||
| // value shape, and fixed-enum-membership only; semantic invariants (duplicate names, unknown | ||
| // inventory/species-map references, scaling-factor sums) are checked separately by the | ||
| // version-neutral ValidateSemantics on the built Mechanism. | ||
|
|
||
| /// @brief Schema-validates the emissions section: inventories, species maps (and their | ||
| /// mappings), regridding, and sources. | ||
| /// @param emissions_node YAML node for the `emissions` key | ||
| /// @return List of structural errors, or empty if the section conforms | ||
| Errors CheckEmissionsSchema(const YAML::Node& emissions_node); | ||
|
|
||
| /// @brief Parses a YAML node into an EmissionsConfig. | ||
| /// The input must be validated using CheckEmissionsSchema(). | ||
| /// This function assumes the structure and types are correct. | ||
| /// @param emissions_node YAML node for the `emissions` key | ||
| /// @return The parsed EmissionsConfig | ||
| types::EmissionsConfig ParseEmissionsSection(const YAML::Node& emissions_node); | ||
|
|
||
| } // namespace mechanism_configuration::v1 |
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.