Skip to content

Commit bc9fdf4

Browse files
Merge pull request #83 from MatthewSZhang/ruff-formatter
MNT black to ruff
2 parents a88a460 + 6cb7173 commit bc9fdf4

20 files changed

+409
-409
lines changed

.github/workflows/ci.yml

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,29 @@ jobs:
1111
call-test:
1212
uses: ./.github/workflows/test.yml
1313
secrets: inherit
14+
15+
build-sdist:
16+
runs-on: ubuntu-latest
17+
needs: call-test
18+
steps:
19+
- uses: actions/checkout@v4
20+
- uses: prefix-dev/[email protected]
21+
with:
22+
environments: dev
23+
cache: true
24+
- name: Re-install local
25+
run: |
26+
pixi reinstall -e dev --frozen fastcan
27+
- name: Build SDist
28+
run: |
29+
pixi run build-sdist
30+
- name: Store artifacts
31+
uses: actions/upload-artifact@v4
32+
with:
33+
name: cibw-sdist
34+
path: dist/*.tar.gz
1435

15-
build:
36+
build-wheels:
1637
strategy:
1738
fail-fast: false
1839
matrix:

.github/workflows/lint.yml

Lines changed: 0 additions & 48 deletions
This file was deleted.

.github/workflows/static.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Static
2+
3+
on:
4+
workflow_call:
5+
6+
jobs:
7+
static:
8+
runs-on: ubuntu-latest
9+
10+
steps:
11+
- uses: actions/checkout@v4
12+
- uses: prefix-dev/[email protected]
13+
with:
14+
environments: static
15+
cache: true
16+
17+
- name: Re-install local
18+
run: |
19+
pixi reinstall -e static --frozen fastcan
20+
21+
- name: Linter
22+
run: |
23+
pixi run lint
24+
- name: Lint Cython
25+
run: |
26+
pixi run cython-lint
27+
- name: Formatter
28+
run: |
29+
pixi run fmt
30+
- name: Type check
31+
run: |
32+
pixi run type

.github/workflows/test.yml

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@ on:
99

1010
jobs:
1111
call-lint:
12-
uses: ./.github/workflows/lint.yml
13-
secrets: inherit
12+
uses: ./.github/workflows/static.yml
1413

1514
test:
1615
strategy:
@@ -23,7 +22,7 @@ jobs:
2322
- uses: actions/checkout@v4
2423
- uses: prefix-dev/[email protected]
2524
with:
26-
environments: default
25+
environments: dev
2726
cache: true
2827

2928
- name: Re-install local
@@ -44,3 +43,13 @@ jobs:
4443
- name: Test nogil
4544
run: |
4645
pixi run nogil-eta
46+
- name: Test coverage
47+
if: runner.os == 'Linux'
48+
shell: bash
49+
run: |
50+
FMT=xml pixi run test-coverage
51+
- name: Upload coverage reports to Codecov
52+
if: runner.os == 'Linux'
53+
uses: codecov/codecov-action@v5
54+
with:
55+
token: ${{ secrets.CODECOV_TOKEN }}

examples/plot_narx_msa.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ def auto_duffing_equation(y, t):
9393

9494
sol = odeint(duffing_equation, [0.6, -0.8], t)
9595
u_test = 2.5 * np.cos(2 * np.pi * t).reshape(-1, 1)
96-
y_test = sol[:, 0]+ e_test
96+
y_test = sol[:, 0] + e_test
9797

9898
# %%
9999
# One-step-head VS. multi-step-ahead NARX

examples/plot_speed.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,12 +178,12 @@ def baseline(X, y, t):
178178
time_eta = np.zeros(n_features_max, dtype=float)
179179
for i in range(n_features_max):
180180
time_h[i] = timeit(
181-
f"s = FastCan({i+1}, verbose=0).fit(X, y)",
181+
f"s = FastCan({i + 1}, verbose=0).fit(X, y)",
182182
number=10,
183183
globals=globals(),
184184
)
185185
time_eta[i] = timeit(
186-
f"s = FastCan({i+1}, eta=True, verbose=0).fit(X, y)",
186+
f"s = FastCan({i + 1}, eta=True, verbose=0).fit(X, y)",
187187
number=10,
188188
globals=globals(),
189189
)

fastcan/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313

1414
__all__ = [
1515
"FastCan",
16-
"refine",
1716
"minibatch",
1817
"narx",
18+
"refine",
1919
"utils",
2020
]

fastcan/_fastcan.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
from sklearn.utils._param_validation import Interval
1818
from sklearn.utils.validation import check_is_fitted, validate_data
1919

20-
from ._cancorr_fast import _forward_search # type: ignore
20+
from ._cancorr_fast import _forward_search # type: ignore[attr-defined]
2121

2222

2323
class FastCan(SelectorMixin, BaseEstimator):

fastcan/_minibatch.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
from sklearn.utils._param_validation import Interval, validate_params
1414
from sklearn.utils.validation import check_X_y
1515

16-
from ._cancorr_fast import _forward_search # type: ignore
16+
from ._cancorr_fast import _forward_search # type: ignore[attr-defined]
1717
from ._fastcan import _prepare_search
1818

1919

fastcan/_refine.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
from sklearn.utils._param_validation import Interval, StrOptions, validate_params
1414
from sklearn.utils.validation import check_is_fitted
1515

16-
from ._cancorr_fast import _forward_search # type: ignore
16+
from ._cancorr_fast import _forward_search # type: ignore[attr-defined]
1717
from ._fastcan import FastCan, _prepare_search
1818

1919

0 commit comments

Comments
 (0)