Commit bff6023d authored by Gregory Ashton's avatar Gregory Ashton

Add check for test in plot_data to avoid generating plots in tests

parent d38231ac
Pipeline #23153 passed with stages
in 12 minutes and 27 seconds
......@@ -7,6 +7,8 @@ import corner
import matplotlib
import matplotlib.pyplot as plt
from tupak.core import utils
def result_file_name(outdir, label):
""" Returns the standard filename used for a result file
......@@ -214,6 +216,8 @@ class Result(dict):
A matplotlib figure instance
"""
if utils.command_line_args.test:
return
defaults_kwargs = dict(
bins=50, smooth=0.9, label_kwargs=dict(fontsize=16),
......@@ -266,6 +270,9 @@ class Result(dict):
logging.warning("Cannot plot_walkers as no walkers are saved")
return
if utils.command_line_args.test:
return
nwalkers, nsteps, ndim = self.walkers.shape
idxs = np.arange(nsteps)
fig, axes = plt.subplots(nrows=ndim, figsize=(6, 3*ndim))
......
......@@ -955,6 +955,9 @@ class Interferometer(object):
header='f h(f)')
def plot_data(self, signal=None, outdir='.', label=None):
if utils.command_line_args.test:
return
fig, ax = plt.subplots()
ax.loglog(self.frequency_array,
np.abs(self.frequency_domain_strain),
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment