Skip to content

Commit

Permalink
Merge pull request #126 from sot/pep8
Browse files Browse the repository at this point in the history
PEP8 / flake8 fixes
  • Loading branch information
taldcroft authored Sep 20, 2019
2 parents eb0d6c1 + 47374ab commit 5ebec65
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 12 deletions.
2 changes: 1 addition & 1 deletion sparkles/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
__version__ = '4.3'

from .core import run_aca_review, ACAReviewTable
from .core import run_aca_review, ACAReviewTable # noqa


def test(*args, **kwargs):
Expand Down
10 changes: 4 additions & 6 deletions sparkles/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

import matplotlib

matplotlib.use('Agg')
matplotlib.use('Agg') # noqa
import matplotlib.pyplot as plt
from matplotlib.patches import Circle

Expand Down Expand Up @@ -174,7 +174,7 @@ def _run_aca_review(load_name=None, *, acars=None, make_html=True, report_dir=No
if roll_level == 'all' or aca.messages >= roll_level:
try:
aca.get_roll_options() # sets roll_options, roll_info attributes
except Exception: # as err:
except Exception: # as err:
err = traceback.format_exc()
aca.add_message('critical', text=f'Running get_roll_options() failed: \n{err}')
aca.roll_options = None
Expand Down Expand Up @@ -607,7 +607,7 @@ def plot(self, ax=None, **kwargs):

# Draw a circle at 735 pixels showing extent of CCD corners
circle = Circle((0, 0), radius=735, facecolor='none',
edgecolor='g', alpha=0.5, lw=3)
edgecolor='g', alpha=0.5, lw=3)
ax.add_patch(circle)

# Plot a circle around stars that were not already candidates
Expand Down Expand Up @@ -849,7 +849,7 @@ def sign(axis):
# }

def add_message(self, category, text, **kwargs):
"""Add message to internal messages list.
r"""Add message to internal messages list.
:param category: message category ('info', 'caution', 'warning', 'critical')
:param text: message text
Expand Down Expand Up @@ -916,7 +916,6 @@ def check_guide_count(self):
msg += f' (likely MON star, check OR list)'
self.add_message('caution', msg)


def check_pos_err_guide(self, star):
"""Warn on stars with larger POS_ERR (warning at 1" critical at 2")
Expand Down Expand Up @@ -972,7 +971,6 @@ def check_too_bright_guide(self, star):
agasc_id = star['id']
idx = self.get_id(agasc_id)['idx']
mag_err = star['mag_err']
mag_aca_err = star['MAG_ACA_ERR'] * 0.01
for mult, category in ((2, 'critical'),
(3, 'caution')):
if star['mag'] - (mult * mag_err) < 5.8:
Expand Down
7 changes: 3 additions & 4 deletions sparkles/roll_optimize.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@
from astropy.table import Table, vstack
from chandra_aca.star_probs import acq_success_prob, guide_count
from chandra_aca.transform import (radec_to_yagzag, yagzag_to_pixels,
calc_aca_from_targ, calc_targ_from_aca,
snr_mag_for_t_ccd)
calc_aca_from_targ, calc_targ_from_aca)
from Quaternion import Quat

from proseco.characteristics import CCD
Expand Down Expand Up @@ -222,8 +221,8 @@ def get_ids_list(roll_offsets):
for uniq_ids in uniq_ids_sets:
# print(uniq_ids - ids0, ids0 - uniq_ids)
# for sid in uniq_ids - ids0:
# star = self.stars.get_id(sid)
# print(f'{sid} {star["mag"]} {star["yang"]} {star["zang"]}')
# star = self.stars.get_id(sid)
# print(f'{sid} {star["mag"]} {star["yang"]} {star["zang"]}')

# This says that ``uniq_ids`` is a subset of available ``ids`` in
# FOV for roll_offset in the list comprehension below. So everywhere
Expand Down
1 change: 0 additions & 1 deletion sparkles/tests/test_checks.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
# Licensed under a 3-clause BSD style license - see LICENSE.rst
import numpy as np
import agasc
import numpy as np

from chandra_aca.transform import mag_to_count_rate
from proseco import get_aca_catalog
Expand Down

0 comments on commit 5ebec65

Please sign in to comment.