Skip to content

Commit

Permalink
plotting unused imports
Browse files Browse the repository at this point in the history
  • Loading branch information
GarethCabournDavies committed Jan 8, 2025
1 parent ad03888 commit ec7e3b0
Show file tree
Hide file tree
Showing 24 changed files with 11 additions and 44 deletions.
1 change: 0 additions & 1 deletion bin/plotting/pycbc_banksim_plot_eff_fitting_factor
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ point-source files.
import sys
import numpy
import argparse
import logging
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
Expand Down
1 change: 0 additions & 1 deletion bin/plotting/pycbc_banksim_plot_fitting_factors
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
import sys
import argparse
import numpy
import logging
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
Expand Down
1 change: 0 additions & 1 deletion bin/plotting/pycbc_banksim_table_point_injs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
import sys
import argparse
import numpy
import logging

import pycbc.version
from pycbc import results
Expand Down
6 changes: 2 additions & 4 deletions bin/plotting/pycbc_faithsim_plots
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,11 @@ import argparse
import matplotlib
matplotlib.use("Agg")
import matplotlib.cm
from matplotlib.ticker import MultipleLocator, FormatStrFormatter
from matplotlib.ticker import MultipleLocator
import pylab
import numpy as np

from ligo.lw import utils, table, lsctables

