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
4e728f61
Commit
4e728f61
authored
5 years ago
by
David Schäfer
Browse files
Options
Downloads
Patches
Plain Diff
changed default nan plotting, as this might lead to really messy plots
parent
7905c763
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
saqc/__main__.py
+45
-0
45 additions, 0 deletions
saqc/__main__.py
saqc/lib/plotting.py
+1
-1
1 addition, 1 deletion
saqc/lib/plotting.py
with
46 additions
and
1 deletion
saqc/__main__.py
0 → 100644
+
45
−
0
View file @
4e728f61
#! /usr/bin/env python
# -*- coding: utf-8 -*-
import
click
import
numpy
as
np
import
pandas
as
pd
from
saqc.core
import
runner
from
saqc.flagger
import
CategoricalFlagger
FLAGGERS
=
{
"
number
"
:
CategoricalFlagger
([
-
1
,
0
,
1
]),
"
string
"
:
CategoricalFlagger
([
"
NIL
"
,
"
OK
"
,
"
BAD
"
])
}
@click.command
()
@click.option
(
"
-c
"
,
"
--config
"
,
type
=
click
.
Path
(
exists
=
True
),
required
=
True
,
help
=
"
path to the configuration file
"
)
@click.option
(
"
-d
"
,
"
--data
"
,
type
=
click
.
Path
(
exists
=
True
),
required
=
True
,
help
=
"
path to the data file
"
)
@click.option
(
"
--flagger
"
,
default
=
"
string
"
,
type
=
click
.
Choice
(
FLAGGERS
.
keys
()),
help
=
"
the flagging scheme to use
"
)
@click.option
(
"
--fail/--no-fail
"
,
default
=
True
,
help
=
"
whether to stop the program run on errors
"
)
@click.option
(
"
--nodata
"
,
default
=
np
.
nan
,
help
=
"
the nodata value
"
)
@click.option
(
"
--plot/--noplot
"
,
default
=
False
,
help
=
"
whether to plot the results
"
)
def
main
(
config
,
data
,
flagger
,
fail
,
nodata
,
plot
):
data
=
pd
.
read_csv
(
data
,
index_col
=
0
,
parse_dates
=
True
,
)
data
,
flagger
=
runner
(
config_file
=
config
,
flagger
=
FLAGGERS
[
flagger
],
data
=
data
,
nodata
=
nodata
,
error_policy
=
"
raise
"
if
fail
else
"
warn
"
)
# TODO: write file
flags
=
flagger
.
getFlags
()
if
__name__
==
"
__main__
"
:
main
()
This diff is collapsed.
Click to expand it.
saqc/lib/plotting.py
+
1
−
1
View file @
4e728f61
...
...
@@ -16,7 +16,7 @@ def plotAllHook(data, flagger):
_plot
(
data
,
flagger
,
True
,
__plotvars
)
def
plotHook
(
data
,
old
,
new
,
varname
,
do_plot
,
flag_test
,
plot_nans
=
Tru
e
):
def
plotHook
(
data
,
old
,
new
,
varname
,
do_plot
,
flag_test
,
plot_nans
=
Fals
e
):
# old/new: flagger
if
do_plot
:
__plotvars
.
append
(
varname
)
...
...
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