Only write parent attributes when they are required for parent experiments in CMIP7 datasets#940
Open
Only write parent attributes when they are required for parent experiments in CMIP7 datasets#940
Conversation
…ore the parent attributes
…t, and warn users if they have other parent attributes when parent experiment is not defined
…hey are not listed in the experiment.
…ot defined in the CV, then remove the parent attribute
…does not for CIMP7 compliance
Collaborator
|
The changes listed above seem sufficient to handle everything the way we want. I've looked at the code changes briefly and didn't notice any issues, but can't say that should be a consideration. |
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.
Resolves #937
Adds CMIP7-specific requirements for parent experiments (
parent_experiment_id) and other parent attributes. These are enabled by setting"_cmip7_option": 1in the user input JSON.For experiments with no parent experiments defined in the CV, CMOR now warns on stray parent attributes and removes them from the dataset before writing. It also hard-errors when a user supplies
parent_experiment_idfor an experiment that should not have one, and when a requiredparent_experiment_idis missing for an experiment that does define parents.Test/test_cmor_parent_attrs.py covers the following cases:
parent_experiment_idfor an experiment whose CV lists no parents.parent_experiment_idis omitted.parent_activity_id.@matthew-mizielinski