from pycbc import pnutils, init_logging, add_common_pycbc_options
from pycbc import init_logging, add_common_pycbc_options
from pycbc.conversions import (
mtotal_from_mass1_mass2,
q_from_mass1_mass2,
Expand Down
2 changes: 1 addition & 1 deletion bin/plotting/pycbc_page_banktriggerrate
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"""
import matplotlib
matplotlib.use('Agg')
import numpy, argparse, os, pylab, pycbc.pnutils
import numpy, argparse, pylab, pycbc.pnutils
from pycbc.io.hdf import HFile

from pycbc import init_logging, add_common_pycbc_options
Expand Down
4 changes: 1 addition & 3 deletions bin/plotting/pycbc_page_foundmissed
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"""
import numpy
import logging
import os.path
import argparse
import sys
import matplotlib
Expand All @@ -12,7 +11,6 @@ import matplotlib.pyplot as plot

import pycbc.results.followup, pycbc.pnutils, pycbc.results
import pycbc.pnutils
from pycbc import init_logging, add_common_pycbc_options
from pycbc.detector import Detector
from pycbc.io.hdf import HFile

Expand Down Expand Up @@ -66,7 +64,7 @@ parser.add_argument('--missed-on-top', action='store_true',
"high FAR on top of low FAR")
args = parser.parse_args()

init_logging(args.verbose)
pycbc.init_logging(args.verbose)

logging.info('Read in the data')
f = HFile(args.injection_file, 'r')
Expand Down
2 changes: 0 additions & 2 deletions bin/plotting/pycbc_page_ifar
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ import pylab
import matplotlib as mpl
mpl.use('Agg')

import igwn_segments as segments

from pycbc import init_logging, add_common_pycbc_options
import pycbc.results
from pycbc.events import veto
Expand Down
2 changes: 1 addition & 1 deletion bin/plotting/pycbc_page_recovery
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ matplotlib.use("Agg")
import matplotlib.pyplot as plot

import pycbc.detector
from pycbc import pnutils, results
from pycbc import results
from pycbc.events import triggers
from pycbc.io.hdf import HFile

Expand Down
5 changes: 1 addition & 4 deletions bin/plotting/pycbc_page_segplot
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,12 @@ import argparse
import matplotlib; matplotlib.use('Agg')
import matplotlib.pyplot as plt
import numpy, pylab, pycbc.events, mpld3, mpld3.plugins
import itertools, datetime, time
import sys
from itertools import cycle
from matplotlib.patches import Rectangle

from pycbc import add_common_pycbc_options, init_logging
from pycbc.events.veto import get_segment_definer_comments
from pycbc.results.color import ifo_color
from pycbc.results.mpld3_utils import MPLSlide, LineTooltip
from pycbc.results.mpld3_utils import LineTooltip
from pycbc.workflow import SegFile

# parse command line
Expand Down
1 change: 0 additions & 1 deletion bin/plotting/pycbc_page_segtable
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

import argparse
import logging
import numpy
import pycbc.results
import sys
Expand Down
2 changes: 0 additions & 2 deletions bin/plotting/pycbc_page_snrchi
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
#!/usr/bin/env python
import logging
import numpy
import h5py
import argparse
import matplotlib
import sys
matplotlib.use('Agg')
import pylab

import pycbc.results
from pycbc.events import veto
from pycbc.io import (
get_chisq_from_file_choice, chisq_choices, SingleDetTriggers, HFile
)
Expand Down
2 changes: 1 addition & 1 deletion bin/plotting/pycbc_page_snrifar
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
ranking statistic, or make statistical significance vs ranking statistic
cumulative histograms.
"""
import argparse, h5py, numpy, logging, sys
import argparse, numpy, logging, sys
import matplotlib
matplotlib.use('Agg')
import pylab
Expand Down
3 changes: 1 addition & 2 deletions bin/plotting/pycbc_page_versioning
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import argparse
import logging

import pycbc
from pycbc import init_logging, add_common_pycbc_options
from pycbc.results import (save_fig_with_metadata, html_escape,
get_library_version_info, get_code_version_numbers)

Expand All @@ -26,7 +25,7 @@ parser.add_argument("--output-file", required=True,
help="The directory for output html snippets")
args = parser.parse_args()

init_logging(args.verbose)
pycbc.init_logging(args.verbose)

if not len(args.executables) == len(args.executables_names):
raise parser.error("--executables-files and executables-names must be "
Expand Down
1 change: 0 additions & 1 deletion bin/plotting/pycbc_plot_background_coincs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#!/usr/bin/env python
""" Plot PyCBC's background coinc triggers
"""
import numpy
import argparse
import matplotlib
matplotlib.use('Agg')
Expand Down
1 change: 0 additions & 1 deletion bin/plotting/pycbc_plot_bank_corner
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ from pycbc.results.plot import (add_style_opt_to_parser, set_style_from_cli)
from pycbc.io import FieldArray, HFile
from pycbc.inference import option_utils
from pycbc.tmpltbank import bank_conversions as bconv
from pycbc.pnutils import get_imr_duration
from pycbc.results.scatter_histograms import create_multidim_plot
from pycbc.results import metadata

Expand Down
1 change: 0 additions & 1 deletion bin/plotting/pycbc_plot_dq_likelihood_vs_time
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#!/usr/bin/env python
"""Plot the DQ log likelihood versus time for a specific background bin
"""
import logging
import sys
import argparse
import numpy
Expand Down
1 change: 0 additions & 1 deletion bin/plotting/pycbc_plot_dq_percentiles
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#!/usr/bin/env python
""" Plot the log likelihood percentiles for a DQ bin
"""
import logging
import sys
import argparse
import numpy
Expand Down
1 change: 0 additions & 1 deletion bin/plotting/pycbc_plot_gating
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import mpld3.plugins

import pycbc
from pycbc.results.color import ifo_color
from pycbc.results.mpld3_utils import MPLSlide
from pycbc.io.hdf import HFile


Expand Down
3 changes: 1 addition & 2 deletions bin/plotting/pycbc_plot_hist
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

import numpy
import argparse
import logging
import sys
from itertools import cycle
from matplotlib import use
Expand All @@ -14,7 +13,7 @@ from matplotlib import pyplot
import pycbc
import pycbc.results
import pycbc.io
from pycbc.events import background_bin_from_string, veto, ranking
from pycbc.events import background_bin_from_string, ranking

parser = argparse.ArgumentParser(description=__doc__)
pycbc.add_common_pycbc_options(parser)
Expand Down
2 changes: 0 additions & 2 deletions bin/plotting/pycbc_plot_qscan
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ information on the Q-transform and its parameters.

import sys
import argparse
import logging
import numpy

import matplotlib
matplotlib.use('Agg')
Expand Down
1 change: 0 additions & 1 deletion bin/plotting/pycbc_plot_singles_vs_params
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ matplotlib.use('agg')
import pylab as pl
from matplotlib.colors import LogNorm
from matplotlib.ticker import LogLocator
import h5py
import sys
from packaging.version import Version

Expand Down
2 changes: 0 additions & 2 deletions bin/plotting/pycbc_plot_throughput
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
#!/usr/bin/env python

import argparse
import logging
import numpy as np
import matplotlib
matplotlib.use('Agg')
import pylab as pl
Expand Down
1 change: 0 additions & 1 deletion bin/plotting/pycbc_plot_trigrate
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import logging
from matplotlib import use
use('Agg')
from matplotlib import pyplot as plt
import copy
import numpy as np
from scipy import stats as scistats

Expand Down
9 changes: 2 additions & 7 deletions bin/plotting/pycbc_plot_waveform
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,15 @@
"""

# imports
import sys, argparse, matplotlib, numpy, math
import sys, argparse, matplotlib, numpy
matplotlib.use('Agg')
import matplotlib.pyplot as plt
from mpl_toolkits.axes_grid1.inset_locator import zoomed_inset_axes
from mpl_toolkits.axes_grid1.inset_locator import mark_inset

from pycbc import waveform, io
from pycbc import results
from pycbc import init_logging, add_common_pycbc_options
from pycbc.fft import ifft
from pycbc.types import complex_same_precision_as
from pycbc.types import TimeSeries, zeros, complex64
from pycbc.types import zeros, complex64

parser = argparse.ArgumentParser(usage='', description=__doc__)
add_common_pycbc_options(parser)
Expand Down Expand Up @@ -157,8 +154,6 @@ if tmplt_length > 1.:
x_zoom_fac*template_td.sample_times.max()])
axins.get_xaxis().set_ticks([])
axins.get_yaxis().set_ticks([])
# Can't get this to work for what I'm doing :-(
#mark_inset(ax, axins, loc1=1, loc2=3, fc="none", ec="0.5")

plt.subplot(2,1,2)
plt.plot(template.sample_frequencies, abs(template))
Expand Down

0 comments on commit ec7e3b0

Please sign in to comment.