Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • SaQC SaQC
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 37
    • Issues 37
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 14
    • Merge requests 14
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • rdm-software
  • SaQCSaQC
  • Merge requests
  • !607

Support function call groups

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged David Schäfer requested to merge logicals into develop Jan 20, 2023
  • Overview 14
  • Commits 7
  • Pipelines 6
  • Changes 3

While thinking about #390 (closed) as another solution to #382 (closed) I came up with the idea, that functions to aggregate flags from several SaQC would likely solve most of the needed behavior. This MR implements a first limited version of and and or merging of flags from different SaQC objects. With this, we are able to do grouping like behavior like:

qc = SaQC(data)

qc = qc.logicalAnd(
    "a",
    qcs=[
        qc.flagRange("a", min=10, max=100),
        qc.flagConstants("a", thresh=0.001, window="24h"),
        qc.flagGeneric(["a", "b"], target="a", func=lambda a, b: a > b),
    ],
)

Currently we have the limitation, that the methods only work on the given field. That means, that in the given example a needs to be present in all objects in qcs and we don't allow to logically combine flags from different variables. For the moment, I think this is acceptable, but the necessity might arise. If so one solution would be to type qcs: Sequence[SaQC] | dict[SaQC, str] and provide the fields to merge as the dictionary values (e.g. qcs={qc1: "a", qc2: "b", qc3: "a"}

Edited Jan 20, 2023 by David Schäfer
Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: logicals