Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
GraceDB Server
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Michael William Coughlin
GraceDB Server
Commits
d7abec11
Commit
d7abec11
authored
6 years ago
by
Tanner Prestegard
Committed by
GraceDB
6 years ago
Browse files
Options
Downloads
Patches
Plain Diff
adding ability to query events based on superevent-related parameters
parent
d600a3d2
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
gracedb/events/query.py
+21
-0
21 additions, 0 deletions
gracedb/events/query.py
with
21 additions
and
0 deletions
gracedb/events/query.py
+
21
−
0
View file @
d7abec11
...
...
@@ -16,6 +16,7 @@ from .nltime import nlTimeExpression as nltime_
nltime
=
nltime_
.
setParseAction
(
lambda
toks
:
toks
[
"
calculatedTime
"
])
from
.models
import
Group
,
Pipeline
,
Search
,
Label
from
.query_utils
import
maybeRange
,
getLabelQ
,
RUN_MAP
from
superevents.query
import
parse_superevent_id
,
superevent_expr
#import time, datetime
import
datetime
...
...
@@ -238,6 +239,25 @@ nifoQ.setParseAction(lambda toks: ("nevents", Q(nevents=toks[0])))
ifoQ
=
ifoListQ
|
nifoQ
# Superevent queries ---------------------------------------------------------
# Event is part of a superevent?
t_or_f
=
Or
([
CaselessLiteral
(
b
)
for
b
in
[
'
true
'
,
'
false
'
]])
inSupereventQ
=
Suppress
(
Keyword
(
"
in_superevent:
"
))
+
t_or_f
inSupereventQ
=
inSupereventQ
.
setParseAction
(
lambda
toks
:
(
"
in_superevent
"
,
Q
(
superevent__isnull
=
(
toks
[
0
]
==
"
false
"
))))
# Event is preferred for some superevent?
isPreferredEventQ
=
Suppress
(
Keyword
(
"
is_preferred_event:
"
))
+
t_or_f
isPreferredEventQ
=
isPreferredEventQ
.
setParseAction
(
lambda
toks
:
(
"
is_preferred_event
"
,
Q
(
superevent_preferred_for__isnull
=
(
toks
[
0
]
==
"
false
"
))))
# Event is part of a specific superevent?
supereventQ
=
Suppress
(
Keyword
(
"
superevent:
"
))
+
superevent_expr
supereventQ
.
setParseAction
(
lambda
toks
:
parse_superevent_id
(
"
superevent
"
,
toks
,
filter_prefix
=
"
superevent
"
))
###########################
#andTheseTags = ["attr"]
...
...
@@ -292,6 +312,7 @@ def parseQuery(s):
# A parser for the non-label-related remainder of the query string.
q
=
(
ifoQ
|
hasfarQ
|
gidQ
|
hidQ
|
tidQ
|
eidQ
|
midQ
|
searchQ
|
pipelineQ
|
groupQ
|
gpsQ
|
createdQ
|
submitterQ
|
runQ
|
inSupereventQ
|
supereventQ
|
isPreferredEventQ
|
attributeQ
).
setName
(
"
query term
"
)
...
...
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