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

Simplify filters to avoid duplication #109

Closed
dalonsoa opened this issue Aug 3, 2023 · 1 comment
Closed

Simplify filters to avoid duplication #109

dalonsoa opened this issue Aug 3, 2023 · 1 comment

Comments

@dalonsoa
Copy link
Collaborator

dalonsoa commented Aug 3, 2023

          These filters are identical to the daily filters and the monthly filters. If they need to be defined on an app basis, I would suggest to:
  1. Create utilities/filters.py and put all this filters within JournalFilter and JournalFilterDepth classes.
  2. In this file and the corresponding ones in the daily and monthly apps, subclass them:
from utilities.filters import JournalFilter, JournalFilterDepth
class HourlyFilter(JournalFilter):
    """
    Filter class for hourlys that are not Polar Wind, Discharge Curve, or Level Function
    and that have no depth information.
    """

class HourlyFilterDepth(JournalFilterDepth):
    """
    Filter class for hourlys that are not Polar Wind, Discharge Curve, or Level Function
    and that have depth information.
    """

However, if they do not need to be defined on an app basis, just skip step 2 altogether and directly import the JournalFilter and JournalFilterDepth where relevant. The more code we write, the harder it is to maintain, so let's keep it to a minimum.

Originally posted by @dalonsoa in #103 (comment)

@dalonsoa
Copy link
Collaborator Author

No longer relevant.

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

No branches or pull requests

1 participant