Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
SaQC
Manage
Activity
Members
Labels
Plan
Issues
36
Issue boards
Milestones
Wiki
Code
Merge requests
8
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
rdm-software
SaQC
Commits
7946bcfd
Commit
7946bcfd
authored
4 years ago
by
David Schäfer
Committed by
Bert Palm
4 years ago
Browse files
Options
Downloads
Patches
Plain Diff
added a selection of fuzzy function tests
parent
c90102b7
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!231
new Flagger and Stuff
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
test/funcs/test_functions_fuzzy.py
+97
-0
97 additions, 0 deletions
test/funcs/test_functions_fuzzy.py
with
97 additions
and
0 deletions
test/funcs/test_functions_fuzzy.py
0 → 100644
+
97
−
0
View file @
7946bcfd
#! /usr/bin/env python
# -*- coding: utf-8 -*-
from
saqc.core.register
import
FUNC_MAP
from
hypothesis
import
given
,
settings
from
hypothesis.strategies
import
(
data
,
)
from
test.common
import
MAX_EXAMPLES
,
functionKwargs
@settings
(
max_examples
=
MAX_EXAMPLES
,
deadline
=
None
)
@given
(
drawer
=
data
())
def
callWontBreak
(
drawer
,
func_name
:
str
):
func
=
FUNC_MAP
[
func_name
]
kwargs
=
drawer
.
draw
(
functionKwargs
(
func
))
func
(
**
kwargs
)
# breaks
# ------
# NOTE:
# needs a more alaborated test, as it calls into
# `changepoints.assignChangePointClusters`
# def test_breaks_flagJumps():
# callWontBreak("breaks.flagJumps")
# def test_breaks_flagIsolated():
# callWontBreak("breaks.flagIsolated")
def
test_breaks_flagMissing
():
callWontBreak
(
"
breaks.flagMissing
"
)
# constants
# ---------
def
test_constats_flagConstats
():
callWontBreak
(
"
constants.flagConstants
"
)
def
test_constants_flagByVariance
():
callWontBreak
(
"
constants.flagByVariance
"
)
# flagtools
# ---------
def
test_flagtools_clearFlags
():
callWontBreak
(
"
flagtools.clearFlags
"
)
def
test_flagtools_forceFlags
():
callWontBreak
(
"
flagtools.clearFlags
"
)
# NOTE:
# all of the following tests fail to sample data for `flag=typing.Any`
# with the new flagger in place this should be easy to fix
# def test_flagtools_flagGood():
# callWontBreak("flagtools.flagGood")
# def test_flagtools_flagUnflagged():
# callWontBreak("flagtools.flagUnflagged")
# def test_flagtools_flagManual():
# callWontBreak("flagtools.flagManual")
# outliers
# --------
# NOTE: needs a more elaborated test, I guess
# def test_outliers_flagByStray():
# callWontBreak("outliers.flagByStray")
# NOTE: fails in a strategy, maybe `Sequence[ColumnName]`
# def test_outliers_flagMVScores():
# callWontBreak("outliers.flagMVScores")
# NOTE:
# fails as certain combinations of frquency strings don't make sense
# a more elaborate test is needed
# def test_outliers_flagRaise():
# callWontBreak("outliers.flagRaise")
def
test_outliers_flagMAD
():
callWontBreak
(
"
outliers.flagMAD
"
)
def
test_outliers_flagByGrubbs
():
callWontBreak
(
"
outliers.flagByGrubbs
"
)
def
test_outliers_flagRange
():
callWontBreak
(
"
outliers.flagRange
"
)
# NOTE: fails in a strategy, maybe `Sequence[ColumnName]`
# def test_outliers_flagCrossStatistic():
# callWontBreak("outliers.flagCrossStatistic")
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment