Skip to content

Commit

Permalink
ruff format 0.9
Browse files Browse the repository at this point in the history
  • Loading branch information
taldcroft committed Jan 28, 2025
1 parent 038546c commit 351244a
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 21 deletions.
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 @@ -141,7 +141,7 @@ def _get_dark_cal_id_scalar(date, select="before", dark_cal_ids=None):
if ii < 0:
earliest = CxoTime(dark_cal_secs[0]).date[:8]
raise MissingDataError(
f"No dark cal found before {earliest}" f"(requested dark cal on {date})"
f"No dark cal found before {earliest}(requested dark cal on {date})"
)

try:
Expand Down
5 changes: 2 additions & 3 deletions mica/archive/cda/services.py
Original file line number Diff line number Diff line change
Expand Up @@ -430,8 +430,7 @@ def _get_cda_service_text(service, timeout=60, **params):

if not resp.ok:
raise RuntimeError(
f"got error {resp.status_code} for {resp.url}\n"
f"{html_to_text(resp.text)}"
f"got error {resp.status_code} for {resp.url}\n{html_to_text(resp.text)}"
)

return resp.text
Expand Down Expand Up @@ -630,7 +629,7 @@ def get_ocat_local(
# accurate enough for this application.
where = (
f"arccos(sin({ra * d2r})*sin(ra*{d2r}) + "
f"cos({ra * d2r})*cos(ra*{d2r})*cos({dec*d2r}-dec*{d2r}))"
f"cos({ra * d2r})*cos(ra*{d2r})*cos({dec * d2r}-dec*{d2r}))"
f"< {radius / 60 * d2r}"
)
where_parts.append(where)
Expand Down
16 changes: 8 additions & 8 deletions mica/centroid_dashboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -1182,7 +1182,7 @@ def make_html(row_obsid, rows_slot, obs_dir):

for row in t_slot:
string += f"""<tr>
<td align='right'>{row['slot']}</td>
<td align='right'>{row["slot"]}</td>
"""
if row["id"] < 100:
id_ = ""
Expand All @@ -1193,13 +1193,13 @@ def make_html(row_obsid, rows_slot, obs_dir):
)

string += f"""<td align='right'>{id_}</td>
<td align='right'>{row['type']}</td>
<td align='right'>{row['mag']}</td>
<td align='right'>{row['yang']}</td>
<td align='right'>{row['zang']}</td>
<td align='right'>{row['median_mag']:.3f}</td>
<td align='right'>{row['median_dy']:.2f}</td>
<td align='right'>{row['median_dz']:.2f}</td>
<td align='right'>{row["type"]}</td>
<td align='right'>{row["mag"]}</td>
<td align='right'>{row["yang"]}</td>
<td align='right'>{row["zang"]}</td>
<td align='right'>{row["median_mag"]:.3f}</td>
<td align='right'>{row["median_dy"]:.2f}</td>
<td align='right'>{row["median_dz"]:.2f}</td>
</tr>
"""
string += f"""</table>
Expand Down
6 changes: 3 additions & 3 deletions mica/report/report.py
Original file line number Diff line number Diff line change
Expand Up @@ -920,9 +920,9 @@ def save_state_in_db(obsid, notes):
del notes["last_sched"]

idcheck = db.fetchone(
"select * from report_proc "
"where obsid = '{}' "
"and report_version = '{}'".format(obsid, REPORT_VERSION)
"select * from report_proc where obsid = '{}' and report_version = '{}'".format(
obsid, REPORT_VERSION
)
)

if idcheck is None:
Expand Down
3 changes: 1 addition & 2 deletions mica/stats/update_acq_stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,7 @@ def get_options():
parser.add_argument(
"--email",
action="append",
help="email warning recipient, specify multiple times "
"for multiple recipients",
help="email warning recipient, specify multiple times for multiple recipients",
)
opt = parser.parse_args()
return opt
Expand Down
2 changes: 1 addition & 1 deletion mica/vv/process.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ def update(obsids=None):
logger.warn(f"Skipping obs:ver {obsid}:{obs['revision']}. Missing data")
continue
update_str = f"""UPDATE aspect_1_proc set vv_complete = {VV_VERSION}
where obsid = {obsid} and revision = {obs['revision']}"""
where obsid = {obsid} and revision = {obs["revision"]}"""

logger.info(update_str)
with ska_dbi.DBI(dbi="sqlite", server=FILES["asp1_proc_table"]) as db:
Expand Down
2 changes: 1 addition & 1 deletion mica/web/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def get_context_data(self, **kwargs):
context["gui_table"] = gui_table
reports_url = (
"https://cxc.cfa.harvard.edu/mta/ASPECT/agasc/supplement_reports/stars/"
f"{int(agasc_id//1e7):03d}/{agasc_id}/index.html"
f"{int(agasc_id // 1e7):03d}/{agasc_id}/index.html"
)
context["reports_url"] = reports_url
return context
Expand Down
3 changes: 1 addition & 2 deletions scripts/update_agasc_supplement.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,7 @@ def get_options(args=None):
"--bad-star-source",
type=int,
help=(
"Source identifier indicating provenance (default=max "
"existing source + 1)"
"Source identifier indicating provenance (default=max existing source + 1)"
),
)
parser.add_argument(
Expand Down

0 comments on commit 351244a

Please sign in to comment.