Modularization of the test functions
This Merge Request is rather large, I therefore like to see two approvals. I won't assign anyone personally, because I guess, the review work is best split. I think it would be beneficial, if:
-
@palmb could review the general architecture, so basically the changes in
saqc.core
. The design is not particularly beautiful, maybe I missed something. -
@luenensc could review the changes to
saqc.funcs
. I mainly added type hints there, but also made a few changes, when I or the type checker saw fit.
SaQC
.
This Merge Request incorporates all changes made in !205 (closed), and therefor should be merged after !205 (closed)
Summary
The basic architecture is rather simplistic and is based on a lot of repetition. Not ideal, I know, but this was the only way, I could figure out, to get code completions in rather simplistic editing environments working. With the release of Python 3.10 (especially this feature and it's likely backport) in october, we should be able to remove the duplication of function signatures again.
Changes
- There is a new
core
submodule namedmodules
- Within
saqc.core.modules
, there is a new file for every file insaqc.funcs
:- Each file defines exactly one class, which itself defines a method for every registered function from respective module in
saqc.funcs
- Most of the original signature is copy'n'pasted, but
data
andflagger
are removed
- Each file defines exactly one class, which itself defines a method for every registered function from respective module in
- All modules mentioned above inherit from a common
ModuleBase
class defined insaqc.core.modules.base
, which mainly takes care of the redirection of function calls - The class
FuncModules
insaqc.core.modules.__init__
stitches all test function modules together. Its main purpose is to not cluttersaqc.core.core.SaQC
by too many repetitive attribute assignments - While I were at it, I added type hints to all registered functions in
saqc.funcs
. Seperating this into multiple MRs would have been the nicer approach, but I wanted to get modularization done, without further delays