Skip to content

Commit

Permalink
Merge pull request #237 from neutrinoceros/sty/black_to_ruff
Browse files Browse the repository at this point in the history
STY: migrate formatting from black to ruff
  • Loading branch information
neutrinoceros authored Feb 11, 2025
2 parents f8a0061 + 13359d9 commit 3ccae0d
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 19 deletions.
10 changes: 3 additions & 7 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,22 +24,18 @@ repos:
hooks:
- id: remove-tabs

- repo: https://github.com/psf/black-pre-commit-mirror
rev: 24.10.0
hooks:
- id: black

- repo: https://github.com/asottile/blacken-docs
rev: 1.19.1
hooks:
- id: blacken-docs
additional_dependencies: [black==23.9.1]
additional_dependencies: [black==25.1.0]

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.9.2
hooks:
- id: ruff-format
- id: ruff
args: [--fix]
args: [--fix, --show-fixes]

- repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks
rev: v2.14.0
Expand Down
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
[![CI (bleeding edge)](https://github.com/SAIL-Labs/AMICAL/actions/workflows/bleeding-edge.yaml/badge.svg)](https://github.com/SAIL-Labs/AMICAL/actions/workflows/bleeding-edge.yaml)
[![pre-commit.ci status](https://results.pre-commit.ci/badge/github/SAIL-Labs/AMICAL/main.svg)](https://results.pre-commit.ci/latest/github/SAIL-Labs/AMICAL/main)

[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/charliermarsh/ruff/main/assets/badge/v2.json)](https://github.com/charliermarsh/ruff)

## Installation
Expand Down
2 changes: 1 addition & 1 deletion amical/data_processing.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ def select_data(cube, clip_fact=0.5, clip=False, verbose=True, display=True):
else:
rprint("[cyan]\n---- centered fluxes selection ---")
print(
f"{n_bad}/{len(cube)} ({100*n_bad/len(cube):2.1f}%) are flagged as bad frames"
f"{n_bad}/{len(cube)} ({100 * n_bad / len(cube):2.1f}%) are flagged as bad frames"
)
return cube_cleaned_checked

Expand Down
13 changes: 4 additions & 9 deletions amical/externals/candid/candid.py
Original file line number Diff line number Diff line change
Expand Up @@ -531,9 +531,7 @@ def _V2binFast(uv, param):
v2[i] += (t_vr*t_vr + t_vi*t_vi) / Nsmear;
}
}
}""".replace(
"VUDX", _get_VUDX
)
}""".replace("VUDX", _get_VUDX)
err = weave.inline(
code,
[
Expand Down Expand Up @@ -760,9 +758,7 @@ def _T3binFast(uv, param):
}
}
}""".replace(
"VUDX", _get_VUDX
)
}""".replace("VUDX", _get_VUDX)
err = weave.inline(
code,
[
Expand Down Expand Up @@ -1537,9 +1533,8 @@ def testInst(h):
)
self.all_dwavel[hdu.header["INSNAME"]] = hdu.data["EFF_BAND"] * 1e6

self.all_dwavel[
hdu.header["INSNAME"]
] *= 2.0 # assume the limit is not the pixel
# assume the limit is not the pixel
self.all_dwavel[hdu.header["INSNAME"]] *= 2.0
self.dwavel[hdu.header["INSNAME"]] = np.mean(
self.all_dwavel[hdu.header["INSNAME"]]
)
Expand Down
2 changes: 1 addition & 1 deletion amical/mf_pipeline/bispect.py
Original file line number Diff line number Diff line change
Expand Up @@ -1372,5 +1372,5 @@ def extract_bs(
produce_result_pdf(save_to, Path(filename).stem)

if verbose:
rprint(f"[magenta]\nDone (exec time: {m} min {t - m*60:2.1f} s).")
rprint(f"[magenta]\nDone (exec time: {m} min {t - m * 60:2.1f} s).")
return dict2class(obs_result)

0 comments on commit 3ccae0d

Please sign in to comment.