Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 22 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,29 @@ jobs:
call-test:
uses: ./.github/workflows/test.yml
secrets: inherit

build-sdist:
runs-on: ubuntu-latest
needs: call-test
steps:
- uses: actions/checkout@v4
- uses: prefix-dev/[email protected]
with:
environments: dev
cache: true
- name: Re-install local
run: |
pixi reinstall -e dev --frozen fastcan
- name: Build SDist
run: |
pixi run build-sdist
- name: Store artifacts
uses: actions/upload-artifact@v4
with:
name: cibw-sdist
path: dist/*.tar.gz

build:
build-wheels:
strategy:
fail-fast: false
matrix:
Expand Down
48 changes: 0 additions & 48 deletions .github/workflows/lint.yml

This file was deleted.

32 changes: 32 additions & 0 deletions .github/workflows/static.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Static

on:
workflow_call:

jobs:
static:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: prefix-dev/[email protected]
with:
environments: static
cache: true

- name: Re-install local
run: |
pixi reinstall -e static --frozen fastcan

- name: Linter
run: |
pixi run lint
- name: Lint Cython
run: |
pixi run cython-lint
- name: Formatter
run: |
pixi run fmt
- name: Type check
run: |
pixi run type
15 changes: 12 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ on:

jobs:
call-lint:
uses: ./.github/workflows/lint.yml
secrets: inherit
uses: ./.github/workflows/static.yml

test:
strategy:
Expand All @@ -23,7 +22,7 @@ jobs:
- uses: actions/checkout@v4
- uses: prefix-dev/[email protected]
with:
environments: default
environments: dev
cache: true

- name: Re-install local
Expand All @@ -44,3 +43,13 @@ jobs:
- name: Test nogil
run: |
pixi run nogil-eta
- name: Test coverage
if: runner.os == 'Linux'
shell: bash
run: |
FMT=xml pixi run test-coverage
- name: Upload coverage reports to Codecov
if: runner.os == 'Linux'
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
2 changes: 1 addition & 1 deletion examples/plot_narx_msa.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def auto_duffing_equation(y, t):

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

# %%
# One-step-head VS. multi-step-ahead NARX
Expand Down
4 changes: 2 additions & 2 deletions examples/plot_speed.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,12 +178,12 @@ def baseline(X, y, t):
time_eta = np.zeros(n_features_max, dtype=float)
for i in range(n_features_max):
time_h[i] = timeit(
f"s = FastCan({i+1}, verbose=0).fit(X, y)",
f"s = FastCan({i + 1}, verbose=0).fit(X, y)",
number=10,
globals=globals(),
)
time_eta[i] = timeit(
f"s = FastCan({i+1}, eta=True, verbose=0).fit(X, y)",
f"s = FastCan({i + 1}, eta=True, verbose=0).fit(X, y)",
number=10,
globals=globals(),
)
Expand Down
2 changes: 1 addition & 1 deletion fastcan/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@

__all__ = [
"FastCan",
"refine",
"minibatch",
"narx",
"refine",
"utils",
]
2 changes: 1 addition & 1 deletion fastcan/_fastcan.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
from sklearn.utils._param_validation import Interval
from sklearn.utils.validation import check_is_fitted, validate_data

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


class FastCan(SelectorMixin, BaseEstimator):
Expand Down
2 changes: 1 addition & 1 deletion fastcan/_minibatch.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from sklearn.utils._param_validation import Interval, validate_params
from sklearn.utils.validation import check_X_y

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


Expand Down
2 changes: 1 addition & 1 deletion fastcan/_refine.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from sklearn.utils._param_validation import Interval, StrOptions, validate_params
from sklearn.utils.validation import check_is_fitted

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


Expand Down
6 changes: 5 additions & 1 deletion fastcan/narx.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,11 @@
)

from ._fastcan import FastCan
from ._narx_fast import _predict_step, _update_cfd, _update_terms # type: ignore
from ._narx_fast import ( # type: ignore[attr-defined]
_predict_step,
_update_cfd,
_update_terms,
)
from ._refine import refine
from .utils import mask_missing_values

Expand Down
Loading