Commit 8195b3aa authored by Kipp Cannon's avatar Kipp Cannon

Merge branch 'partialligolwport' into 'master'

Partial ligolw port

See merge request !659
parents 62dfcb13 53e80918
Pipeline #49090 passed with stages
in 158 minutes and 25 seconds
......@@ -36,9 +36,9 @@ from optparse import OptionParser
import sys
from glue.ligolw import lsctables
from glue.ligolw import utils as ligolw_utils
from glue.ligolw.utils import process as ligolw_process
from ligo.lw import lsctables
from ligo.lw import utils as ligolw_utils
from ligo.lw.utils import process as ligolw_process
from lalinspiral import inspinjfind
......
......@@ -22,9 +22,9 @@ from optparse import OptionParser
import sqlite3
import sys
from glue.ligolw import ligolw
from glue.ligolw import dbtables
from glue.ligolw.utils import ligolw_sqlite
from ligo.lw import ligolw
from ligo.lw import dbtables
from ligo.lw.utils import ligolw_sqlite
from lalapps import git_version
__author__ = "Chad Hanna <channa@ligo.caltech.edu>"
......
......@@ -32,11 +32,11 @@ from optparse import OptionParser
import sys
from glue.ligolw import ligolw
from glue.ligolw import lsctables
from glue.ligolw import utils as ligolw_utils
from glue.ligolw.utils import process as ligolw_process
from glue.ligolw.utils import segments as ligolw_segments
from ligo.lw import ligolw
from ligo.lw import lsctables
from ligo.lw import utils as ligolw_utils
from ligo.lw.utils import process as ligolw_process
from ligo.lw.utils import segments as ligolw_segments
import lal
from lalinspiral import thinca
from ligo.segments import utils as segmentsUtils
......
......@@ -39,11 +39,10 @@ from optparse import OptionParser
import os
import sys
from glue.ligolw import ligolw
from glue.ligolw import table
from glue.ligolw import lsctables
from glue.ligolw import utils
from lal.utils import CacheEntry
from ligo.lw import ligolw
from ligo.lw import lsctables
from ligo.lw import utils as ligolw_utils as ligolw_utils
#from lalapps import git_version
......@@ -129,7 +128,7 @@ for n, filename in enumerate(filenames):
# load document and extract search summary table
if options.verbose:
print("%d/%d:" % (n + 1, len(filenames)), end=' ', file=sys.stderr)
xmldoc = utils.load_filename(filename, verbose = options.verbose, contenthandler = ContentHandler)
xmldoc = ligolw_utils.load_filename(filename, verbose = options.verbose, contenthandler = ContentHandler)
searchsumm = lsctables.SearchSummaryTable.get_table(xmldoc)
# extract process_ids for the requested program
......
......@@ -37,10 +37,10 @@ from optparse import OptionParser
import sys
from glue.ligolw import ligolw
from glue.ligolw import lsctables
from glue.ligolw import utils
from glue.ligolw.utils import process as ligolw_process
from ligo.lw import ligolw
from ligo.lw import lsctables
from ligo.lw import utils as ligolw_utils
from ligo.lw.utils import process as ligolw_process
from lalburst import git_version
from lalburst import binjfind
......@@ -150,7 +150,7 @@ for n, filename in enumerate(filenames):
if options.verbose:
print("%d/%d:" % (n + 1, len(filenames)), end=' ', file=sys.stderr)
xmldoc = utils.load_filename(filename, verbose = options.verbose, contenthandler = ligolw.LIGOLWContentHandler)
xmldoc = ligolw_utils.load_filename(filename, verbose = options.verbose, contenthandler = ligolw.LIGOLWContentHandler)
binjfind.lsctables.table.InterningRowBuilder.strings.clear()
#
......@@ -189,6 +189,6 @@ for n, filename in enumerate(filenames):
# done
#
utils.write_filename(xmldoc, filename, verbose = options.verbose, gz = (filename or "stdout").endswith(".gz"))
ligolw_utils.write_filename(xmldoc, filename, verbose = options.verbose, gz = (filename or "stdout").endswith(".gz"))
xmldoc.unlink()
lsctables.reset_next_ids(lsctables.TableByName.values())
......@@ -31,10 +31,10 @@ from optparse import OptionParser
from lal.utils import CacheEntry
from glue.ligolw import ligolw
from glue.ligolw import lsctables
from glue.ligolw import utils
from glue.ligolw.utils import process as ligolw_process
from ligo.lw import ligolw
from ligo.lw import lsctables
from ligo.lw import utils as ligolw_utils
from ligo.lw.utils import process as ligolw_process
from lalburst import git_version
from lalburst import bucluster
......@@ -117,7 +117,7 @@ for filename in filenames:
# Load document
#
xmldoc = utils.load_filename(filename, verbose = options.verbose, contenthandler = ligolw.LIGOLWContentHandler)
xmldoc = ligolw_utils.load_filename(filename, verbose = options.verbose, contenthandler = ligolw.LIGOLWContentHandler)
# FIXME: don't do this: fix lalapps_power's output
if options.cluster_algorithm in ("excesspower",):
......@@ -157,5 +157,5 @@ for filename in filenames:
#
if changed:
utils.write_filename(xmldoc, filename, gz = (filename or "stdout").endswith(".gz"), verbose = options.verbose)
ligolw_utils.write_filename(xmldoc, filename, gz = (filename or "stdout").endswith(".gz"), verbose = options.verbose)
xmldoc.unlink()
......@@ -32,12 +32,12 @@ from optparse import OptionParser
import sys
from glue.ligolw import ligolw
from glue.ligolw import lsctables
from glue.ligolw import utils as ligolw_utils
from glue.ligolw.utils import segments as ligolw_segments
from glue.ligolw.utils import process as ligolw_process
from glue.ligolw.utils import search_summary as ligolw_search_summary
from ligo.lw import ligolw
from ligo.lw import lsctables
from ligo.lw import utils as ligolw_utils
from ligo.lw.utils import segments as ligolw_segments
from ligo.lw.utils import process as ligolw_process
from ligo.lw.utils import search_summary as ligolw_search_summary
from lalburst import git_version
from ligo import segments
......
......@@ -33,10 +33,10 @@ from optparse import OptionParser
import sys
from glue.ligolw import ligolw
from glue.ligolw import lsctables
from glue.ligolw import utils as ligolw_utils
from glue.ligolw.utils import process as ligolw_process
from ligo.lw import ligolw
from ligo.lw import lsctables
from ligo.lw import utils as ligolw_utils
from ligo.lw.utils import process as ligolw_process
from lalburst import git_version
from lalburst import burca
from ligo.segments import utils as segmentsUtils
......
......@@ -34,8 +34,8 @@ import sys
from lal.utils import CacheEntry
from glue.ligolw import dbtables
from glue.ligolw import utils
from ligo.lw import dbtables
from ligo.lw import utils as ligolw_utils
from lalburst import burca_tailor
from lalburst import SnglBurstUtils
from lalburst.SimBurstUtils import MW_CENTER_J2000_RA_RAD, MW_CENTER_J2000_DEC_RAD
......@@ -203,4 +203,4 @@ else:
xmldoc = burca_tailor.gen_likelihood_control(distributions, segs)
utils.write_filename(xmldoc, filename, verbose = options.verbose, gz = (filename or "stdout").endswith(".gz"))
ligolw_utils.write_filename(xmldoc, filename, verbose = options.verbose, gz = (filename or "stdout").endswith(".gz"))
......@@ -34,8 +34,8 @@ from optparse import OptionParser
import sys
from glue.ligolw import lsctables
from glue.ligolw import utils as ligolw_utils
from ligo.lw import lsctables
from ligo.lw import utils as ligolw_utils
from lalburst import git_version
from lalburst import cafe
......
......@@ -32,11 +32,11 @@ from optparse import OptionParser
import sys
from glue.ligolw import ligolw
from glue.ligolw import lsctables
from glue.ligolw import utils as ligolw_utils
from glue.ligolw.utils import process as ligolw_process
from glue.ligolw.utils import time_slide as ligolw_time_slide
from ligo.lw import ligolw
from ligo.lw import lsctables
from ligo.lw import utils as ligolw_utils
from ligo.lw.utils import process as ligolw_process
from ligo.lw.utils import time_slide as ligolw_time_slide
from lalapps import git_version
from lalburst import offsetvector
from lalburst import timeslides
......
......@@ -33,9 +33,9 @@ from matplotlib import figure
from matplotlib.backends.backend_agg import FigureCanvasAgg as FigureCanvas
import sys
from glue.ligolw import ligolw
from glue.ligolw import lsctables
from glue.ligolw import utils as ligolw_utils
from ligo.lw import ligolw
from ligo.lw import lsctables
from ligo.lw import utils as ligolw_utils
from lalburst import git_version
......
......@@ -33,7 +33,7 @@ import sys
import sqlite3
from glue.ligolw import dbtables
from ligo.lw import dbtables
from lal.utils import CacheEntry
from lalburst import git_version
from lalburst import burca_tailor
......
......@@ -85,7 +85,7 @@ import sys
from glue import iterutils
from glue.ligolw import dbtables
from ligo.lw import dbtables
from lal import rate
from lalburst import git_version
from lalburst import SimBurstUtils
......
......@@ -35,8 +35,8 @@ import sqlite3
import sys
from glue.ligolw import dbtables
from glue.ligolw import utils
from ligo.lw import dbtables
from ligo.lw import utils
from lal import rate
from lal.utils import CacheEntry
from lalburst import git_version
......
......@@ -37,7 +37,7 @@ import sqlite3
import sys
from glue.ligolw import dbtables
from ligo.lw import dbtables
from lalburst import git_version
from lalburst import SnglBurstUtils
from ligo import segments
......
......@@ -37,8 +37,8 @@ import sqlite3
import sys
from glue.ligolw import dbtables
from glue.ligolw import utils as ligolw_utils
from ligo.lw import dbtables
from ligo.lw import utils as ligolw_utils
import lal
from lal import rate
from lalburst import git_version
......
......@@ -34,10 +34,10 @@ import numpy
import sys
from glue.ligolw import ligolw
from glue.ligolw import lsctables
from glue.ligolw import utils as ligolw_utils
from glue.ligolw.utils import search_summary as ligolw_search_summary
from ligo.lw import ligolw
from ligo.lw import lsctables
from ligo.lw import utils as ligolw_utils
from ligo.lw.utils import search_summary as ligolw_search_summary
from lal import rate
from lal.utils import CacheEntry
from lalburst import git_version
......
......@@ -33,9 +33,8 @@ import sqlite3
import sys
from glue.ligolw import dbtables
from glue.ligolw import utils
from glue.ligolw.utils import segments as ligolw_segments
from ligo.lw import dbtables
from ligo.lw.utils import segments as ligolw_segments
from lalburst import git_version
from lalburst import SnglBurstUtils
from ligo import segments
......
......@@ -29,10 +29,9 @@ import tempfile
from glue import pipeline
from glue.ligolw import lsctables
from glue.ligolw import utils as ligolw_utils
from glue.ligolw.utils import segments as ligolw_segments
from glue import offsetvector
from ligo.lw import lsctables
from ligo.lw import utils as ligolw_utils
from ligo.lw.utils import segments as ligolw_segments
from lal import LIGOTimeGPS
from lal.utils import CacheEntry
from lalburst import offsetvector
......
......@@ -33,8 +33,8 @@ import sqlite3
import sys
from glue.ligolw import dbtables
from glue.ligolw.utils import segments as ligolwsegments
from ligo.lw import dbtables
from ligo.lw.utils import segments as ligolwsegments
from lalburst import git_version
......@@ -103,8 +103,8 @@ def create_string_sngl_is_vetoed_function(connection, veto_segments_name = None)
If veto_segments_name is None then a no-op function is created that
always returns False.
Note: this funtion requires glue.ligolw.dbtables and
glue.ligolw.utils.segments to be imported as dbtables and
Note: this funtion requires ligo.lw.dbtables and
ligo.lw.utils.segments to be imported as dbtables and
ligolwsegments respectively.
"""
if veto_segments_name is None:
......
......@@ -33,7 +33,7 @@ import sqlite3
import sys
from glue.ligolw import dbtables
from ligo.lw import dbtables
from lal.utils import CacheEntry
from lalburst import git_version
from lalburst import calc_likelihood
......
......@@ -53,8 +53,8 @@ import sys
import traceback
from glue.ligolw import dbtables
from glue.ligolw.utils import process as ligolwprocess
from ligo.lw import dbtables
from ligo.lw.utils import process as ligolwprocess
import lal
from lal import rate
from lal.utils import CacheEntry
......
......@@ -37,11 +37,11 @@ import sys
from lal.utils import CacheEntry
from glue.ligolw import dbtables
from glue.ligolw import ligolw
from glue.ligolw import utils as ligolw_utils
from glue.ligolw.utils import process as ligolw_process
from glue.ligolw.utils import search_summary as ligolw_search_summary
from ligo.lw import dbtables
from ligo.lw import ligolw
from ligo.lw import utils as ligolw_utils
from ligo.lw.utils import process as ligolw_process
from ligo.lw.utils import search_summary as ligolw_search_summary
from lalburst import SnglBurstUtils
from lalburst import git_version
from lalburst import stringutils
......
......@@ -35,8 +35,8 @@ import sqlite3
import sys
from glue.ligolw import dbtables
from glue.ligolw import utils as ligolw_utils
from ligo.lw import dbtables
from ligo.lw import utils as ligolw_utils
from lal import rate
from lal.utils import CacheEntry
from lalburst import git_version
......
......@@ -370,7 +370,7 @@ plots = [
#
from glue.ligolw import dbtables
from ligo.lw import dbtables
for n, filename in enumerate(filenames):
if options.verbose:
......
......@@ -46,11 +46,10 @@ import re
import sys
from glue.ligolw import ilwd
from glue.ligolw import lsctables
from glue.ligolw import dbtables
from glue.ligolw.utils import search_summary as ligolw_search_summary
from glue.ligolw.utils import segments as ligolw_segments
from ligo.lw import lsctables
from ligo.lw import dbtables
from ligo.lw.utils import search_summary as ligolw_search_summary
from ligo.lw.utils import segments as ligolw_segments
from .offsetvector import offsetvector
......
......@@ -43,11 +43,11 @@ import bisect
import sys
from glue.ligolw import lsctables
from glue.ligolw.utils import coincs as ligolw_coincs
from glue.ligolw.utils import process as ligolw_process
from glue.ligolw.utils import search_summary as ligolw_search_summary
from glue.ligolw.utils import time_slide as ligolw_time_slide
from ligo.lw import lsctables
from ligo.lw.utils import coincs as ligolw_coincs
from ligo.lw.utils import process as ligolw_process
from ligo.lw.utils import search_summary as ligolw_search_summary
from ligo.lw.utils import time_slide as ligolw_time_slide
import lal
from ligo import segments
from . import burca
......
......@@ -31,9 +31,9 @@ import math
import sys
from glue.ligolw import lsctables
from glue.ligolw.utils import process as ligolw_process
from glue.ligolw.utils import search_summary as ligolw_search_summary
from ligo.lw import lsctables
from ligo.lw.utils import process as ligolw_process
from ligo.lw.utils import search_summary as ligolw_search_summary
from ligo import segments
from . import snglcluster
......
......@@ -33,7 +33,7 @@ import math
import sys
from glue.ligolw import lsctables
from ligo.lw import lsctables
from . import snglcoinc
......
......@@ -37,13 +37,13 @@ import lal
from lal import rate
from glue.ligolw import ligolw
from glue.ligolw import lsctables
from glue.ligolw import array as ligolw_array
from glue.ligolw import param as ligolw_param
from glue.ligolw import utils as ligolw_utils
from glue.ligolw.utils import process as ligolw_process
from glue.ligolw.utils import search_summary as ligolw_search_summary
from ligo.lw import ligolw
from ligo.lw import lsctables
from ligo.lw import array as ligolw_array
from ligo.lw import param as ligolw_param
from ligo.lw import utils as ligolw_utils
from ligo.lw.utils import process as ligolw_process
from ligo.lw.utils import search_summary as ligolw_search_summary
from . import snglcoinc
from .SimBurstUtils import MW_CENTER_J2000_RA_RAD, MW_CENTER_J2000_DEC_RAD
......
......@@ -31,7 +31,7 @@ import sys
import traceback
from glue.ligolw import lsctables
from ligo.lw import lsctables
from glue.text_progress_bar import ProgressBar
......@@ -58,14 +58,6 @@ def assign_likelihood_ratios(connection, coinc_def_id, offset_vectors, vetosegli
"""
Assigns likelihood ratio values to coincidences.
"""
#
# Convert offset vector keys to strings so that we can use the
# dictionary inside an SQL query (they might be
# glue.ligolw.ilwd_char objects)
#
offset_vectors = dict((unicode(time_slide_id), offset_vector) for time_slide_id, offset_vector in offset_vectors.items())
#
# Create a cursor object for events_func() to reuse
#
......
......@@ -58,9 +58,9 @@ except ImportError:
import warnings
from glue.ligolw import ligolw
from glue.ligolw import lsctables
from glue.ligolw.utils import coincs as ligolw_coincs
from ligo.lw import ligolw
from ligo.lw import lsctables
from ligo.lw.utils import coincs as ligolw_coincs
from glue.text_progress_bar import ProgressBar
import lal
from ligo.segments import NegInfinity
......
......@@ -38,12 +38,12 @@ import scipy.stats
import sys
from glue.ligolw import ligolw
from glue.ligolw import array as ligolw_array
from glue.ligolw import param as ligolw_param
from glue.ligolw import lsctables
from glue.ligolw import utils as ligolw_utils
from glue.ligolw.utils import process as ligolw_process
from ligo.lw import ligolw
from ligo.lw import array as ligolw_array
from ligo.lw import param as ligolw_param
from ligo.lw import lsctables
from ligo.lw import utils as ligolw_utils
from ligo.lw.utils import process as ligolw_process
import lal
from lal import rate
from ligo.segments import utils as segmentsUtils
......
......@@ -3,7 +3,12 @@ import sys
from numpy.testing import assert_allclose
from lalburst import snglcoinc
# FIXME: remove this when git.ligo.org has python-ligo-lw insalled in the
# test environment
try:
from lalburst import snglcoinc
except ImportError:
sys.exit(0)
class TestCoincRates(unittest.TestCase):
......
......@@ -46,10 +46,10 @@ import sys
from glue import iterutils
from glue.ligolw import ligolw
from glue.ligolw import lsctables
from glue.ligolw.utils import coincs as ligolw_coincs
from glue.ligolw.utils import time_slide as ligolw_time_slide
from ligo.lw import ligolw
from ligo.lw import lsctables
from ligo.lw.utils import coincs as ligolw_coincs
from ligo.lw.utils import time_slide as ligolw_time_slide
from glue.text_progress_bar import ProgressBar
from . import thinca
......
......@@ -33,8 +33,8 @@ import operator
import sys
from glue.ligolw import ligolw