Skip to content

Commit

Permalink
Annotate noqa
Browse files Browse the repository at this point in the history
  • Loading branch information
jeanconn committed Sep 12, 2024
1 parent b3513a9 commit bdee811
Show file tree
Hide file tree
Showing 16 changed files with 21 additions and 21 deletions.
2 changes: 1 addition & 1 deletion mica/archive/aca_dark/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# Licensed under a 3-clause BSD style license - see LICENSE.rst
from .dark_cal import * # noqa
from .dark_cal import *
2 changes: 1 addition & 1 deletion mica/archive/aca_dark/dark_cal.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from astropy.table import Column
from chandra_aca.aca_image import ACAImage
from chandra_aca.dark_model import (
DARK_SCALE_4C, # noqa
DARK_SCALE_4C, # noqa: F401 imported but unused
dark_temp_scale,
)
from cxotime import CxoTime
Expand Down
2 changes: 1 addition & 1 deletion mica/archive/aca_hdr3.py
Original file line number Diff line number Diff line change
Expand Up @@ -621,7 +621,7 @@ def __init__(self, msids, start, stop):
self.datestart = DateTime(self.tstart).date
self.datestop = DateTime(self.tstop).date
slot_datas = {}
slots = set(slot_for_msid(confirm_msid(msid)) for msid in msids) # noqa
slots = set(slot_for_msid(confirm_msid(msid)) for msid in msids) # noqa: C401 unnecessary generator
for slot in slots:
# get the 8x8 data
tstop = self.tstop + 33.0 # Major frame of padding
Expand Down
2 changes: 1 addition & 1 deletion mica/archive/aca_l0.py
Original file line number Diff line number Diff line change
Expand Up @@ -563,7 +563,7 @@ def _get_missing_archive_files(self, start, only_new=False):
logger.info("Checking for missing files from %s" % startdate)
# find the index in the cda archive list that matches
# the first entry with the "start" date
for idate, backcnt in zip(ingested_files["ingest_date"][::-1], count(1)): # noqa
for idate, backcnt in zip(ingested_files["ingest_date"][::-1], count(1)): # noqa: B007 backcnt not used in loop
if idate < startdate:
break

Expand Down
4 changes: 2 additions & 2 deletions mica/archive/asp_l1.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
from astropy.table import Table
from Quaternion import Quat

from mica.archive import asp_l1_proc, obsid_archive # noqa
from mica.archive import asp_l1_proc, obsid_archive # noqa: F401 imported but unused
from mica.common import MICA_ARCHIVE

# these columns are available in the headers of the fetched telemetry
Expand Down Expand Up @@ -284,7 +284,7 @@ def main():
archive = obsid_archive.ObsArchive(config)
archive.logger.setLevel(logging.INFO)
archive.logger.addHandler(logging.StreamHandler())
obsids = archive.update() # noqa
obsids = archive.update() # noqa: F841 assigned but not used


if __name__ == "__main__":
Expand Down
2 changes: 1 addition & 1 deletion mica/archive/cda/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
from .services import * # noqa
from .services import *
4 changes: 2 additions & 2 deletions mica/archive/tests/test_asp_l1.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from kadi import events
from Quaternion import Quat, normalize
from Ska.engarchive import fetch
from testr import test_helper # noqa
from testr import test_helper # noqa: F401 imported unused (but used by pytest)

from mica.archive import asp_l1, obsid_archive

Expand Down Expand Up @@ -89,7 +89,7 @@ def test_update_l1_archive(tmp_path):
config["obsid"] = 1
config["version"] = 4
archive = obsid_archive.ObsArchive(config)
obsids = archive.update() # noqa
obsids = archive.update() # noqa: F841 assigned but not used

