diff --git a/bin/all_sky_search/pycbc_add_statmap b/bin/all_sky_search/pycbc_add_statmap index 18758627e56..7093a824973 100755 --- a/bin/all_sky_search/pycbc_add_statmap +++ b/bin/all_sky_search/pycbc_add_statmap @@ -3,11 +3,11 @@ with more than one ifo combination available. Cluster to keep foreground coincs with the highest stat value. """ +import igwn_segments as segments import numpy as np, argparse, logging, pycbc, pycbc.events, pycbc.io import pycbc.version import pycbc.conversions as conv from pycbc.events import coinc, significance -from ligo import segments import sys, copy def get_ifo_string(fi): diff --git a/bin/all_sky_search/pycbc_bin_trigger_rates_dq b/bin/all_sky_search/pycbc_bin_trigger_rates_dq index f1c6f0ed7fb..db2c22add95 100644 --- a/bin/all_sky_search/pycbc_bin_trigger_rates_dq +++ b/bin/all_sky_search/pycbc_bin_trigger_rates_dq @@ -7,7 +7,7 @@ import argparse import numpy as np import h5py as h5 -from ligo.segments import segmentlist +from igwn_segments import segmentlist import pycbc from pycbc.events import stat as pystat diff --git a/bin/all_sky_search/pycbc_calculate_psd b/bin/all_sky_search/pycbc_calculate_psd index bcfd3ab1676..74d95c98663 100755 --- a/bin/all_sky_search/pycbc_calculate_psd +++ b/bin/all_sky_search/pycbc_calculate_psd @@ -8,7 +8,7 @@ from pycbc.io import HFile from pycbc.pool import BroadcastPool as Pool from pycbc.fft.fftw import set_measure_level from pycbc.workflow import resolve_td_option -from ligo.segments import segmentlist, segment +from igwn_segments import segmentlist, segment set_measure_level(0) parser = argparse.ArgumentParser(description=__doc__) diff --git a/bin/all_sky_search/pycbc_coinc_findtrigs b/bin/all_sky_search/pycbc_coinc_findtrigs index 35628648db0..2a06064c26c 100644 --- a/bin/all_sky_search/pycbc_coinc_findtrigs +++ b/bin/all_sky_search/pycbc_coinc_findtrigs @@ -1,7 +1,7 @@ #!/usr/bin/env python import copy, argparse, logging, numpy, numpy.random import shutil, uuid, os.path, atexit -from ligo.segments import infinity +from igwn_segments import infinity import pycbc from pycbc.events import veto, coinc, stat, ranking, cuts from pycbc.io import HFile diff --git a/bin/all_sky_search/pycbc_coinc_hdfinjfind b/bin/all_sky_search/pycbc_coinc_hdfinjfind index 4a4f3229e8f..f3806b9c823 100755 --- a/bin/all_sky_search/pycbc_coinc_hdfinjfind +++ b/bin/all_sky_search/pycbc_coinc_hdfinjfind @@ -5,7 +5,7 @@ files. import argparse, logging, types, numpy, os.path from ligo.lw import lsctables, utils as ligolw_utils -from ligo import segments +import igwn_segments as segments import pycbc from pycbc import events, init_logging from pycbc.events import indices_within_segments diff --git a/bin/all_sky_search/pycbc_combine_statmap b/bin/all_sky_search/pycbc_combine_statmap index 825b164273d..4263532ad6a 100755 --- a/bin/all_sky_search/pycbc_combine_statmap +++ b/bin/all_sky_search/pycbc_combine_statmap @@ -5,7 +5,7 @@ significant foreground, but leaves the background triggers alone. """ import numpy, argparse, logging, pycbc, pycbc.events, pycbc.io, lal -from ligo import segments +import igwn_segments as segments parser = argparse.ArgumentParser() pycbc.add_common_pycbc_options(parser) diff --git a/bin/all_sky_search/pycbc_prepare_xml_for_gracedb b/bin/all_sky_search/pycbc_prepare_xml_for_gracedb index 617f7a39965..4a1dc1c6e97 100755 --- a/bin/all_sky_search/pycbc_prepare_xml_for_gracedb +++ b/bin/all_sky_search/pycbc_prepare_xml_for_gracedb @@ -31,7 +31,7 @@ import lal import lal.series from ligo.lw import lsctables from ligo.lw import utils as ligolw_utils -from ligo.segments import segment, segmentlist +from igwn_segments import segment, segmentlist import pycbc from pycbc.io import HFile diff --git a/bin/all_sky_search/pycbc_sngls_findtrigs b/bin/all_sky_search/pycbc_sngls_findtrigs index 066cec88d5f..53d7fb7fc9f 100644 --- a/bin/all_sky_search/pycbc_sngls_findtrigs +++ b/bin/all_sky_search/pycbc_sngls_findtrigs @@ -1,6 +1,6 @@ #!/usr/bin/env python import argparse, logging, h5py, numpy as np -from ligo.segments import infinity +from igwn_segments import infinity from numpy.random import seed, shuffle import pycbc diff --git a/bin/all_sky_search/pycbc_sngls_pastro b/bin/all_sky_search/pycbc_sngls_pastro index e26a09b0cc7..d40e5b0d392 100644 --- a/bin/all_sky_search/pycbc_sngls_pastro +++ b/bin/all_sky_search/pycbc_sngls_pastro @@ -16,7 +16,7 @@ from ligo.lw import lsctables, utils as ligolw_utils from pycbc import conversions as conv from pycbc.events import veto, stat, ranking, coinc, single as sngl from pycbc.io.ligolw import LIGOLWContentHandler -from ligo.segments import segment, segmentlist +from igwn_segments import segment, segmentlist import matplotlib matplotlib.use('agg') from matplotlib import pyplot as plt diff --git a/bin/live/pycbc_live_collate_triggers b/bin/live/pycbc_live_collate_triggers index f2dff317f3b..b38028ab346 100644 --- a/bin/live/pycbc_live_collate_triggers +++ b/bin/live/pycbc_live_collate_triggers @@ -23,7 +23,7 @@ import os import logging from datetime import datetime, timedelta -from ligo.segments import segmentlist, segment +from igwn_segments import segmentlist, segment import pycbc from pycbc.io import live as liveio diff --git a/bin/live/pycbc_live_combine_single_significance_fits b/bin/live/pycbc_live_combine_single_significance_fits index 1705056ebde..6d75c7a8a79 100644 --- a/bin/live/pycbc_live_combine_single_significance_fits +++ b/bin/live/pycbc_live_combine_single_significance_fits @@ -19,7 +19,7 @@ import argparse import logging import numpy as np -from ligo.segments import segment, segmentlist +from igwn_segments import segment, segmentlist import pycbc from pycbc.io.hdf import HFile diff --git a/bin/minifollowups/pycbc_upload_prep_minifollowup b/bin/minifollowups/pycbc_upload_prep_minifollowup index 737cd6e5130..79cfe78d42e 100644 --- a/bin/minifollowups/pycbc_upload_prep_minifollowup +++ b/bin/minifollowups/pycbc_upload_prep_minifollowup @@ -23,7 +23,7 @@ import logging import re import numpy as np -from ligo import segments +import igwn_segments as segments from pycbc import init_logging, add_common_pycbc_options import pycbc.workflow as wf diff --git a/bin/plotting/pycbc_page_ifar b/bin/plotting/pycbc_page_ifar index 851447507f4..9d95b27c227 100644 --- a/bin/plotting/pycbc_page_ifar +++ b/bin/plotting/pycbc_page_ifar @@ -23,7 +23,7 @@ import pylab import matplotlib as mpl mpl.use('Agg') -from ligo import segments +import igwn_segments as segments from pycbc import init_logging, add_common_pycbc_options import pycbc.results diff --git a/bin/plotting/pycbc_page_segtable b/bin/plotting/pycbc_page_segtable index 0d7b05b5cb3..e955b42cc85 100644 --- a/bin/plotting/pycbc_page_segtable +++ b/bin/plotting/pycbc_page_segtable @@ -23,7 +23,7 @@ import pycbc.results import sys import itertools -from ligo import segments +import igwn_segments as segments from pycbc.events.veto import get_segment_definer_comments from pycbc.results import save_fig_with_metadata diff --git a/bin/pycbc_gwosc_segment_query b/bin/pycbc_gwosc_segment_query index 0ac34512a33..b7d33e5a324 100644 --- a/bin/pycbc_gwosc_segment_query +++ b/bin/pycbc_gwosc_segment_query @@ -7,7 +7,7 @@ import argparse import shutil from urllib.request import urlopen -import ligo.segments +import igwn_segments import pycbc from pycbc.workflow import SegFile @@ -31,9 +31,9 @@ def query_gwosc(ifo, segment_name, gps_start_time, duration): Returns --------- - segment_list : ligo.segments.segmentlist + segment_list : igwn_segments.segmentlist The interval returned by GWOSC - segment_summary : ligo.segments.segmentlist + segment_summary : igwn_segments.segmentlist The segments returned by GWOSC """ @@ -44,11 +44,11 @@ def query_gwosc(ifo, segment_name, gps_start_time, duration): logging.info(response.info()) json_segment_data = json.loads(response.read()) - summary_segment = ligo.segments.segmentlist([ligo.segments.segment( + summary_segment = igwn_segments.segmentlist([igwn_segments.segment( json_segment_data['start'], json_segment_data['end'])]) - segments = ligo.segments.segmentlist([ligo.segments.segment( + segments = igwn_segments.segmentlist([igwn_segments.segment( x[0],x[1]) for x in json_segment_data['segments']]) return summary_segment, segments diff --git a/bin/pycbc_make_html_page b/bin/pycbc_make_html_page index 4b6d9c9e893..452663978c6 100644 --- a/bin/pycbc_make_html_page +++ b/bin/pycbc_make_html_page @@ -25,7 +25,7 @@ import zipfile import codecs from jinja2 import Environment, FileSystemLoader -from ligo import segments +import igwn_segments as segments import pycbc.results from pycbc.results.render import get_embedded_config, render_workflow_html_template, setup_template_render diff --git a/bin/pycbc_upload_xml_to_gracedb b/bin/pycbc_upload_xml_to_gracedb index 36fb2130e34..53554343c77 100755 --- a/bin/pycbc_upload_xml_to_gracedb +++ b/bin/pycbc_upload_xml_to_gracedb @@ -32,7 +32,7 @@ import lal import lal.series from ligo.lw import lsctables from ligo.lw import utils as ligolw_utils -from ligo.segments import segment, segmentlist +from igwn_segments import segment, segmentlist import pycbc from pycbc.io.gracedb import gracedb_tag_with_version diff --git a/bin/pygrb/pycbc_grb_inj_finder b/bin/pygrb/pycbc_grb_inj_finder index 05f6eebef51..32acf31c1e0 100644 --- a/bin/pygrb/pycbc_grb_inj_finder +++ b/bin/pygrb/pycbc_grb_inj_finder @@ -36,8 +36,8 @@ import h5py from gwdatafind.utils import filename_metadata -from ligo.segments import segmentlist -from ligo.segments.utils import fromsegwizard +from igwn_segments import segmentlist +from igwn_segments.utils import fromsegwizard from pycbc import add_common_pycbc_options, init_logging from pycbc.inject import InjectionSet diff --git a/bin/pygrb/pycbc_grb_trig_combiner b/bin/pygrb/pycbc_grb_trig_combiner index af2e5620cb9..92fb64a6299 100644 --- a/bin/pygrb/pycbc_grb_trig_combiner +++ b/bin/pygrb/pycbc_grb_trig_combiner @@ -32,8 +32,8 @@ import h5py from gwdatafind.utils import (file_segment, filename_metadata) -from ligo import segments -from ligo.segments.utils import fromsegwizard +import igwn_segments as segments +from igwn_segments.utils import fromsegwizard from pycbc import add_common_pycbc_options, init_logging from pycbc.results.pygrb_postprocessing_utils import template_hash_to_id diff --git a/bin/pygrb/pycbc_make_offline_grb_workflow b/bin/pygrb/pycbc_make_offline_grb_workflow index fb215eb6b92..df1300d10bf 100644 --- a/bin/pygrb/pycbc_make_offline_grb_workflow +++ b/bin/pygrb/pycbc_make_offline_grb_workflow @@ -27,7 +27,7 @@ import logging import matplotlib matplotlib.use('agg') -from ligo.segments import segment, segmentlistdict +from igwn_segments import segment, segmentlistdict from pycbc import init_logging, add_common_pycbc_options import pycbc.workflow as _workflow diff --git a/bin/workflows/pycbc_make_bank_verifier_workflow b/bin/workflows/pycbc_make_bank_verifier_workflow index 8f5b6808477..2364c9812ab 100644 --- a/bin/workflows/pycbc_make_bank_verifier_workflow +++ b/bin/workflows/pycbc_make_bank_verifier_workflow @@ -27,7 +27,7 @@ import os import argparse import shutil -from ligo import segments +import igwn_segments as segments from pycbc import add_common_pycbc_options, init_logging import pycbc.version diff --git a/bin/workflows/pycbc_make_inference_plots_workflow b/bin/workflows/pycbc_make_inference_plots_workflow index 5ce1e74dccf..f71ec2f4c77 100644 --- a/bin/workflows/pycbc_make_inference_plots_workflow +++ b/bin/workflows/pycbc_make_inference_plots_workflow @@ -30,7 +30,7 @@ import sys import shlex import numpy -from ligo import segments +import igwn_segments as segments from pycbc import results, init_logging, add_common_pycbc_options from pycbc.results import layout diff --git a/bin/workflows/pycbc_make_inference_workflow b/bin/workflows/pycbc_make_inference_workflow index 4806a6365e3..801df9a30e2 100644 --- a/bin/workflows/pycbc_make_inference_workflow +++ b/bin/workflows/pycbc_make_inference_workflow @@ -27,7 +27,7 @@ import socket import sys import numpy -from ligo import segments +import igwn_segments as segments import pycbc import pycbc.workflow.minifollowups as mini diff --git a/bin/workflows/pycbc_make_offline_search_workflow b/bin/workflows/pycbc_make_offline_search_workflow index 2d6a2aef729..462090374d2 100755 --- a/bin/workflows/pycbc_make_offline_search_workflow +++ b/bin/workflows/pycbc_make_offline_search_workflow @@ -33,8 +33,8 @@ import numpy import datetime import itertools +import igwn_segments as segments import lal -from ligo import segments import pycbc.events import pycbc.workflow as wf diff --git a/bin/workflows/pycbc_make_psd_estimation_workflow b/bin/workflows/pycbc_make_psd_estimation_workflow index 7a5dc74861a..3992a59ae7a 100644 --- a/bin/workflows/pycbc_make_psd_estimation_workflow +++ b/bin/workflows/pycbc_make_psd_estimation_workflow @@ -25,7 +25,7 @@ import logging import datetime import sys -from ligo import segments as _segments +import igwn_segments as _segments import lal import pycbc diff --git a/docs/workflow/datafind.rst b/docs/workflow/datafind.rst index b3e4d288ad2..017700e9547 100644 --- a/docs/workflow/datafind.rst +++ b/docs/workflow/datafind.rst @@ -34,7 +34,7 @@ Using this module requires a number of things * A configuration file (or files) containing the information needed to tell this module how to generate the segments (described below). * An initialized instance of the pycbc workflow class, containing the ConfigParser. -* An ifo-keyed dictionary of ligo.segments.segmentlist instances containing the times that should be analysed for each ifo. See :ref:`workflowsegmentsmod` for documentation of the segments module, which in most cases should be used to obtain this input. +* An ifo-keyed dictionary of igwn_segments.segmentlist instances containing the times that should be analysed for each ifo. See :ref:`workflowsegmentsmod` for documentation of the segments module, which in most cases should be used to obtain this input. ------------------------- Configuration file setup diff --git a/examples/workflow/dayhopecheck/dayhopecheck.py b/examples/workflow/dayhopecheck/dayhopecheck.py index 0ef31c0c89a..5a9c887634d 100755 --- a/examples/workflow/dayhopecheck/dayhopecheck.py +++ b/examples/workflow/dayhopecheck/dayhopecheck.py @@ -46,7 +46,7 @@ import os import logging import argparse -from ligo import segments +import igwn_segments as segments import pycbc.workflow as _workflow from ligo.lw import ligolw diff --git a/pycbc/dq.py b/pycbc/dq.py index 0cff913a157..acdb0031006 100644 --- a/pycbc/dq.py +++ b/pycbc/dq.py @@ -28,7 +28,7 @@ import logging import json import numpy -from ligo.segments import segmentlist, segment +from igwn_segments import segmentlist, segment from pycbc.frame.gwosc import get_run from pycbc.io import get_file @@ -152,7 +152,7 @@ def query_flag(ifo, segment_name, start_time, end_time, Returns --------- - segments: ligo.segments.segmentlist + segments: igwn_segments.segmentlist List of segments """ flag_segments = segmentlist([]) @@ -279,7 +279,7 @@ def query_cumulative_flags(ifo, segment_names, start_time, end_time, Returns --------- - segments: ligo.segments.segmentlist + segments: igwn_segments.segmentlist List of segments """ total_segs = segmentlist([]) diff --git a/pycbc/events/veto.py b/pycbc/events/veto.py index 9fe636e328f..c1f77d6f0a9 100644 --- a/pycbc/events/veto.py +++ b/pycbc/events/veto.py @@ -3,8 +3,8 @@ """ import logging import numpy +from igwn_segments import segment, segmentlist from ligo.lw import table, lsctables, utils as ligolw_utils -from ligo.segments import segment, segmentlist logger = logging.getLogger('pycbc.events.veto') diff --git a/pycbc/psd/__init__.py b/pycbc/psd/__init__.py index 99ef4bdb9a6..95e7f0fa9ae 100644 --- a/pycbc/psd/__init__.py +++ b/pycbc/psd/__init__.py @@ -15,7 +15,7 @@ # with this program; if not, write to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. import copy -from ligo import segments +import igwn_segments as segments from pycbc.psd.read import * from pycbc.psd.analytical import * from pycbc.psd.analytical_space import * diff --git a/pycbc/results/followup.py b/pycbc/results/followup.py index f55d50318a0..d1b4bacdeac 100644 --- a/pycbc/results/followup.py +++ b/pycbc/results/followup.py @@ -34,7 +34,7 @@ if 'matplotlib.backends' not in sys.modules: matplotlib.use('agg') import pylab, mpld3, mpld3.plugins -from ligo.segments import segment +from igwn_segments import segment from pycbc.io.hdf import HFile def columns_from_file_list(file_list, columns, ifo, start, end): diff --git a/pycbc/results/pygrb_plotting_utils.py b/pycbc/results/pygrb_plotting_utils.py index f6848b5b623..4441dc5de5b 100644 --- a/pycbc/results/pygrb_plotting_utils.py +++ b/pycbc/results/pygrb_plotting_utils.py @@ -25,7 +25,7 @@ import copy import numpy -from ligo import segments +import igwn_segments as segments from pycbc.results import save_fig_with_metadata diff --git a/pycbc/results/pygrb_postprocessing_utils.py b/pycbc/results/pygrb_postprocessing_utils.py index 4f36908d7b3..ef409408b77 100644 --- a/pycbc/results/pygrb_postprocessing_utils.py +++ b/pycbc/results/pygrb_postprocessing_utils.py @@ -28,10 +28,10 @@ import copy import numpy import h5py +import igwn_segments as segments from scipy import stats -from ligo import segments -from ligo.segments.utils import fromsegwizard +from igwn_segments.utils import fromsegwizard from pycbc.events.coherent import reweightedsnr_cut from pycbc.events import veto from pycbc import add_common_pycbc_options diff --git a/pycbc/workflow/coincidence.py b/pycbc/workflow/coincidence.py index fdaaa19859f..1e5f1072ef3 100644 --- a/pycbc/workflow/coincidence.py +++ b/pycbc/workflow/coincidence.py @@ -30,7 +30,7 @@ import os import logging -from ligo import segments +import igwn_segments as segments from pycbc.workflow.core import FileList, make_analysis_dir, Executable, Node, File diff --git a/pycbc/workflow/core.py b/pycbc/workflow/core.py index b3c4c8624f0..e491a7812c7 100644 --- a/pycbc/workflow/core.py +++ b/pycbc/workflow/core.py @@ -43,10 +43,10 @@ from itertools import combinations, groupby, permutations from operator import attrgetter +import igwn_segments as segments import lal import lal.utils import Pegasus.api # Try and move this into pegasus_workflow -from ligo import segments from ligo.lw import lsctables, ligolw from ligo.lw import utils as ligolw_utils from ligo.lw.utils import segments as ligolw_segments @@ -964,7 +964,7 @@ def new_output_file_opt(self, valid_seg, extension, option_name, tags=None, Parameters ----------- - valid_seg : ligo.segments.segment + valid_seg : igwn_segments.segment The time span over which the job is valid for. extension : string The extension to be used at the end of the filename. @@ -1122,7 +1122,7 @@ def __init__(self, ifos, exe_name, segs, file_url=None, exe_name: string A short description of the executable description, tagging only the program that ran this job. - segs : ligo.segments.segment or ligo.segments.segmentlist + segs : igwn_segments.segment or igwn_segments.segmentlist The time span that the OutFile is valid for. Note that this is *not* the same as the data that the job that made the file reads in. Lalapps_inspiral jobs do not analyse the first an last 72s of the @@ -1167,8 +1167,8 @@ def __init__(self, ifos, exe_name, segs, file_url=None, elif isinstance(segs, (segments.segmentlist)): self.segment_list = segs else: - err = "segs input must be either ligo.segments.segment or " - err += "segments.segmentlist. Got %s." %(str(type(segs)),) + err = "segs input must be either igwn_segments.segment or " + err += "igwn_segments.segmentlist. Got %s." %(str(type(segs)),) raise ValueError(err) if tags is None: tags = [] @@ -1440,7 +1440,7 @@ def find_outputs_in_range(self, ifo, current_segment, useSplitLists=False): ----------- ifo : string Name of the ifo (or ifos) that the File should correspond to - current_segment : ligo.segments.segment + current_segment : igwn_segments.segment The segment of time that files must intersect. Returns @@ -1741,7 +1741,7 @@ def __init__(self, ifo_list, description, valid_segment, See File.__init__ for a full set of documentation for how to call this class. The only thing unique and added to this class is the optional segment_dict. NOTE that while segment_dict is a - ligo.segments.segmentlistdict rather than the usual dict[ifo] + igwn_segments.segmentlistdict rather than the usual dict[ifo] we key by dict[ifo:name]. Parameters @@ -1750,10 +1750,10 @@ def __init__(self, ifo_list, description, valid_segment, See File.__init__ description : string (required) See File.__init__ - segment : ligo.segments.segment or ligo.segments.segmentlist + segment : igwn_segments.segment or igwn_segments.segmentlist See File.__init__ - segment_dict : ligo.segments.segmentlistdict (optional, default=None) - A ligo.segments.segmentlistdict covering the times covered by the + segment_dict : igwn_segments.segmentlistdict (optional, default=None) + A igwn_segments.segmentlistdict covering the times covered by the segmentlistdict associated with this file. Can be added by setting self.segment_dict after initializing an instance of the class. @@ -1776,13 +1776,13 @@ def from_segment_list(cls, description, segmentlist, name, ifo, ------------ description : string (required) See File.__init__ - segmentlist : ligo.segments.segmentslist + segmentlist : igwn_segments.segmentslist The segment list that will be stored in this file. name : str The name of the segment lists to be stored in the file. ifo : str The ifo of the segment lists to be stored in this file. - seg_summ_list : ligo.segments.segmentslist (OPTIONAL) + seg_summ_list : igwn_segments.segmentslist (OPTIONAL) Specify the segment_summary segmentlist that goes along with the segmentlist. Default=None, in this case segment_summary is taken from the valid_segment of the SegFile class. @@ -1805,13 +1805,13 @@ def from_multi_segment_list(cls, description, segmentlists, names, ifos, ------------ description : string (required) See File.__init__ - segmentlists : List of ligo.segments.segmentslist + segmentlists : List of igwn_segments.segmentslist List of segment lists that will be stored in this file. names : List of str List of names of the segment lists to be stored in the file. ifos : str List of ifos of the segment lists to be stored in this file. - seg_summ_lists : ligo.segments.segmentslist (OPTIONAL) + seg_summ_lists : igwn_segments.segmentslist (OPTIONAL) Specify the segment_summary segmentlists that go along with the segmentlists. Default=None, in this case segment_summary is taken from the valid_segment of the SegFile class. @@ -1840,18 +1840,18 @@ def from_segment_list_dict(cls, description, segmentlistdict, ------------ description : string (required) See File.__init__ - segmentlistdict : ligo.segments.segmentslistdict + segmentlistdict : igwn_segments.segmentslistdict See SegFile.__init__ ifo_list : string or list (optional) See File.__init__, if not given a list of all ifos in the segmentlistdict object will be used - valid_segment : ligo.segments.segment or ligo.segments.segmentlist + valid_segment : igwn_segments.segment or igwn_segments.segmentlist See File.__init__, if not given the extent of all segments in the segmentlistdict is used. file_exists : boolean (default = False) If provided and set to True it is assumed that this file already exists on disk and so there is no need to write again. - seg_summ_dict : ligo.segments.segmentslistdict + seg_summ_dict : igwn_segments.segmentslistdict Optional. See SegFile.__init__. """ if ifo_list is None: @@ -1869,7 +1869,7 @@ def from_segment_list_dict(cls, description, segmentlistdict, valid_segment = segmentlistdict.extent_all() except: # Numpty probably didn't supply a - # ligo.segments.segmentlistdict + # igwn_segments.segmentlistdict segmentlistdict=segments.segmentlistdict(segmentlistdict) try: valid_segment = segmentlistdict.extent_all() @@ -1893,7 +1893,7 @@ def from_segment_list_dict(cls, description, segmentlistdict, @classmethod def from_segment_xml(cls, xml_file, **kwargs): """ - Read a ligo.segments.segmentlist from the file object file containing an + Read a igwn_segments.segmentlist from the file object file containing an xml segment table. Parameters @@ -2214,12 +2214,12 @@ def get_full_analysis_chunk(science_segs): Parameters ----------- - science_segs : ifo-keyed dictionary of ligo.segments.segmentlist instances + science_segs : ifo-keyed dictionary of igwn_segments.segmentlist instances The list of times that are being analysed in this workflow. Returns -------- - fullSegment : ligo.segments.segment + fullSegment : igwn_segments.segment The segment spanning the first and last time point contained in science_segs. """ extents = [science_segs[ifo].extent() for ifo in science_segs.keys()] diff --git a/pycbc/workflow/datafind.py b/pycbc/workflow/datafind.py index f92375271ae..1a9310fb470 100644 --- a/pycbc/workflow/datafind.py +++ b/pycbc/workflow/datafind.py @@ -33,7 +33,7 @@ import logging import urllib.parse -from ligo import segments +import igwn_segments as segments from ligo.lw import utils, table from gwdatafind import find_urls as find_frame_urls @@ -68,7 +68,7 @@ def setup_datafind_workflow(workflow, scienceSegs, outputDir, seg_file=None, ---------- workflow: pycbc.workflow.core.Workflow The workflow class that stores the jobs that will be run. - scienceSegs : Dictionary of ifo keyed ligo.segments.segmentlist instances + scienceSegs : Dictionary of ifo keyed igwn_segments.segmentlist instances This contains the times that the workflow is expected to analyse. outputDir : path All output files written by datafind processes will be written to this @@ -94,7 +94,7 @@ def setup_datafind_workflow(workflow, scienceSegs, outputDir, seg_file=None, SegFile containing the analysable time after checks in the datafind module are applied to the input segment list. For production runs this is expected to be equal to the input segment list. - scienceSegs : Dictionary of ifo keyed ligo.segments.segmentlist instances + scienceSegs : Dictionary of ifo keyed igwn_segments.segmentlist instances This contains the times that the workflow is expected to analyse. If the updateSegmentTimes kwarg is given this will be updated to reflect any instances of missing data. @@ -380,7 +380,7 @@ def setup_datafind_runtime_cache_multi_calls_perifo(cp, scienceSegs, cp : ConfigParser.ConfigParser instance This contains a representation of the information stored within the workflow configuration files - scienceSegs : Dictionary of ifo keyed ligo.segments.segmentlist instances + scienceSegs : Dictionary of ifo keyed igwn_segments.segmentlist instances This contains the times that the workflow is expected to analyse. outputDir : path All output files written by datafind processes will be written to this @@ -468,7 +468,7 @@ def setup_datafind_runtime_cache_single_call_perifo(cp, scienceSegs, outputDir, cp : ConfigParser.ConfigParser instance This contains a representation of the information stored within the workflow configuration files - scienceSegs : Dictionary of ifo keyed ligo.segments.segmentlist instances + scienceSegs : Dictionary of ifo keyed igwn_segments.segmentlist instances This contains the times that the workflow is expected to analyse. outputDir : path All output files written by datafind processes will be written to this @@ -585,7 +585,7 @@ def setup_datafind_runtime_frames_single_call_perifo(cp, scienceSegs, cp : ConfigParser.ConfigParser instance This contains a representation of the information stored within the workflow configuration files - scienceSegs : Dictionary of ifo keyed ligo.segments.segmentlist instances + scienceSegs : Dictionary of ifo keyed igwn_segments.segmentlist instances This contains the times that the workflow is expected to analyse. outputDir : path All output files written by datafind processes will be written to this @@ -635,7 +635,7 @@ def setup_datafind_runtime_frames_multi_calls_perifo(cp, scienceSegs, cp : ConfigParser.ConfigParser instance This contains a representation of the information stored within the workflow configuration files - scienceSegs : Dictionary of ifo keyed ligo.segments.segmentlist instances + scienceSegs : Dictionary of ifo keyed igwn_segments.segmentlist instances This contains the times that the workflow is expected to analyse. outputDir : path All output files written by datafind processes will be written to this @@ -791,7 +791,7 @@ def get_science_segs_from_datafind_outs(datafindcaches): Returns -------- - newScienceSegs : Dictionary of ifo keyed ligo.segments.segmentlist instances + newScienceSegs : Dictionary of ifo keyed igwn_segments.segmentlist instances The times covered by the frames found in datafindOuts. """ newScienceSegs = {} @@ -819,7 +819,7 @@ def get_missing_segs_from_frame_file_cache(datafindcaches): Returns -------- - missingFrameSegs : Dict. of ifo keyed ligo.segments.segmentlist instances + missingFrameSegs : Dict. of ifo keyed igwn_segments.segmentlist instances The times corresponding to missing frames found in datafindOuts. missingFrames: Dict. of ifo keyed lal.Cache instances The list of missing frames @@ -867,7 +867,7 @@ def get_segment_summary_times(scienceFile, segmentName): Returns --------- - summSegList : ligo.segments.segmentlist + summSegList : igwn_segments.segmentlist The times that are covered in the segment summary table. """ # Parse the segmentName diff --git a/pycbc/workflow/inference_followups.py b/pycbc/workflow/inference_followups.py index 26343342b7a..4a44a3a4da6 100644 --- a/pycbc/workflow/inference_followups.py +++ b/pycbc/workflow/inference_followups.py @@ -44,7 +44,7 @@ def make_inference_plot(workflow, input_file, output_dir, name: str The name in the [executables] section of the configuration file to use. - analysis_segs: ligo.segments.Segment, optional + analysis_segs: igwn_segments.segment, optional The segment this job encompasses. If None then use the total analysis time from the workflow. tags: list, optional @@ -121,7 +121,7 @@ def make_inference_prior_plot(workflow, config_file, output_dir, The name in the [executables] section of the configuration file to use, and the section to read for additional arguments to pass to the executable. Default is ``plot_prior``. - analysis_segs: ligo.segments.Segment, optional + analysis_segs: igwn_segments.segment, optional The segment this job encompasses. If None then use the total analysis time from the workflow. tags: list, optional @@ -156,7 +156,7 @@ def create_posterior_files(workflow, samples_files, output_dir, The name in the [executables] section of the configuration file to use, and the section to read for additional arguments to pass to the executable. Default is ``extract_posterior``. - analysis_segs: ligo.segments.Segment, optional + analysis_segs: igwn_segments.segment, optional The segment this job encompasses. If None then use the total analysis time from the workflow. tags: list, optional @@ -215,7 +215,7 @@ def create_fits_file(workflow, inference_file, output_dir, The name in the [executables] section of the configuration file to use, and the section to read for additional arguments to pass to the executable. Default is ``create_fits_file``. - analysis_segs: ligo.segments.Segment, optional + analysis_segs: igwn_segments.segment, optional The segment this job encompasses. If None then use the total analysis time from the workflow. tags: list, optional @@ -258,7 +258,7 @@ def make_inference_skymap(workflow, fits_file, output_dir, The name in the [executables] section of the configuration file to use, and the section to read for additional arguments to pass to the executable. Default is ``plot_skymap``. - analysis_segs: ligo.segments.Segment, optional + analysis_segs: igwn_segments.segment, optional The segment this job encompasses. If None then use the total analysis time from the workflow. tags: list, optional @@ -299,7 +299,7 @@ def make_inference_summary_table(workflow, inference_file, output_dir, The name in the [executables] section of the configuration file to use, and the section to read for additional arguments to pass to the executable. Default is ``table_summary``. - analysis_segs: ligo.segments.Segment, optional + analysis_segs: igwn_segments.segment, optional The segment this job encompasses. If None then use the total analysis time from the workflow. tags: list, optional @@ -349,7 +349,7 @@ def make_inference_posterior_plot(workflow, inference_file, output_dir, The name in the [executables] section of the configuration file to use, and the section to read for additional arguments to pass to the executable. Default is ``plot_posterior``. - analysis_segs: ligo.segments.Segment, optional + analysis_segs: igwn_segments.segment, optional The segment this job encompasses. If None then use the total analysis time from the workflow. tags: list, optional @@ -391,7 +391,7 @@ def make_inference_samples_plot(workflow, inference_file, output_dir, The name in the [executables] section of the configuration file to use, and the section to read for additional arguments to pass to the executable. Default is ``plot_samples``. - analysis_segs: ligo.segments.Segment, optional + analysis_segs: igwn_segments.segment, optional The segment this job encompasses. If None then use the total analysis time from the workflow. tags: list, optional @@ -425,7 +425,7 @@ def make_inference_acceptance_rate_plot(workflow, inference_file, output_dir, The name in the [executables] section of the configuration file to use, and the section to read for additional arguments to pass to the executable. Default is ``plot_acceptance_rate``. - analysis_segs: ligo.segments.Segment, optional + analysis_segs: igwn_segments.segment, optional The segment this job encompasses. If None then use the total analysis time from the workflow. tags: list, optional @@ -459,7 +459,7 @@ def make_inference_plot_mcmc_history(workflow, inference_file, output_dir, The name in the [executables] section of the configuration file to use, and the section to read for additional arguments to pass to the executable. Default is ``plot_mcmc_history``. - analysis_segs: ligo.segments.Segment, optional + analysis_segs: igwn_segments.segment, optional The segment this job encompasses. If None then use the total analysis time from the workflow. tags: list, optional @@ -493,7 +493,7 @@ def make_inference_dynesty_run_plot(workflow, inference_file, output_dir, The name in the [executables] section of the configuration file to use, and the section to read for additional arguments to pass to the executable. Default is ``plot_dynesty_run``. - analysis_segs: ligo.segments.Segment, optional + analysis_segs: igwn_segments.segment, optional The segment this job encompasses. If None then use the total analysis time from the workflow. tags: list, optional @@ -527,7 +527,7 @@ def make_inference_dynesty_trace_plot(workflow, inference_file, output_dir, The name in the [executables] section of the configuration file to use, and the section to read for additional arguments to pass to the executable. Default is ``plot_dynesty_traceplot``. - analysis_segs: ligo.segments.Segment, optional + analysis_segs: igwn_segments.segment, optional The segment this job encompasses. If None then use the total analysis time from the workflow. tags: list, optional @@ -568,7 +568,7 @@ def make_inference_pp_table(workflow, posterior_files, output_dir, The name in the [executables] section of the configuration file to use, and the section to read for additional arguments to pass to the executable. Default is ``table_summary``. - analysis_segs : ligo.segments.Segment, optional + analysis_segs : igwn_segments.segment, optional The segment this job encompasses. If None then use the total analysis time from the workflow. tags : list, optional @@ -618,7 +618,7 @@ def make_inference_pp_plot(workflow, posterior_files, output_dir, The name in the [executables] section of the configuration file to use, and the section to read for additional arguments to pass to the executable. Default is ``plot_pp``. - analysis_segs: ligo.segments.Segment, optional + analysis_segs: igwn_segments.segment, optional The segment this job encompasses. If None then use the total analysis time from the workflow. tags: list, optional @@ -666,7 +666,7 @@ def make_inference_inj_recovery_plot(workflow, posterior_files, output_dir, The name in the [executables] section of the configuration file to use, and the section to read for additional arguments to pass to the executable. Default is ``inj_recovery``. - analysis_segs: ligo.segments.Segment, optional + analysis_segs: igwn_segments.segment, optional The segment this job encompasses. If None then use the total analysis time from the workflow. tags: list, optional diff --git a/pycbc/workflow/jobsetup.py b/pycbc/workflow/jobsetup.py index e6aabd61a2c..3ecebe9fd92 100644 --- a/pycbc/workflow/jobsetup.py +++ b/pycbc/workflow/jobsetup.py @@ -29,8 +29,8 @@ """ import math, os +import igwn_segments as segments import lal -from ligo import segments from pycbc.workflow.core import Executable, File, FileList, Node def int_gps_time_to_str(t): @@ -169,7 +169,7 @@ def sngl_ifo_job_setup(workflow, ifo, out_files, curr_exe_job, science_segs, to this list, and it does not need to be empty when supplied. curr_exe_job : Job An instanced of the Job class that has a get_valid times method. - science_segs : ligo.segments.segmentlist + science_segs : igwn_segments.segmentlist The list of times that the jobs should cover datafind_outs : pycbc.workflow.core.FileList The file list containing the datafind files. @@ -347,7 +347,7 @@ def identify_needed_data(curr_exe_job): dataLength : float The amount of data (in seconds) that each instance of the job must read in. - valid_chunk : ligo.segments.segment + valid_chunk : igwn_segments.segment The times within dataLength for which that jobs output **can** be valid (ie. for inspiral this is (72, dataLength-72) as, for a standard setup the inspiral job cannot look for triggers in the first 72 or @@ -827,7 +827,7 @@ def create_nodata_node(self, valid_seg, tags=None): Parameters ----------- - valid_seg : ligo.segments.segment + valid_seg : igwn_segments.segment The segment over which to declare the node valid. Usually this would be the duration of the analysis. diff --git a/pycbc/workflow/matched_filter.py b/pycbc/workflow/matched_filter.py index 83bac6c29e9..f6ed4693900 100644 --- a/pycbc/workflow/matched_filter.py +++ b/pycbc/workflow/matched_filter.py @@ -56,7 +56,7 @@ def setup_matchedfltr_workflow(workflow, science_segs, datafind_outs, ----------- Workflow : pycbc.workflow.core.Workflow The workflow instance that the coincidence jobs will be added to. - science_segs : ifo-keyed dictionary of ligo.segments.segmentlist instances + science_segs : ifo-keyed dictionary of igwn_segments.segmentlist instances The list of times that are being analysed in this workflow. datafind_outs : pycbc.workflow.core.FileList An FileList of the datafind files that are needed to obtain the @@ -128,7 +128,7 @@ def setup_matchedfltr_dax_generated(workflow, science_segs, datafind_outs, ----------- workflow : pycbc.workflow.core.Workflow The Workflow instance that the coincidence jobs will be added to. - science_segs : ifo-keyed dictionary of ligo.segments.segmentlist instances + science_segs : ifo-keyed dictionary of igwn_segments.segmentlist instances The list of times that are being analysed in this workflow. datafind_outs : pycbc.workflow.core.FileList An FileList of the datafind files that are needed to obtain the @@ -199,7 +199,7 @@ def setup_matchedfltr_dax_generated_multi(workflow, science_segs, datafind_outs, ----------- workflow : pycbc.workflow.core.Workflow The Workflow instance that the coincidence jobs will be added to. - science_segs : ifo-keyed dictionary of ligo.segments.segmentlist instances + science_segs : ifo-keyed dictionary of igwn_segments.segmentlist instances The list of times that are being analysed in this workflow. datafind_outs : pycbc.workflow.core.FileList A FileList of the datafind files that are needed to obtain the diff --git a/pycbc/workflow/minifollowups.py b/pycbc/workflow/minifollowups.py index b216ad70098..82363280601 100644 --- a/pycbc/workflow/minifollowups.py +++ b/pycbc/workflow/minifollowups.py @@ -17,7 +17,7 @@ import logging import os.path -from ligo import segments +import igwn_segments as segments from pycbc.events import coinc from pycbc.workflow.core import Executable, FileList @@ -810,7 +810,7 @@ def make_qscan_plot(workflow, ifo, trig_time, out_dir, injection_file=None, injection_file: pycbc.workflow.File (optional, default=None) If given, add the injections in the file to strain before making the plot. - data_segments: ligo.segments.segmentlist (optional, default=None) + data_segments: igwn_segments.segmentlist (optional, default=None) The list of segments for which data exists and can be read in. If given the start/end times given to singles_timefreq will be adjusted if [trig_time - time_window, trig_time + time_window] does not completely @@ -912,7 +912,7 @@ def make_singles_timefreq(workflow, single, bank_file, trig_time, out_dir, The amount of data (not including padding) that will be read in by the singles_timefreq job. The default value of 10s should be fine for most cases. - data_segments: ligo.segments.segmentlist (optional, default=None) + data_segments: igwn_segments.segmentlist (optional, default=None) The list of segments for which data exists and can be read in. If given the start/end times given to singles_timefreq will be adjusted if [trig_time - time_window, trig_time + time_window] does not completely diff --git a/pycbc/workflow/psd.py b/pycbc/workflow/psd.py index 8e5b4f3e428..5a0e1dfa198 100644 --- a/pycbc/workflow/psd.py +++ b/pycbc/workflow/psd.py @@ -19,7 +19,7 @@ import logging -from ligo.segments import segmentlist +from igwn_segments import segmentlist from pycbc.workflow.core import FileList, make_analysis_dir, Executable from pycbc.workflow.core import SegFile diff --git a/pycbc/workflow/psdfiles.py b/pycbc/workflow/psdfiles.py index 0c647a28f3b..aacb1f0c1be 100644 --- a/pycbc/workflow/psdfiles.py +++ b/pycbc/workflow/psdfiles.py @@ -47,7 +47,7 @@ def setup_psd_workflow(workflow, science_segs, datafind_outs, ---------- workflow: pycbc.workflow.core.Workflow An instanced class that manages the constructed workflow. - science_segs : Keyed dictionary of ligo.segments.segmentlist objects + science_segs : Keyed dictionary of igwn_segments.segmentlist objects scienceSegs[ifo] holds the science segments to be analysed for each ifo. datafind_outs : pycbc.workflow.core.FileList diff --git a/pycbc/workflow/segment.py b/pycbc/workflow/segment.py index 9b9bb110438..b7312bb3310 100644 --- a/pycbc/workflow/segment.py +++ b/pycbc/workflow/segment.py @@ -32,8 +32,8 @@ import itertools import logging -from ligo import segments -from ligo.segments import utils as segmentsUtils +import igwn_segments as segments +from igwn_segments import utils as segmentsUtils from pycbc.workflow.core import SegFile, make_analysis_dir from pycbc.workflow.core import resolve_url @@ -161,10 +161,10 @@ def get_triggered_coherent_segment(workflow, sciencesegs): Returns -------- - onsource : ligo.segments.segmentlistdict + onsource : igwn_segments.segmentlistdict A dictionary containing the on source segments for network IFOs - offsource : ligo.segments.segmentlistdict + offsource : igwn_segments.segmentlistdict A dictionary containing the off source segments for network IFOs """ diff --git a/pycbc/workflow/tmpltbank.py b/pycbc/workflow/tmpltbank.py index be00ee5cd66..a27937bfe8b 100644 --- a/pycbc/workflow/tmpltbank.py +++ b/pycbc/workflow/tmpltbank.py @@ -53,7 +53,7 @@ def setup_tmpltbank_workflow(workflow, science_segs, datafind_outs, ---------- workflow: pycbc.workflow.core.Workflow An instanced class that manages the constructed workflow. - science_segs : Keyed dictionary of ligo.segments.segmentlist objects + science_segs : Keyed dictionary of igwn_segments.segmentlist objects scienceSegs[ifo] holds the science segments to be analysed for each ifo. datafind_outs : pycbc.workflow.core.FileList @@ -148,7 +148,7 @@ def setup_tmpltbank_dax_generated(workflow, science_segs, datafind_outs, ---------- workflow: pycbc.workflow.core.Workflow An instanced class that manages the constructed workflow. - science_segs : Keyed dictionary of ligo.segments.segmentlist objects + science_segs : Keyed dictionary of igwn_segments.segmentlist objects scienceSegs[ifo] holds the science segments to be analysed for each ifo. datafind_outs : pycbc.workflow.core.FileList diff --git a/requirements.txt b/requirements.txt index 4f401ab237f..2a87a4f7a1f 100644 --- a/requirements.txt +++ b/requirements.txt @@ -14,7 +14,7 @@ cython #- pinning temporarily until it is lalsuite!=7.2,<7.25 lscsoft-glue>=1.59.3 -ligo-segments +igwn-segments tqdm gwdatafind>=1.1.3 diff --git a/setup.py b/setup.py index dd6b1adafcf..70aa3c5ea8b 100755 --- a/setup.py +++ b/setup.py @@ -47,7 +47,7 @@ 'gwdatafind', 'pegasus-wms.api >= 5.0.8', 'python-ligo-lw >= 1.7.0', - 'ligo-segments', + 'igwn-segments', 'lalsuite!=7.2', 'lscsoft-glue>=1.59.3', 'pykerr', diff --git a/tox.ini b/tox.ini index 2a231fd8e05..623054bcc0b 100644 --- a/tox.ini +++ b/tox.ini @@ -17,7 +17,6 @@ conda_deps = gsl mysqlclient ; these packages don't install cleanly with pip, conda has patches - ligo-segments python-ligo-lw [bbhx]