Skip to content
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

118 improve filtering #135

Merged
merged 12 commits into from
May 24, 2024
Merged

118 improve filtering #135

merged 12 commits into from
May 24, 2024

Conversation

alexdanjou
Copy link
Contributor

@alexdanjou alexdanjou commented May 20, 2024

  • Summary of changes
    Allow to put filters as dictionnary in .ini (with the sites as keys).

  • Please check if the PR fulfills these requirements

  • Closes 118
  • [] Tests added and passing : new tests have been added and pass, but old ones (not related to the changes made) don't.
  • [] Documentation and tutorials updated/added
  • Added an entry to the CHANGELOG.md file
  • Added any new requirements to requirements.txt

@alexdanjou alexdanjou linked an issue May 20, 2024 that may be closed by this pull request
3 tasks
Copy link
Contributor

@hdelongueville hdelongueville left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you have an example on how to use this new option?

@alexdanjou alexdanjou marked this pull request as draft May 22, 2024 10:27
- `isinstance(x, y)` is preferred to `type(x) is y`
- don't need to manage memory or use temp variables to reuse variable name
@brendan-m-murphy brendan-m-murphy marked this pull request as ready for review May 22, 2024 13:16
Copy link
Contributor

@hdelongueville hdelongueville left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When using
filters = {"CMN": None, "JFJ": None, "MHD": ["pblh_inlet_diff", "pblh_min"], "TAC": ["pblh_inlet_diff", "pblh_min"]}
I get the error
File "/user/home/qq24644/openghg_inversions/openghg_inversions/utils.py", line 471, in filtering
datasets[site] = filtering_functions[filt](datasets[site], site, keep_missing=keep_missing)
~~~~~~~~~~~~~~~~~~~^^^^^^
KeyError: None

@hdelongueville hdelongueville self-requested a review May 22, 2024 17:43
@brendan-m-murphy brendan-m-murphy merged commit fdd83fc into devel May 24, 2024
3 checks passed
@brendan-m-murphy brendan-m-murphy deleted the 118-improve-filtering branch May 24, 2024 10:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve filtering
3 participants