Skip to content

Commit 8cd8100

Browse files
Merge pull request #44 from MatthewSZhang/minibatch-doc
BUG fix pruning doc
2 parents 80f08cd + 73d9753 commit 8cd8100

File tree

4 files changed

+177
-117
lines changed

4 files changed

+177
-117
lines changed

.github/workflows/ci.yml

Lines changed: 4 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -8,64 +8,17 @@ on:
88
branches: ["main"]
99

1010
jobs:
11-
test:
12-
runs-on: ubuntu-latest
13-
14-
steps:
15-
- uses: actions/checkout@v4
16-
- uses: prefix-dev/[email protected]
17-
with:
18-
environments: default
19-
cache: true
20-
21-
- name: Re-install local
22-
run: |
23-
pixi run rebuild
24-
25-
- name: Lint with ruff
26-
run: |
27-
pixi run lint
28-
- name: Lint with cython-lint
29-
run: |
30-
pixi run cython-lint
31-
- name: Format with black
32-
run: |
33-
pixi run fmt
34-
- name: Type check with mypy
35-
run: |
36-
pixi run type
37-
- name: Test with pytest
38-
run: |
39-
pixi run test
40-
- name: Test with doctest
41-
shell: bash
42-
run: |
43-
pixi run doc
44-
CMD=doctest pixi run doc
45-
- name: Test coverage
46-
shell: bash
47-
run: |
48-
FMT=xml pixi run test-coverage
49-
- name: Upload coverage reports to Codecov
50-
uses: codecov/codecov-action@v5
51-
with:
52-
token: ${{ secrets.CODECOV_TOKEN }}
53-
- name: Build SDist
54-
run: |
55-
pixi run build-sdist
56-
- name: Store artifacts
57-
uses: actions/upload-artifact@v4
58-
with:
59-
name: cibw-sdist
60-
path: dist/*.tar.gz
11+
call-test:
12+
uses: ./.github/workflows/test.yml
13+
secrets: inherit
6114

6215
build:
6316
strategy:
6417
fail-fast: false
6518
matrix:
6619
os: [ubuntu-latest, windows-latest, macos-latest]
6720
runs-on: ${{ matrix.os }}
68-
needs: test
21+
needs: call-test
6922
steps:
7023
- uses: actions/checkout@v4
7124
- name: Build wheels

.github/workflows/test.yml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: Test
2+
3+
on:
4+
workflow_call:
5+
push:
6+
branches: [ "main", "*.X" ]
7+
pull_request:
8+
branches: [ "main", "*.X" ]
9+
10+
jobs:
11+
test:
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- uses: actions/checkout@v4
16+
- uses: prefix-dev/[email protected]
17+
with:
18+
environments: default
19+
cache: true
20+
21+
- name: Re-install local
22+
run: |
23+
pixi run rebuild
24+
25+
- name: Lint with ruff
26+
run: |
27+
pixi run lint
28+
- name: Lint with cython-lint
29+
run: |
30+
pixi run cython-lint
31+
- name: Format with black
32+
run: |
33+
pixi run fmt
34+
- name: Type check with mypy
35+
run: |
36+
pixi run type
37+
- name: Test with pytest
38+
run: |
39+
pixi run test
40+
- name: Test with doctest
41+
shell: bash
42+
run: |
43+
pixi run doc
44+
CMD=doctest pixi run doc
45+
- name: Test coverage
46+
shell: bash
47+
run: |
48+
FMT=xml pixi run test-coverage
49+
- name: Upload coverage reports to Codecov
50+
uses: codecov/codecov-action@v5
51+
with:
52+
token: ${{ secrets.CODECOV_TOKEN }}
53+
- name: Build SDist
54+
run: |
55+
pixi run build-sdist
56+
- name: Store artifacts
57+
uses: actions/upload-artifact@v4
58+
with:
59+
name: cibw-sdist
60+
path: dist/*.tar.gz

examples/plot_pruning.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ def _fastcan_pruning(
7272
).fit(X)
7373
atoms = kmeans.cluster_centers_
7474
ids_fastcan = minibatch(
75-
X.T, atoms.T, n_samples_to_select, batch_size=batch_size, tol=1e-6, verbose=0
75+
X.T, atoms.T, n_samples_to_select, batch_size=batch_size, tol=1e-9, verbose=0
7676
)
7777
pruned_lr = LogisticRegression(max_iter=110).fit(X[ids_fastcan], y[ids_fastcan])
7878
return pruned_lr.coef_, pruned_lr.intercept_

0 commit comments

Comments
 (0)