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
c25db9d1
Commit
c25db9d1
authored
4 years ago
by
Peter Lünenschloß
Browse files
Options
Downloads
Patches
Plain Diff
renamed inclusive selection parameter to include bounds
parent
2a89ec1d
No related branches found
Branches containing commit
No related tags found
Tags containing commit
3 merge requests
!193
Release 1.4
,
!188
Release 1.4
,
!85
Seasonal and custom data masking
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
saqc/lib/tools.py
+6
-6
6 additions, 6 deletions
saqc/lib/tools.py
with
6 additions
and
6 deletions
saqc/lib/tools.py
+
6
−
6
View file @
c25db9d1
...
...
@@ -199,7 +199,7 @@ def flagWindow(flagger_old, flagger_new, field, direction="fw", window=0, **kwar
return
flagger_new
.
setFlags
(
field
,
fmask
,
**
kwargs
)
def
seasonalMask
(
dtindex
,
season_start
,
season_end
,
inclu
sive_selection
):
def
seasonalMask
(
dtindex
,
season_start
,
season_end
,
inclu
de_bounds
):
"""
This function generates date-periodic/seasonal masks from an index passed.
...
...
@@ -219,7 +219,7 @@ def seasonalMask(dtindex, season_start, season_end, inclusive_selection):
String denoting starting point of every period. Formally, it has to be a truncated instance of
"
mm-ddTHH:MM:SS
"
.
Has to be of same length as `season_end` parameter.
See examples section below for some examples.
inclu
sive_selection
: {
"
mask
"
,
"
season
"
}
inclu
de_bounds
: {
"
mask
"
,
"
season
"
}
-
"
mask
"
: the `season_start` and `season_end` keywords inclusivly frame the mask (INCLUDING INTERVAL BOUNDS)
-
"
season
"
: the `season_start` and `season_end` keywords inclusivly frame the season
(INCLUDING INTERVAL BOUNDS)
...
...
@@ -284,13 +284,13 @@ def seasonalMask(dtindex, season_start, season_end, inclusive_selection):
return
_replace
selectors
=
{
"
mask
"
:
False
,
"
season
"
:
True
}
if
inclu
sive_selection
not
in
selectors
:
if
inclu
de_bounds
not
in
selectors
:
raise
ValueError
(
f
"
invalid value
'
{
inclu
sive_selection
}
'
was passed to
"
f
"
invalid value
'
{
inclu
de_bounds
}
'
was passed to
"
f
"
parameter
'
inclusive_selection
'
. Please select from
"
f
"
{
list
(
inclu
sive_selection
.
keys
())
}
.
"
f
"
{
list
(
inclu
de_bounds
.
keys
())
}
.
"
)
base_bool
=
selectors
[
inclu
sive_selection
]
base_bool
=
selectors
[
inclu
de_bounds
]
mask
=
pd
.
Series
(
base_bool
,
index
=
dtindex
)
start_replacer
=
_replaceBuilder
(
season_start
)
...
...
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