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
955a8b73
Commit
955a8b73
authored
3 years ago
by
Peter Lünenschloß
Browse files
Options
Downloads
Patches
Plain Diff
added date-like check/removed test with list input
parent
a69778a0
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
,
!318
Included new input format in flag Manual
Pipeline
#46276
passed with stage
in 3 minutes and 21 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
saqc/funcs/flagtools.py
+14
-2
14 additions, 2 deletions
saqc/funcs/flagtools.py
tests/funcs/test_functions.py
+1
-1
1 addition, 1 deletion
tests/funcs/test_functions.py
with
15 additions
and
3 deletions
saqc/funcs/flagtools.py
+
14
−
2
View file @
955a8b73
...
@@ -3,6 +3,8 @@
...
@@ -3,6 +3,8 @@
from
typing
import
Any
,
Tuple
,
Union
from
typing
import
Any
,
Tuple
,
Union
from
typing_extensions
import
Literal
from
typing_extensions
import
Literal
import
pandas
as
pd
import
pandas
as
pd
from
dateutil.parser
import
ParserError
import
numpy
as
np
from
dios
import
DictOfSeries
from
dios
import
DictOfSeries
from
saqc.constants
import
BAD
,
UNFLAGGED
from
saqc.constants
import
BAD
,
UNFLAGGED
...
@@ -246,9 +248,19 @@ def flagManual(
...
@@ -246,9 +248,19 @@ def flagManual(
raise
ValueError
(
"
mdata has no index
"
)
raise
ValueError
(
"
mdata has no index
"
)
# check, if intervals where passed in format (index:start-time, data:end-time)
# check, if intervals where passed in format (index:start-time, data:end-time)
if
isinstance
(
mdata
.
iloc
[
0
],
(
pd
.
Timestamp
,
str
)):
try
:
pd
.
to_datetime
(
mdata
)
except
ParserError
:
dtlike
=
False
else
:
if
mdata
.
astype
(
str
).
map
(
str
.
isnumeric
).
any
():
dtlike
=
False
else
:
dtlike
=
True
if
dtlike
:
mdata
=
pd
.
Series
(
mdata
=
pd
.
Series
(
0
,
index
=
mdata
.
index
.
join
(
pd
.
DatetimeIndex
(
mdata
),
how
=
"
outer
"
)
np
.
nan
,
index
=
mdata
.
index
.
join
(
pd
.
DatetimeIndex
(
mdata
),
how
=
"
outer
"
)
)
)
mdata
[::
2
]
=
mflag
mdata
[::
2
]
=
mflag
...
...
This diff is collapsed.
Click to expand it.
tests/funcs/test_functions.py
+
1
−
1
View file @
955a8b73
...
@@ -202,7 +202,7 @@ def test_flagManual(data, field):
...
@@ -202,7 +202,7 @@ def test_flagManual(data, field):
kwargs_list
=
[
kwargs_list
=
[
dict
(
mdata
=
mdata
,
mflag
=
"
a
"
,
method
=
"
plain
"
,
flag
=
BAD
),
dict
(
mdata
=
mdata
,
mflag
=
"
a
"
,
method
=
"
plain
"
,
flag
=
BAD
),
dict
(
mdata
=
mdata
.
to_list
(),
mflag
=
"
a
"
,
method
=
"
plain
"
,
flag
=
BAD
),
#
dict(mdata=mdata.to_list(), mflag="a", method="plain", flag=BAD),
dict
(
mdata
=
mdata
,
mflag
=
"
a
"
,
method
=
"
ontime
"
,
flag
=
BAD
),
dict
(
mdata
=
mdata
,
mflag
=
"
a
"
,
method
=
"
ontime
"
,
flag
=
BAD
),
dict
(
mdata
=
shrinked
,
mflag
=
"
a
"
,
method
=
"
ontime
"
,
flag
=
BAD
),
dict
(
mdata
=
shrinked
,
mflag
=
"
a
"
,
method
=
"
ontime
"
,
flag
=
BAD
),
]
]
...
...
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