Skip to content
Snippets Groups Projects
Commit 82dee4a1 authored by Jameson Graef Rollins's avatar Jameson Graef Rollins
Browse files

don't import matplotlib at all if not plotting

parent d7984940
No related branches found
No related tags found
No related merge requests found
Pipeline #29229 passed
......@@ -111,6 +111,18 @@ def main():
ifo = precompIFO(ifo)
print(ifo.to_txt(), end='')
return
if args.plot:
if args.save:
# FIXME: this silliness seems to be the only way to have
# matplotlib usable on systems without a display. There must
# be a better way. 'AGG' is a backend that works without
# displays. but it has to be set before any other matplotlib
# stuff is imported. and we *don't* want it set if we do want
# to show an interactive plot. there doesn't seem a way to
# set this opportunistically.
import matplotlib
matplotlib.use('AGG')
from matplotlib import pyplot as plt
if args.matlab:
gwinc = gwinc_matlab.gwinc_matlab
......@@ -135,18 +147,6 @@ def main():
v = float(v)
range_params[p] = v
if args.save:
# FIXME: this silliness seems to be the only way to have
# matplotlib usable on systems without a display. There must
# be a better way. 'AGG' is a backend that works without
# displays. but it has to be set before any other matplotlib
# stuff is imported. and we *don't* want it set if we do want
# to show an interactive plot. there doesn't seem a way to
# set this opportunistically.
import matplotlib
matplotlib.use('AGG')
from matplotlib import pyplot as plt
##########
# main calculations
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment