Skip to content

Commit b3bce67

Browse files
author
Evan Goetz
committed
Update url argument name to host
This PR updates the url argument name to host, following the changes in gwpy
1 parent aeacc89 commit b3bce67

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

omicron/segments.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -145,13 +145,13 @@ def write_segments(segmentlist, outfile, coltype=int):
145145

146146

147147
@integer_segments
148-
def query_state_segments(flag, start, end, url=DEFAULT_SEGMENT_SERVER,
148+
def query_state_segments(flag, start, end, host=DEFAULT_SEGMENT_SERVER,
149149
pad=(0, 0)):
150150
"""Query a segment database for active segments associated with a flag
151151
"""
152152
# NOTE: DQF.pad pads forward in time at end
153153
return DataQualityFlag.query(
154-
flag, start - pad[0], end + pad[1], url=url,
154+
flag, start - pad[0], end + pad[1], host=host,
155155
).coalesce().pad(pad[0], -pad[1]).active
156156

157157

@@ -287,26 +287,26 @@ def segmentlist_from_tree(tree, coalesce=False):
287287
return segs
288288

289289

290-
def get_flag_coverage(flag, url=DEFAULT_SEGMENT_SERVER):
290+
def get_flag_coverage(flag, host=DEFAULT_SEGMENT_SERVER):
291291
"""Return the coverage data for the given flag
292292
"""
293293
ifo, name, version = flag.rsplit(':', 2)
294-
flagu = '/dq/%s/%s/%s' % (ifo, name, version)
295-
raw = igwn_get('%s/report/coverage' % url)
294+
flagu = f'/dq/{ifo}/{name}/{version}'
295+
raw = igwn_get(f'{host}/report/coverage')
296296
return raw.json()['results'][flagu]
297297

298298

299-
def get_latest_active_gps(flag, url=DEFAULT_SEGMENT_SERVER):
299+
def get_latest_active_gps(flag, host=DEFAULT_SEGMENT_SERVER):
300300
"""Return the end time of the latest active segment for this flag
301301
"""
302-
# return get_flag_coverage(flag, url=url)['latest_active_segment']
302+
# return get_flag_coverage(flag, host=host)['latest_active_segment']
303303
raise NameError('get_latest_active_gps is no longer available')
304304

305305

306-
def get_latest_known_gps(flag, url=DEFAULT_SEGMENT_SERVER):
306+
def get_latest_known_gps(flag, host=DEFAULT_SEGMENT_SERVER):
307307
"""Return the end time of the latest known segment for this flag
308308
"""
309-
# return get_flag_coverage(flag, url=url)['latest_known_segment']
309+
# return get_flag_coverage(flag, host=host)['latest_known_segment']
310310
raise NameError('get_latest_known_gps is no longer available')
311311

312312

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ python_requires = >=3.10
6363
install_requires =
6464
dqsegdb2 >= 1.2.0
6565
gwdatafind
66-
gwpy >= 2.0.0
66+
gwpy >= 3.0.10
6767
h5py
6868
htcondor
6969
igwn-auth-utils[requests] >=0.2.0

0 commit comments

Comments
 (0)