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
f7be0d54
Commit
f7be0d54
authored
4 years ago
by
Bert Palm
🎇
Browse files
Options
Downloads
Patches
Plain Diff
pretty print bt. better comments
parent
e45c2689
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!218
Flags
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
saqc/flagger/backtrack.py
+19
-6
19 additions, 6 deletions
saqc/flagger/backtrack.py
with
19 additions
and
6 deletions
saqc/flagger/backtrack.py
+
19
−
6
View file @
f7be0d54
...
...
@@ -154,7 +154,6 @@ class Backtrack:
# we dont care about force on first insert
if
self
.
empty
:
assert
nr
==
0
self
.
mask
[
nr
]
=
pd
.
Series
(
True
,
index
=
s
.
index
,
dtype
=
bool
)
...
...
@@ -184,7 +183,10 @@ class Backtrack:
match the index of the BT.
force : bool, default False
if True the internal mask is updated accordingly
if True the internal mask is updated in a way that the currently
set value (series values) will be returned if ``Backtrack.max()``
is called. This apply for all valid values (not ``np.Nan`` and
not ``-np.inf``).
Raises
------
...
...
@@ -227,7 +229,8 @@ class Backtrack:
Returns
-------
Backtrack: squeezed backtrack
Backtrack
squeezed backtrack
"""
if
n
<=
1
:
return
self
...
...
@@ -251,6 +254,9 @@ class Backtrack:
s
=
bt
[
mask
].
max
(
axis
=
1
)
# slice self down
# this may leave us in an unstable state, because
# the last column may not is entirely True, but
# the following append, will fix this
self
.
bt
=
self
.
bt
.
iloc
[:,
:
-
n
]
self
.
mask
=
self
.
mask
.
iloc
[:,
:
-
n
]
...
...
@@ -292,10 +298,17 @@ class Backtrack:
return
len
(
self
.
bt
.
columns
)
def
__repr__
(
self
):
return
self
.
bt
.
__repr__
()
def
__str__
(
self
):
return
self
.
bt
.
__str__
()
if
self
.
empty
:
return
str
(
self
.
bt
).
replace
(
'
DataFrame
'
,
'
Backtrack
'
)
repr
=
self
.
bt
.
astype
(
str
)
m
=
self
.
mask
repr
[
m
]
=
'
'
+
repr
[
m
]
+
'
'
repr
[
~
m
]
=
'
(
'
+
repr
[
~
m
]
+
'
)
'
return
str
(
repr
)[
1
:]
# --------------------------------------------------------------------------------
# validation
...
...
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