xclim.core.missing
should be refactored to use a functional programming approach
#2000
Open
1 of 2 tasks
Labels
enhancement
New feature or request
help wanted
Extra attention is needed
priority
Immediate priority
Milestone
Addressing a Problem?
The
xclim.core.missing
submodule currently contains several classes and subclasses that are being used to provide functions with shared behaviours, thanks to class inheritance. In practice, this means that aMissingBase
can be used to provide a set of common behaviours, which are then used for different types ofMissing
checks, whose docstrings and methods are used in order to build:missing_any()
missing_wmo()
missing_pct()
at_least_n_valid()
missing_from_context()
There are a few issues with this approach:
super().__init__()
) as in most cases, this isn't needed.**kwargs
for some; some variables listed but not used, etc.).I can't say for certain, but initializing a bunch of classes and subclasses to mimic a functional programming approach is probably more computationally taxing than adopting a strict functional programming approach.
Potential Solution
This module could use a full refactoring to adopt functional approaches.
Additional context
Issue raised from work done in #1988.
Contribution
Code of Conduct
The text was updated successfully, but these errors were encountered: