Add support for multiple values in the DecisionTree used for enhancements #1476
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.
The current
DecisionTree
class, which is used as the base class for theEnhancementDecisionTree
, currently has issues when a DataArray has multiple sensors specified for.attrs['sensor']
. It currently causes aTypeError
with a semi-cryptic debug log message produced:This is because the DecisionTree expects a single string value for the "sensor" value, but is getting a set (ex.
{'abi', 'glm'}
). What this means is that you can never actually configure an enhancement for a DataArray with multiple sensors as it will fail when trying to find the match. This PR is meant to allow for you to both configure an enhancement forsensor: [abi, glm]
to match it exactly, or for the provided DataArray with.attrs['sensor'] = {'abi', 'glm'}
to match eithersensor: abi
orsensor: glm
.My one concern about this is that specifying
sensor: [abi, glm]
in the YAML config will make people think that that matches eitherabi
orglm
when it will actually only match the exact pair{'abi', 'glm'}
.flake8 satpy