From a1659c3f2a348dfe649a64c4d3bb1f00ee895272 Mon Sep 17 00:00:00 2001 From: Madeline Wade <madeline.wade@ligo.org> Date: Fri, 22 Feb 2019 08:47:20 -0800 Subject: [PATCH] Cleaning up some no longer needed glue imports and python3 syntax --- gstlal-calibration/configure.ac | 4 +--- gstlal-calibration/debian/control.in | 2 -- .../examples/L1_GDS_CALCS_comparison_plots | 1 - gstlal-calibration/gstlal-calibration.spec.in | 1 - gstlal-calibration/python/calibration_parts.py | 18 +++++++++--------- .../tests/GDS_CALCS_comparison_plots | 1 - .../check_calibration/ASD_comparison_plots | 1 - .../tests/check_calibration/ASD_plots | 1 - gstlal-calibration/tests/test_common.py | 4 ++-- 9 files changed, 12 insertions(+), 21 deletions(-) diff --git a/gstlal-calibration/configure.ac b/gstlal-calibration/configure.ac index dc1d6b11b4..d85596ecd1 100644 --- a/gstlal-calibration/configure.ac +++ b/gstlal-calibration/configure.ac @@ -225,12 +225,10 @@ AC_SUBST([LAL_LIBS]) # -# Check for glue +# Check for ligo_segments # -AC_SUBST([MIN_GLUE_VERSION], [1.50]) -AX_PYTHON_GLUE() AC_SUBST([MIN_LIGO_SEGMENTS_VERSION], [1.1.0]) AX_PYTHON_LIGO_SEGMENTS([$MIN_LIGO_SEGMENTS_VERSION]) diff --git a/gstlal-calibration/debian/control.in b/gstlal-calibration/debian/control.in index 050335616c..503ea48174 100644 --- a/gstlal-calibration/debian/control.in +++ b/gstlal-calibration/debian/control.in @@ -14,7 +14,6 @@ Build-Depends: libgstreamer-plugins-base1.0-dev (>= @MIN_GSTREAMER_VERSION@), pkg-config, python-all-dev (>= @MIN_PYTHON_VERSION@), - python-glue (>= @MIN_GLUE_VERSION@), python-numpy Package: gstlal-calibration @@ -36,7 +35,6 @@ Depends: ${shlibs:Depends}, ${misc:Depends}, ${python:Depends}, libgstreamer-plugins-base1.0-0 (>= @MIN_GSTREAMER_VERSION@), python (>= @MIN_PYTHON_VERSION@), python-gi, - python-glue (>= @MIN_GLUE_VERSION@), python-ligo-segments (>= @MIN_LIGO_SEGMENTS_VERSION@), python-gst-1.0, python-numpy, diff --git a/gstlal-calibration/examples/L1_GDS_CALCS_comparison_plots b/gstlal-calibration/examples/L1_GDS_CALCS_comparison_plots index fcb9970231..2c74303638 100755 --- a/gstlal-calibration/examples/L1_GDS_CALCS_comparison_plots +++ b/gstlal-calibration/examples/L1_GDS_CALCS_comparison_plots @@ -9,7 +9,6 @@ from math import pi from gwpy.plotter import BodePlot import numpy from optparse import OptionParser, Option -from glue import datafind parser = OptionParser() diff --git a/gstlal-calibration/gstlal-calibration.spec.in b/gstlal-calibration/gstlal-calibration.spec.in index 7f77200591..6d4b2ff593 100644 --- a/gstlal-calibration/gstlal-calibration.spec.in +++ b/gstlal-calibration/gstlal-calibration.spec.in @@ -10,7 +10,6 @@ Group: LSC Software/Data Analysis Requires: gstlal >= @MIN_GSTLAL_VERSION@ Requires: gstlal-ugly >= @MIN_GSTLALUGLY_VERSION@ Requires: python >= @MIN_PYTHON_VERSION@ -Requires: glue >= @MIN_GLUE_VERSION@ Requires: python2-ligo-segments >= @MIN_LIGO_SEGMENTS_VERSION@ Requires: %{gstreamername} >= @MIN_GSTREAMER_VERSION@ Requires: %{gstreamername}-plugins-base >= @MIN_GSTREAMER_VERSION@ diff --git a/gstlal-calibration/python/calibration_parts.py b/gstlal-calibration/python/calibration_parts.py index a4f85c4f40..109db0255b 100644 --- a/gstlal-calibration/python/calibration_parts.py +++ b/gstlal-calibration/python/calibration_parts.py @@ -290,32 +290,32 @@ def remove_lines_with_witnesses(pipeline, signal, witnesses, freqs, freq_vars, f # Re-format inputs if necessary if type(witnesses) is not list and type(witnesses) is not tuple and type(witnesses) is not numpy.ndarray: - print "remove_lines_with_witnesses(): argument 3 should be type list. Converting %s to list" % type(witnesses) + print("remove_lines_with_witnesses(): argument 3 should be type list. Converting %s to list" % type(witnesses)) witnesses = [[witnesses]] if type(freqs) is not list and type(freqs) is not tuple and type(freqs) is not numpy.ndarray: - print "remove_lines_with_witnesses(): argument 4 should be type list. Converting %s to list" % type(freqs) + print("remove_lines_with_witnesses(): argument 4 should be type list. Converting %s to list" % type(freqs)) freqs = [[freqs]] if type(freq_vars) is not list and type(freq_vars) is not tuple and type(freq_vars) is not numpy.ndarray: - print "remove_lines_with_witnesses(): argument 5 should be type list. Converting %s to list" % type(freq_vars) + print("remove_lines_with_witnesses(): argument 5 should be type list. Converting %s to list" % type(freq_vars)) freq_vars = [freq_vars] for i in range(0, len(witnesses) - len(freqs)): - print "remove_lines_with_witnesses(): Warning: not enough elements in argument 4" + print("remove_lines_with_witnesses(): Warning: not enough elements in argument 4") freqs.append(freqs[-1]) for i in range(0, len(witnesses) - len(freq_vars)): - print "remove_lines_with_witnesses(): Warning: not enough elements in argument 5" + print("remove_lines_with_witnesses(): Warning: not enough elements in argument 5") freq_vars.append(freq_vars[-1]) if len(freqs) > len(witnesses): - print "remove_lines_with_witnesses(): Warning: too many elements in argument 4" + print("remove_lines_with_witnesses(): Warning: too many elements in argument 4") freqs = freqs[:len(witnesses)] if len(freq_vars) > len(witnesses): - print "remove_lines_with_witnesses(): Warning: too many elements in argument 5" + print("remove_lines_with_witnesses(): Warning: too many elements in argument 5") freq_vars = freq_vars[:len(witnesses)] for i in range(0, len(witnesses)): if type(witnesses[i]) is not list and type(witnesses[i]) is not tuple and type(witnesses[i]) is not numpy.ndarray: - print "remove_lines_with_witnesses(): argument 3 should be list of lists. Converting %s to list" % type(witnesses[i]) + print("remove_lines_with_witnesses(): argument 3 should be list of lists. Converting %s to list" % type(witnesses[i])) witnesses[i] = [witnesses[i]] if type(freqs[i]) is not list and type(freqs[i]) is not tuple and type(freqs[i]) is not numpy.ndarray: - print "remove_lines_with_witnesses(): argument 4 should be list of lists. Converting %s to list" % type(freqs[i]) + print("remove_lines_with_witnesses(): argument 4 should be list of lists. Converting %s to list" % type(freqs[i])) freqs[i] = [freqs[i]] filter_param = 0.0625 diff --git a/gstlal-calibration/tests/GDS_CALCS_comparison_plots b/gstlal-calibration/tests/GDS_CALCS_comparison_plots index 426b47c59a..f5af945f9a 100755 --- a/gstlal-calibration/tests/GDS_CALCS_comparison_plots +++ b/gstlal-calibration/tests/GDS_CALCS_comparison_plots @@ -1,7 +1,6 @@ #!/usr/bin/env python from gwpy.timeseries import TimeSeries -from glue import datafind import glob from math import pi import matplotlib as mpl; mpl.use('Agg') diff --git a/gstlal-calibration/tests/check_calibration/ASD_comparison_plots b/gstlal-calibration/tests/check_calibration/ASD_comparison_plots index a133fa4d4d..566fec93c9 100755 --- a/gstlal-calibration/tests/check_calibration/ASD_comparison_plots +++ b/gstlal-calibration/tests/check_calibration/ASD_comparison_plots @@ -9,7 +9,6 @@ from math import pi from gwpy.plotter import BodePlot import numpy from optparse import OptionParser, Option -from glue import datafind parser = OptionParser() diff --git a/gstlal-calibration/tests/check_calibration/ASD_plots b/gstlal-calibration/tests/check_calibration/ASD_plots index 9ecb57e03b..ebe516b087 100755 --- a/gstlal-calibration/tests/check_calibration/ASD_plots +++ b/gstlal-calibration/tests/check_calibration/ASD_plots @@ -9,7 +9,6 @@ from math import pi from gwpy.plotter import BodePlot import numpy from optparse import OptionParser, Option -from glue import datafind parser = OptionParser() diff --git a/gstlal-calibration/tests/test_common.py b/gstlal-calibration/tests/test_common.py index b0f2c7bc2b..00852a7a9a 100644 --- a/gstlal-calibration/tests/test_common.py +++ b/gstlal-calibration/tests/test_common.py @@ -159,7 +159,7 @@ def transform_arrays(input_arrays, elemfunc, name, rate = 1, **elemfunc_kwargs): pipeline = Gst.Pipeline(name = name) head = pipeparts.mkgeneric(pipeline, None, "appsrc", caps = pipeio.caps_from_array(input_arrays[0], rate = rate)) - def need_data(elem, arg, (input_arrays, rate)): + def need_data(elem, arg, input_arrays, rate): if input_arrays: arr = input_arrays.pop(0) elem.set_property("caps", pipeio.caps_from_array(arr, rate)) @@ -169,7 +169,7 @@ def transform_arrays(input_arrays, elemfunc, name, rate = 1, **elemfunc_kwargs): else: elem.emit("end-of-stream") return Gst.FlowReturn.EOS - head.connect("need-data", need_data, (input_arrays, rate)) + head.connect("need-data", need_data, input_arrays, rate) head = elemfunc(pipeline, head, **elemfunc_kwargs) -- GitLab