Skip to content

Commit

Permalink
Changes for ruff 0.5.1
Browse files Browse the repository at this point in the history
  • Loading branch information
taldcroft committed Jul 7, 2024
1 parent 57aa996 commit 3c6f2ea
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.1.5
rev: v0.5.1
hooks:
# Run the linter.
- id: ruff
Expand Down
2 changes: 1 addition & 1 deletion agasc/supplement/magnitudes/mag_estimate.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import numpy as np
import scipy.special
import scipy.stats
import Ska.quatutil
from astropy.table import Table, vstack
from Chandra.Time import DateTime
from chandra_aca.transform import count_rate_to_mag, pixels_to_yagzag
Expand All @@ -21,7 +22,6 @@
from mica.archive.aca_dark.dark_cal import get_dark_cal_image
from Quaternion import Quat

import Ska.quatutil
from agasc import get_star

from . import star_obs_catalogs
Expand Down
10 changes: 5 additions & 5 deletions agasc/supplement/magnitudes/mag_estimate_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -289,9 +289,9 @@ def multi_star_html(
agasc_stats["t_mean_dr3"] - agasc_stats["mag_aca"]
) / agasc_stats["mag_aca_err"]
agasc_stats["new"] = True
agasc_stats["new"][
np.in1d(agasc_stats["agasc_id"], updated_star_ids)
] = False
agasc_stats["new"][np.in1d(agasc_stats["agasc_id"], updated_star_ids)] = (
False
)
agasc_stats["update_mag_aca"] = np.nan
agasc_stats["update_mag_aca_err"] = np.nan
agasc_stats["last_obs"] = CxoTime(agasc_stats["last_obs_time"]).date
Expand Down Expand Up @@ -457,7 +457,7 @@ def plot_agasc_id_single(
timeline["std"] = np.nan
timeline["mag_mean"] = np.nan
timeline["mag_std"] = np.nan
for obsid in np.unique(timeline["obsid"]):
for obsid in np.unique(timeline["obsid"]): # noqa: PLR1704
sel = obs_stats["obsid"] == obsid
if draw_obs_mag_stats and np.any(sel):
timeline["mag_mean"][timeline["obsid"] == obsid] = obs_stats[sel][
Expand Down Expand Up @@ -825,7 +825,7 @@ def plot_flags(telemetry, ax=None, obsid=None):
all_ok = timeline["obs_ok"] & all_ok
flags = [("OBS not OK", ~timeline["obs_ok"])] + flags

for obsid in obsids:
for obsid in obsids: # noqa: PLR1704
limits[obsid] = (
timeline["x"][timeline["obsid"] == obsid].min(),
timeline["x"][timeline["obsid"] == obsid].max(),
Expand Down
1 change: 0 additions & 1 deletion agasc/supplement/magnitudes/star_obs_catalogs.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import numpy as np
import tables
import agasc
from astropy import table
from astropy.table import Table, join
from chandra_aca.transform import yagzag_to_pixels
Expand Down
1 change: 1 addition & 0 deletions ruff.toml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ lint.extend-ignore = [
extend-exclude = [
"docs",
"validate",
"*.ipynb",
]

[lint.pycodestyle]
Expand Down

0 comments on commit 3c6f2ea

Please sign in to comment.