with ska_dbi.DBI(dbi="sqlite", server=config["data_root"] / "archfiles.db3") as db:
dat = Table(db.fetchall("select * from archfiles"))
Expand Down
2 changes: 1 addition & 1 deletion mica/centroid_dashboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -869,7 +869,7 @@ def update_observed_metrics(

rows_obsid = []
rows_slots = []
for obsid in obsids: # noqa
for obsid in obsids: # noqa: PLR1704 redefining obsid
logger.info(f"Obsid={obsid}")
obs_dir = get_cd_dir(obsid, data_root)

Expand Down
6 changes: 3 additions & 3 deletions mica/quaternion.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ def _get_equatorial(self):
def _get_ra(self):
"""Retrieve RA term from equatorial system in degrees"""
if self._equatorial is None:
self.equatorial # noqa
self.equatorial # noqa: B018 useless expression
if self._equatorial.shape[0] == 1:
return self._equatorial[:, 0][0]
else:
Expand All @@ -241,7 +241,7 @@ def _get_ra(self):
def _get_dec(self):
"""Retrieve Dec term from equatorial system in degrees"""
if self._equatorial is None:
self.equatorial # noqa
self.equatorial # noqa: B018 useless expression
if self._equatorial.shape[0] == 1:
return self._equatorial[:, 1][0]
else:
Expand All @@ -250,7 +250,7 @@ def _get_dec(self):
def _get_roll(self):
"""Retrieve Roll term from equatorial system in degrees"""
if self._equatorial is None:
self.equatorial # noqa
self.equatorial # noqa: B018 useless expression
if self._equatorial.shape[0] == 1:
return self._equatorial[:, 2][0]
else:
Expand Down
4 changes: 2 additions & 2 deletions mica/report/report.py
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ def obs_links(obsid, sequence=None, plan=None):
dom = dtm.strftime("%d")
links["fot_daily"] = {
"label": "Daily Plots {}:{:03d}".format(year, int(doy)),
"link": "{root}/{year}/{upper_month}/{lower_month}{day_of_month:02d}_{doy:03d}/".format( # noqa
"link": "{root}/{year}/{upper_month}/{lower_month}{day_of_month:02d}_{doy:03d}/".format( # noqa: E501 line too long
root=DAILY_PLOT_ROOT,
year=year,
upper_month=month.upper(),
Expand Down Expand Up @@ -566,7 +566,7 @@ def main(obsid):
report_status = {}

er = summary is None and obsid > 40000
progress = all_progress["er" if er else "science"] # noqa
progress = all_progress["er" if er else "science"] # noqa: F841 variable never used
if er:
links = obs_links(obsid)
else:
Expand Down
2 changes: 1 addition & 1 deletion mica/starcheck/starcheck_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
# Original module has been moved over to the starcheck package.
# Keep this import here for back-compatibility.

from starcheck.parser import * # noqa
from starcheck.parser import * # noqa: F403 unable to detect undefined names
2 changes: 1 addition & 1 deletion mica/vv/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -1391,7 +1391,7 @@ def slot_checks(self):
self.checks = obi_slot_check

def slot_table(self):
checks = self.checks # noqa
checks = self.checks # noqa: F841 variable never used


# def set_disposition(self, disp):
Expand Down
2 changes: 1 addition & 1 deletion mica/web/admin.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Licensed under a 3-clause BSD style license - see LICENSE.rst
from django.contrib import admin # noqa
from django.contrib import admin # noqa: F401 imported by unused

# Register your models here.
2 changes: 1 addition & 1 deletion mica/web/models.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Licensed under a 3-clause BSD style license - see LICENSE.rst
from django.db import models # noqa
from django.db import models # noqa: F401 imported by unused

# Create your models here.
2 changes: 1 addition & 1 deletion mica/web/tests.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Licensed under a 3-clause BSD style license - see LICENSE.rst
from django.test import TestCase # noqa
from django.test import TestCase # noqa: F401 imported by unused

# Create your tests here.
2 changes: 1 addition & 1 deletion ruff.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ lint.extend-ignore = [
# "PLR0911", # Too many returns
"PLR0912", # Too many branches
"PLR0915", # Too many statements
"PGH004", # Use specific rule codes when using `noqa`
# "PGH004", # Use specific rule codes when using `noqa`
# "C401", # Unnecessary generator (rewrite as a `set` comprehension)
"C402", # Unnecessary generator (rewrite as a dict comprehension)
"C404", # Unnecessary `list` comprehension (rewrite as a `dict` comprehension)
Expand Down

0 comments on commit bdee811

Please sign in to comment.