Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
SaQC
Manage
Activity
Members
Labels
Plan
Issues
35
Issue boards
Milestones
Wiki
Code
Merge requests
7
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
c6bda875
Commit
c6bda875
authored
3 years ago
by
Peter Lünenschloß
Browse files
Options
Downloads
Patches
Plain Diff
added explicit to_mask kwarg to plot func
parent
2c4db6eb
No related branches found
Branches containing commit
No related tags found
Tags containing commit
8 merge requests
!685
Release 2.4
,
!684
Release 2.4
,
!567
Release 2.2.1
,
!566
Release 2.2
,
!501
Release 2.1
,
!372
fix doctest snippets
,
!369
Current documentation
,
!317
History sensitive plots
Pipeline
#47155
failed with stage
Stage: test
in 1 minute and 41 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
saqc/core/modules/tools.py
+1
-0
1 addition, 0 deletions
saqc/core/modules/tools.py
saqc/funcs/tools.py
+10
-25
10 additions, 25 deletions
saqc/funcs/tools.py
saqc/lib/plotting.py
+2
-2
2 additions, 2 deletions
saqc/lib/plotting.py
with
13 additions
and
27 deletions
saqc/core/modules/tools.py
+
1
−
0
View file @
c6bda875
...
...
@@ -42,6 +42,7 @@ class Tools(ModuleBase):
xscope
:
Optional
[
slice
]
=
None
,
stats_dict
:
Optional
[
dict
]
=
None
,
store_kwargs
:
Optional
[
dict
]
=
None
,
to_mask
:
Optional
[
float
]
=
None
,
**
kwargs
,
)
->
saqc
.
SaQC
:
return
self
.
defer
(
"
plot
"
,
locals
())
This diff is collapsed.
Click to expand it.
saqc/funcs/tools.py
+
10
−
25
View file @
c6bda875
...
...
@@ -16,6 +16,7 @@ from saqc.lib.types import FreqString
from
saqc.core
import
processing
,
Flags
from
saqc.lib.tools
import
periodicMask
from
saqc.lib.plotting
import
makeFig
from
saqc.core.register
import
_maskData
_MPL_DEFAULT_BACKEND
=
mpl
.
get_backend
()
...
...
@@ -252,10 +253,11 @@ def plot(
path
:
Optional
[
str
]
=
None
,
max_gap
:
Optional
[
FreqString
]
=
None
,
stats
:
bool
=
False
,
history
:
Optional
[
Literal
[
"
valid
"
,
"
complete
"
]]
=
"
valid
"
,
history
:
Optional
[
Literal
[
"
valid
"
,
"
complete
"
,
"
clear
"
]]
=
"
valid
"
,
xscope
:
Optional
[
slice
]
=
None
,
stats_dict
:
Optional
[
dict
]
=
None
,
store_kwargs
:
Optional
[
dict
]
=
None
,
to_mask
:
Optional
[
float
]
=
None
,
**
kwargs
,
):
"""
...
...
@@ -298,34 +300,13 @@ def plot(
*
"
valid
"
- Only plot those flags, that do not get altered or
"
unflagged
"
by subsequent tests. Only list tests
in the legend, that actually contributed flags to the overall resault.
*
"
complete
"
- plot all the flags set and list all the tests ran on a variable. Suitable for debugging/tracking.
*
"
clear
"
- clear plot from all the flagged values
* None - just plot the resulting flags for one variable, without any historical meta information.
s
: slice or Offset, default None
xscope
: slice or Offset, default None
Parameter, that determines a chunk of the data to be plotted /
processed. `s` can be anything, that is a valid argument to the ``pandas.Series.__getitem__`` method.
ax_kwargs : dict, default None
ax_kwargs : dict, default None
Keyword arguments controlling plot generation. Will be passed on to the
``Matplotlib.axes.Axes.set()`` property batch setter for the axes showing the
data plot. The most relevant of those properties might be
"
ylabel
"
,
"
title
"
and in addition:
"
ylim
"
.
The
"
xlim
"
keyword can be passed a slice object with date offset entries to controll figure
scope.
fig_kwargs : dict, default None
Keyword arguments controlling figure generation. In interactive mode,
``None`` defaults to ``{
"
figsize
"
: (16, 9)}`` to ensure a proper figure size
in store-mode.
scatter_kwargs : dict, default None
Keyword arguments controlling the appearance of the dots, marking flagged values.
Dict just gets passed on to the matplotlib.pyplot.scatter method. Keywords of interest may be:
``
"
alpha
"
`` (transparancy), ``
"
marker
"
`` (marker appearance) and ``
"
s
"
`` (dot size).
The ``
"
marker
"
`` and ``
"
color
"
`` keywords can also be passed lists, that the plotting routine will then cycle
through.
store_kwargs : dict, default {}
Keywords to be passed on to the ``matplotlib.pyplot.savefig`` method, handling
the figure storing. To store an pickle object of the figure, use the option
...
...
@@ -363,6 +344,10 @@ def plot(
>>>
func
=
lambda
x
,
y
,
z
:
round
((
x
.
isna
().
sum
())
/
len
(
x
),
2
)
"""
interactive
=
path
is
None
level
=
kwargs
.
get
(
"
flag
"
,
BAD
)
if
to_mask
:
data
[
field
][
flags
[
field
]
>=
to_mask
]
=
np
.
nan
if
store_kwargs
is
None
:
store_kwargs
=
{}
...
...
@@ -377,7 +362,7 @@ def plot(
data
=
data
,
field
=
field
,
flags
=
flags
,
level
=
kwargs
.
get
(
"
flag
"
,
BAD
)
,
level
=
level
,
max_gap
=
max_gap
,
stats
=
stats
,
history
=
history
,
...
...
This diff is collapsed.
Click to expand it.
saqc/lib/plotting.py
+
2
−
2
View file @
c6bda875
...
...
@@ -23,8 +23,7 @@ STATSDICT = {
"
flagged percentage
"
:
lambda
x
,
y
,
z
:
round
(((
y
>=
z
).
sum
())
/
len
(
x
),
2
),
}
PLOT_KWARGS
=
{
"
alpha
"
:
0.8
,
"
linewidth
"
:
1
}
PLOT_KWARGS
=
{
"
alpha
"
:
0.8
,
"
linewidth
"
:
1
}
AX_KWARGS
=
{}
FIG_KWARGS
=
{
"
figsize
"
:
(
16
,
9
)}
SCATTER_KWARGS
=
{
...
...
@@ -36,6 +35,7 @@ SCATTER_KWARGS = {
"
s
"
:
70
,
}
def
makeFig
(
data
:
DiosLikeT
,
field
:
str
,
...
...
This diff is collapsed.
Click to expand it.
David Schäfer
@schaefed
mentioned in commit
63b55c6d
·
2 years ago
mentioned in commit
63b55c6d
mentioned in commit 63b55c6d7dadb0e612b23a897f292d5ffc14cb52
Toggle commit list
David Schäfer
@schaefed
mentioned in commit
684dc8a0
·
2 years ago
mentioned in commit
684dc8a0
mentioned in commit 684dc8a0515470d644fc85fee95d07661c8dd572
Toggle commit list
David Schäfer
@schaefed
mentioned in commit
8f7a90e4
·
1 year ago
mentioned in commit
8f7a90e4
mentioned in commit 8f7a90e4aed61c79a9dc8d67541a46beba0907e8
Toggle commit list
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