Skip to content

Commit 7e89c2a

Browse files
authored
Merge pull request #576 from light-curve/copilot/replace-black-with-ruff-formatter
Replace black with ruff formatter in pre-commit
2 parents 3ef2535 + 86853a3 commit 7e89c2a

File tree

4 files changed

+3
-11
lines changed

4 files changed

+3
-11
lines changed

.pre-commit-config.yaml

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,18 +17,13 @@ repos:
1717
# Python
1818
- id: check-docstring-first # checks a common error of defining a docstring after code
1919
- id: debug-statements # checks for debugger imports and py37+ `breakpoint()` calls in python source
20-
# Ruff should go before black, because its output is not formatted
2120
- repo: https://github.com/astral-sh/ruff-pre-commit
2221
rev: 'v0.14.4'
2322
hooks:
2423
- id: ruff
2524
args: [--fix, --exit-non-zero-on-fix]
26-
- repo: https://github.com/psf/black-pre-commit-mirror
27-
rev: 25.11.0
28-
hooks:
29-
- id: black
30-
name: black
31-
args: ['--config=./light-curve/pyproject.toml', './light-curve']
25+
- id: ruff-format
26+
args: ['--config=./light-curve/pyproject.toml', './light-curve']
3227
- repo: local
3328
hooks:
3429
- id: cargo-fmt

light-curve/light_curve/light_curve_py/minuit_ml.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ def logcdf(x):
7777
result = np.zeros(len(x))
7878

7979
idx = x < -5
80-
result[idx] = -x[idx] ** 2 / 2 - 1 / x[idx] ** 2 - 0.9189385336 - np.log(-x[idx])
80+
result[idx] = -(x[idx] ** 2) / 2 - 1 / x[idx] ** 2 - 0.9189385336 - np.log(-x[idx])
8181
result[~idx] = np.log(0.5) + np.log1p(erf(x[~idx] / np.sqrt(2)))
8282

8383
return result

light-curve/pyproject.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ dev = [
6060
"cesium",
6161
"joblib",
6262
"pandas",
63-
"black",
6463
"ruff",
6564
]
6665
# cesium and iminuit don't support free-threading yet
@@ -73,7 +72,6 @@ dev-free-threading = [
7372
"scipy",
7473
"joblib",
7574
"pandas",
76-
"black",
7775
"ruff",
7876
]
7977

light-curve/tests/light_curve_py/features/test_rainbow.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,6 @@ def test_noisy_all_functions_combination():
8282

8383
for idx_b in range(len(bolometric_names)):
8484
for idx_t in range(len(temperature_names)):
85-
8685
expected = [*bolometric_params[idx_b], *temperature_params[idx_t], 1.0]
8786

8887
feature = RainbowFit.from_angstrom(

0 commit comments

Comments
 (0)