Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update url argument name to host #180

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions omicron/segments.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,13 +145,13 @@ def write_segments(segmentlist, outfile, coltype=int):


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


Expand Down Expand Up @@ -287,26 +287,26 @@ def segmentlist_from_tree(tree, coalesce=False):
return segs


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


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


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


Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ python_requires = >=3.10
install_requires =
dqsegdb2 >= 1.2.0
gwdatafind
gwpy >= 2.0.0
gwpy >= 3.0.10
h5py
htcondor
igwn-auth-utils[requests] >=0.2.0
Expand Down
Loading