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
70a1f4d6
Commit
70a1f4d6
authored
1 year ago
by
Peter Lünenschloß
Browse files
Options
Downloads
Patches
Plain Diff
Yscope
parent
be7dab95
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!799
Yscope
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
CHANGELOG.md
+1
-0
1 addition, 0 deletions
CHANGELOG.md
saqc/funcs/tools.py
+16
-1
16 additions, 1 deletion
saqc/funcs/tools.py
saqc/lib/plotting.py
+2
-2
2 additions, 2 deletions
saqc/lib/plotting.py
tests/funcs/test_tools.py
+7
-2
7 additions, 2 deletions
tests/funcs/test_tools.py
with
26 additions
and
5 deletions
CHANGELOG.md
+
1
−
0
View file @
70a1f4d6
...
...
@@ -14,6 +14,7 @@ SPDX-License-Identifier: GPL-3.0-or-later
-
`SaQC`
: support for selection, slicing and setting of items by use of subscription on SaQC objects (e.g.
`qc[key]`
and
`qc[key] = value`
).
Selection works with single keys, collections of keys and string slices (e.g.
`qc["a":"f"]`
). Values can be SaQC objects, pd.Series,
Iterable of Series and dict-like with series values.
-
`plot`
: added
`yscope`
keyword
-
`setFlags`
: function to replace
`flagManual`
### Changed
### Removed
...
...
This diff is collapsed.
Click to expand it.
saqc/funcs/tools.py
+
16
−
1
View file @
70a1f4d6
...
...
@@ -211,7 +211,8 @@ class ToolsMixin:
max_gap
:
str
|
None
=
None
,
mode
:
Literal
[
"
subplots
"
,
"
oneplot
"
]
|
str
=
"
oneplot
"
,
history
:
Literal
[
"
valid
"
,
"
complete
"
]
|
list
[
str
]
|
None
=
"
valid
"
,
xscope
:
slice
|
None
=
None
,
xscope
:
slice
|
str
|
None
=
None
,
yscope
:
tuple
|
list
[
tuple
]
|
dict
=
None
,
store_kwargs
:
dict
|
None
=
None
,
ax
:
mpl
.
axes
.
Axes
|
None
=
None
,
ax_kwargs
:
dict
|
None
=
None
,
...
...
@@ -266,6 +267,11 @@ class ToolsMixin:
Determine a chunk of the data to be plotted. ``xscope`` can be anything,
that is a valid argument to the ``pandas.Series.__getitem__`` method.
yscope :
Either a tuple of 2 scalars that determines all plots
'
y-view limits, or a list of those
tuples, determining the different variables y-view limits (must match number of variables)
or a dictionary with variables as keys and the y-view tuple as values.
ax :
If not ``None``, plot into the given ``matplotlib.Axes`` instance, instead of a
newly created ``matplotlib.Figure``. This option offers a possibility to integrate
...
...
@@ -366,6 +372,15 @@ class ToolsMixin:
marker_kwargs
=
marker_kwargs
or
{}
plot_kwargs
=
plot_kwargs
or
{}
if
(
(
yscope
is
not
None
)
and
(
len
(
yscope
)
==
2
)
and
not
isinstance
(
yscope
[
0
],
(
list
,
tuple
))
):
yscope
=
tuple
(
yscope
)
ax_kwargs
.
update
({
"
ylim
"
:
yscope
})
if
not
path
:
mpl
.
use
(
_MPL_DEFAULT_BACKEND
)
else
:
...
...
This diff is collapsed.
Click to expand it.
saqc/lib/plotting.py
+
2
−
2
View file @
70a1f4d6
...
...
@@ -250,7 +250,7 @@ def makeFig(
mode
,
)
# readability formattin fo the x-tick labels:
# readability formattin fo
r
the x-tick labels:
fig
.
autofmt_xdate
()
return
fig
...
...
@@ -278,7 +278,7 @@ def _instantiateAxesContext(
next
(
_scatter_kwargs
[
"
marker
"
])
# assign variable specific labels/titles
for
axis_spec
in
[
"
xlabel
"
,
"
ylabel
"
,
"
title
"
]:
for
axis_spec
in
[
"
xlabel
"
,
"
ylabel
"
,
"
title
"
,
"
ylim
"
]:
spec
=
_ax_kwargs
.
get
(
axis_spec
,
None
)
if
isinstance
(
spec
,
list
):
_ax_kwargs
[
axis_spec
]
=
spec
[
var_num
]
...
...
This diff is collapsed.
Click to expand it.
tests/funcs/test_tools.py
+
7
−
2
View file @
70a1f4d6
...
...
@@ -32,10 +32,15 @@ def test_makeFig(tmp_path):
outfile
=
str
(
Path
(
tmp_path
,
"
test.png
"
))
# the filesystem's temp dir
d_saqc
=
d_saqc
.
plot
(
field
=
"
data
"
,
path
=
outfile
)
d_saqc
=
d_saqc
.
plot
(
field
=
"
data
"
,
path
=
outfile
,
history
=
"
valid
"
,
stats
=
True
)
d_saqc
=
d_saqc
.
plot
(
field
=
"
data
"
,
path
=
outfile
,
history
=
"
valid
"
,
yscope
=
[(
-
50
,
1000
)]
)
with
pytest
.
deprecated_call
():
d_saqc
=
d_saqc
.
plot
(
field
=
"
data
"
,
path
=
outfile
,
history
=
"
complete
"
)
d_saqc
=
d_saqc
.
plot
(
field
=
"
data
"
,
path
=
outfile
,
ax_kwargs
=
{
"
ylabel
"
:
"
data is data
"
},
stats
=
True
field
=
"
data
"
,
path
=
outfile
,
ax_kwargs
=
{
"
ylabel
"
:
"
data is data
"
},
yscope
=
(
100
,
150
),
)
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