Skip to content

core refactorings to prepare modularization

David Schäfer requested to merge corerefactorings into develop

During work at the modularization of our tests (aka saqc.module_name() -> saqc.module.name()) I had to make a few core adjustments. Some to make things work out, some more for the aesthetics. There are likely more to come and I will provide a more in detail explanation with removal of the WIP status.

Summary

This Merge Request incorporates a few modifications to the core. The most important change is the restructuring of the way, test functions and their arguments are stored and handled within SaQC:

  • During @registeration all test function get wrapped into a new class SaQCFunction. This class stores (like a functools.partial) all (default-)arguments to pass to the underlying function upon evaluation and all function related metadata (currently only name and the necessary masking behavior)
  • All arguments necessary to select data from data and flagger (currently field, target and regex) are stored in a class Locator
  • All arguments controlling the evaluation behavior are stored in a class APIController (currently masking (transferred from SaQCFunction), plot and to_mask). There is one subclass of APIController, the ConfigController that takes care of additional debug information only necessary when running SaQC through a dedicated config file.

All the above classe are currently located in a new core module called funcs.py (maybe not the best name). The deconstruction of test function arguments into the respective classes is still done in saqc.core.core.SaQC._wrap.inner.

Are these changes strictly necessary? No, they aren't. But the clear the path to the upcoming modularization and bring some structure in our currently unstructured mess of arguments storage (we even called it func_dump...)

Edited by David Schäfer

Merge request reports

Loading