-
Notifications
You must be signed in to change notification settings - Fork 6
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
Flexible qc #62
Merged
Merged
Flexible qc #62
Conversation
This file contains 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
> > the self.qc attribute is still not available in the class. this will be added later on. > see #56 for a detailed explanation.
4 tasks
this qc attr as an empty object instance will now allow for further setting of qc-related attributes such as with: `object.__setattr__(self.qc,'qc_name',qc_flag_value)` The function `qc_filter` already looks for attributes in `self.qc`
qc-related attrs are now provided as attrs to self.qc which is an attr of self with the value of an empty object instance and therefore can take attrs of its own The qc checks now provide bool values to attrs of self.qc an error in the `qc_filter` function is also fixed where previously attr of self was removed instead of self.qc
add qc-attrs this qc attr as an empty object instance will now allow for further setting of qc-related attributes such as with: `object.__setattr__(self.qc,'qc_name',qc_flag_value)` qc-related attrs are now provided as attrs to self.qc which is an attr of self with the value of an empty object instance and therefore can take attrs of its own The qc checks now provide bool values to attrs of self.qc an error in the `qc_filter` function is also fixed where previously attr of self was removed instead of self.qc
This commit introduces significant enhancements to the `qc_filter` function in the `sonde.py` file. The function now accepts `filter_flags` as an optional parameter, which can be a string, a list, or None. This change provides greater flexibility in specifying which QC-related attributes should be checked. If `filter_flags` is None, all QC attributes will be checked. If it's a string, it's treated as a comma-separated list of individual flag values or prefixes of flag values. If it's a list, it's treated as a list of individual flag values or prefixes of flag values. The function now also supports the 'all_except_<prefix>' syntax in `filter_flags`. This allows all flags to be filtered except those starting with '<prefix>'. If 'all_except_<prefix>' is provided, it should be the only value in `filter_flags`. The function raises a ValueError if a flag in `filter_flags` does not exist as an attribute of the sonde object, or if 'all_except_<prefix>' is provided in `filter_flags` along with other values. This commit thus makes it possible for the user to customize which QC flags will be used for filtering out before L2 and the remaining that will be propagated into L2 with their flag values.
add default value to filter_flags (#64)
The new_dict variable is now initialized inside the loop that iterates over the functions. This change ensures that for each function, a fresh new_dict is created. Previously, the new_dict was being populated across all functions, which could lead to incorrect results if a function modifies an existing key-value pair. Now, each function gets a clean slate (an empty dictionary), preventing potential key-value pair overwrites.
The config file will supply all as str, so such a function will be useful For example, this commit also modifies the Sonde class to import helper and use this new function to check for the value of the skip argument by first converting the config provided value to bool.
add skip param to bypass QC checks
This name is more intuitive in meaning that the sonde will be filtered if QC fails. The style is also now consistent with the naming of the function `filter_no_launch_detect`.
This name is more intuitive in what the method does. It is also consistent with the attribute naming that the method uses.
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.
Solves #56