-
Notifications
You must be signed in to change notification settings - Fork 0
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
Refactor filtering again: this time make subclasses of Filter
with filter_records(...)
methods
#315
Conversation
These subclasses can separately apply the filter to data
Don't build the filtering algorithm into the `MicrocalDataSet` but into the `FilterATS` or `Filter5Lag` class instead. Fixes #314.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few small edit requests.
return self.convolution_lags == 1 and self.dt_values is not None | ||
return False | ||
|
||
@property |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we supposed to never make an object of type Filter
? In that case consider naming is BaseFilter
and def __init__(self, ...): raise Error
? Move the error as early as possible.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right. And...it turns out there's a package and a special decorator to enforce this. I'll use that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And it did exist already in Python 3.9, so we are safe to use it.
Revised following @ggggggggg's suggestions in this review. |
This removes filtering algorithms from the
MicrocalDataSet
into thefilter_records(...)
methods of the various subclasses ofFilter
. In so doing, manyif
branches are removed (or at least, they are hidden from the user).Fixes #314.