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

PEP8 cleanup

parent 02e8f5c1
No related branches found
Tags 0.16
No related merge requests found
......@@ -2,7 +2,6 @@ import os
import sys
import argparse
import logging
import signal
from . import __version__, set_signal_handlers
from . import config
......
import glob
import os
import glob
import numpy as np
from contextlib import closing
import logging
......@@ -30,7 +30,6 @@ def nds_connection():
def nds_fetch(channels, start, stop):
args = [start, stop, channels]
with closing(nds_connection()) as conn:
bufs = conn.fetch(start, stop, channels)
return [ChannelBuf.from_nds(buf) for buf in bufs]
......
......@@ -339,8 +339,7 @@ class LocklossEvent(object):
self.__refined_gps = float(gps)
if np.isnan(self.__refined_gps):
return None
else:
return self.__refined_gps
return self.__refined_gps
@property
def previous_state(self):
......
import os
import argparse
import logging
import signal
from . import set_signal_handlers
from . import config
......@@ -79,7 +78,8 @@ def main(args=None):
elif args.cmd == 'start':
ojobs, ajobs = condor.find_jobs()
assert not ojobs, "There are already currently acitve jobs:\n{}".format('\n'.join([job_str(job) for job in ojobs]))
assert not ojobs, "There are already currently acitve jobs:\n{}".format(
'\n'.join([condor.job_str(job) for job in ojobs]))
start_job()
elif args.cmd in ['stop', 'restart']:
......
import os
import io
import sys
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.dates as dates
import xml.etree.ElementTree as ET
......
import matplotlib.pyplot as plt
def set_thresh_crossing(ax, thresh_crossing, gps, segment):
""" Plots and annotates vertical position of threshold crossing. """
"""Plots and annotates vertical position of threshold crossing.
"""
ax.axvline(
thresh_crossing-gps,
linestyle='--',
......@@ -21,8 +23,9 @@ def set_thresh_crossing(ax, thresh_crossing, gps, segment):
def set_rcparams():
""" Sets matplotlib parameters for followups. """
"""Sets matplotlib parameters for followups.
"""
plt.rcParams['font.size'] = 30
plt.rcParams['axes.titlesize'] = 30
plt.rcParams['axes.labelsize'] = 30
......
......@@ -24,18 +24,17 @@ def search_buf(buf, previous=None, event_callback=None):
"""
targets = [s[1] for s in config.GRD_LOCKLOSS_STATES]
lockloss_drmi, down = config.LOCKLOSS_DRMI, config.DOWN
nevents = 0
for time, pval, val in data.gen_transitions(buf, previous):
trans = (int(pval), int(val))
logging.debug("transition: {:0.3f} {}->{}".format(time, trans[0], trans[1]))
if val not in targets:
continue
# if pval == down:
# if pval == config.DOWN:
# trans = (int(ppval), int(val))
nevents += 1
logging.info("lockloss found: {} {}->{}".format(time, *trans))
if pval == lockloss_drmi:
if pval == config.LOCKLOSS_DRMI:
logging.info("ignoring DRMI lockloss")
continue
try:
......
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