Skip to content

Commit f70439c

Browse files
[MNT] Fixing CI issues and separate doctests from regular CI runners (#2902)
* trying to fix CI stuff * use numba in codecov * try cov * no cov * doctest-plus * doctest-plus * addopts * dedicated doctest test * periodic
1 parent aee9fc9 commit f70439c

File tree

7 files changed

+104
-33
lines changed

7 files changed

+104
-33
lines changed

.github/actions/cpu_all_extras/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ runs:
1515
using: "composite"
1616
steps:
1717
- name: Install CPU TensorFlow
18-
if: ${{ runner.os == 'Linux' && inputs.python_version != '3.13' }}
18+
if: ${{ runner.os == 'Linux' && inputs.python_version != '3.13.5' }}
1919
uses: nick-fields/retry@v3
2020
with:
2121
timeout_minutes: 30

.github/workflows/periodic_tests.yml

Lines changed: 36 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ jobs:
163163
fail-fast: false
164164
matrix:
165165
os: [ ubuntu-24.04, macOS-14, windows-2022 ]
166-
python-version: [ "3.10", "3.11", "3.12", "3.13" ]
166+
python-version: [ "3.10", "3.11", "3.12", "3.13.5" ]
167167

168168
steps:
169169
- name: Checkout
@@ -178,7 +178,7 @@ jobs:
178178
if: runner.os == 'Linux'
179179
uses: pierotofy/set-swap-space@v1.0
180180
with:
181-
swap-size-gb: 10
181+
swap-size-gb: 8
182182

183183
- name: Use numba cache to set env variables but not restore cache
184184
uses: ./.github/actions/numba_cache
@@ -208,6 +208,40 @@ jobs:
208208
# Save cache with the current date (ENV set in numba_cache action)
209209
key: numba-pytest-${{ runner.os }}-${{ matrix.python-version}}-${{ env.CURRENT_DATE }}
210210

211+
doctests:
212+
runs-on: ubuntu-24.04
213+
214+
steps:
215+
- name: Checkout
216+
uses: actions/checkout@v4
217+
218+
- name: Setup Python 3.12
219+
uses: actions/setup-python@v5
220+
with:
221+
python-version: "3.12"
222+
223+
- if: ${{ github.event_name != 'pull_request' || !contains(github.event.pull_request.labels.*.name, 'no numba cache') }}
224+
name: Use numba cache to set env variables but not restore cache
225+
uses: ./.github/actions/numba_cache
226+
with:
227+
cache_name: "doctests"
228+
runner_os: ${{ runner.os }}
229+
python_version: "3.12"
230+
restore_cache: "false"
231+
232+
- name: Install aeon and dependencies
233+
uses: nick-fields/retry@v3
234+
with:
235+
timeout_minutes: 30
236+
max_attempts: 3
237+
command: python -m pip install .[all_extras,dev]
238+
239+
- name: Show dependencies
240+
run: python -m pip list
241+
242+
- name: Run tests
243+
run: python -m pytest -n logical --doctest-only
244+
211245
codecov:
212246
runs-on: ubuntu-24.04
213247

.github/workflows/pr_examples.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ jobs:
4141
runner_os: ${{ runner.os }}
4242
python_version: "3.12"
4343

44-
- uses: ./.github/actions/cpu_all_extras
44+
- name: Install aeon and dependencies
45+
uses: ./.github/actions/cpu_all_extras
4546
with:
4647
additional_extras: "dev,binder"
4748

.github/workflows/pr_pytest.yml

Lines changed: 38 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ jobs:
5555
fail-fast: false
5656
matrix:
5757
os: [ ubuntu-24.04, macOS-14, windows-2022 ]
58-
python-version: [ "3.10", "3.11", "3.12", "3.13" ]
58+
python-version: [ "3.10", "3.11", "3.12", "3.13.5" ]
5959
# skip python versions unless the PR has the 'full pytest actions' label
6060
pr-testing:
6161
- ${{ (github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'full pytest actions')) }}
@@ -76,7 +76,7 @@ jobs:
7676
if: runner.os == 'Linux'
7777
uses: pierotofy/set-swap-space@v1.0
7878
with:
79-
swap-size-gb: 10
79+
swap-size-gb: 8
8080

8181
- if: ${{ github.event_name != 'pull_request' || !contains(github.event.pull_request.labels.*.name, 'no numba cache') }}
8282
name: Restore numba cache
@@ -86,7 +86,8 @@ jobs:
8686
runner_os: ${{ runner.os }}
8787
python_version: ${{ matrix.python-version }}
8888

89-
- uses: ./.github/actions/cpu_all_extras
89+
- name: Install aeon and dependencies
90+
uses: ./.github/actions/cpu_all_extras
9091
with:
9192
python_version: ${{ matrix.python-version }}
9293
additional_extras: "dev"
@@ -98,6 +99,38 @@ jobs:
9899
# run the full test suit if a PR has the 'full pytest actions' label
99100
run: python -m pytest -n logical --prtesting ${{ github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'full pytest actions') }}
100101

102+
doctests:
103+
runs-on: ubuntu-24.04
104+
105+
steps:
106+
- name: Checkout
107+
uses: actions/checkout@v4
108+
109+
- name: Setup Python 3.12
110+
uses: actions/setup-python@v5
111+
with:
112+
python-version: "3.12"
113+
114+
- if: ${{ github.event_name != 'pull_request' || !contains(github.event.pull_request.labels.*.name, 'no numba cache') }}
115+
name: Restore numba cache
116+
uses: ./.github/actions/numba_cache
117+
with:
118+
cache_name: "doctests"
119+
runner_os: ${{ runner.os }}
120+
python_version: "3.12"
121+
122+
- name: Install aeon and dependencies
123+
uses: ./.github/actions/cpu_all_extras
124+
with:
125+
additional_extras: "dev"
126+
127+
- name: Show dependencies
128+
run: python -m pip list
129+
130+
- name: Run tests
131+
run: python -m pytest -n logical --doctest-only
132+
133+
101134
codecov:
102135
# run the code coverage job if a PR has the 'codecov actions' label
103136
if: ${{ github.event_name != 'pull_request' || contains(github.event.pull_request.labels.*.name, 'codecov actions') }}
@@ -116,7 +149,8 @@ jobs:
116149
- name: Disable Numba JIT
117150
run: echo "NUMBA_DISABLE_JIT=1" >> $GITHUB_ENV
118151

119-
- uses: ./.github/actions/cpu_all_extras
152+
- name: Install aeon and dependencies
153+
uses: ./.github/actions/cpu_all_extras
120154
with:
121155
additional_extras: "unstable_extras,dev"
122156

.github/workflows/release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ jobs:
5454
fail-fast: false
5555
matrix:
5656
os: [ ubuntu-24.04, macOS-14, windows-2022 ]
57-
python-version: [ "3.10", "3.11", "3.12", "3.13" ]
57+
python-version: [ "3.10", "3.11", "3.12", "3.13.5" ]
5858

5959
steps:
6060
- name: Checkout
@@ -69,7 +69,7 @@ jobs:
6969
if: runner.os == 'Linux'
7070
uses: pierotofy/set-swap-space@v1.0
7171
with:
72-
swap-size-gb: 10
72+
swap-size-gb: 8
7373

7474
- uses: actions/download-artifact@v4
7575
with:

aeon/transformations/collection/dictionary_based/_borf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -615,7 +615,7 @@ def _sax(
615615
)
616616
global_std = np.std(a)
617617
if global_std == 0:
618-
return np.zeros((n_windows, word_length), dtype=np.uint8)
618+
return np.zeros((n_windows, word_length), dtype=np.uint16)
619619
seg_size = window_size // word_length
620620
n_windows = _get_n_windows(
621621
sequence_size=a.size, window_size=window_size, dilation=dilation, stride=stride
@@ -646,7 +646,7 @@ def _sax(
646646
sigma_global=global_std,
647647
sigma_threshold=min_window_to_signal_std_ratio,
648648
)
649-
return np.digitize(out, bins).astype(np.uint8)
649+
return np.digitize(out, bins).astype(np.uint16)
650650

651651

652652
@nb.njit(fastmath=True, cache=True)

pyproject.toml

Lines changed: 23 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -87,17 +87,16 @@ unstable_extras = [
8787

8888
# development dependencies
8989
dev = [
90-
"backoff",
91-
"httpx",
9290
"pre-commit",
9391
"pytest",
9492
"pytest-cov",
93+
"pytest-doctestplus",
9594
"pytest-mock",
9695
"pytest-randomly",
96+
"pytest-remotedata",
97+
"pytest-rerunfailures",
9798
"pytest-timeout",
9899
"pytest-xdist[psutil]",
99-
"pytest-rerunfailures",
100-
"wheel",
101100
]
102101
binder = [
103102
"notebook",
@@ -166,21 +165,24 @@ convention = "numpy"
166165
mypy_path = "aeon/"
167166

168167
[tool.pytest.ini_options]
169-
# ignore certain folders and pytest warnings
170168
testpaths = "aeon"
171-
addopts = '''
172-
--doctest-modules
173-
--durations 20
174-
--timeout 600
175-
--showlocals
176-
--dist worksteal
177-
--reruns 2
178-
--only-rerun "crashed while running"
179-
--only-rerun "zipfile.BadZipFile"
180-
--only-rerun "accessible `.keras` zip file."
181-
'''
182-
filterwarnings = '''
183-
ignore::UserWarning
184-
ignore:numpy.dtype size changed
185-
ignore:numpy.ufunc size changed
186-
'''
169+
doctest_optionflags = [
170+
"NORMALIZE_WHITESPACE",
171+
"ELLIPSIS",
172+
"FLOAT_CMP",
173+
]
174+
addopts = [
175+
"--durations=20",
176+
"--timeout=600",
177+
"--showlocals",
178+
"--dist=worksteal",
179+
"--reruns=3",
180+
"--reruns-delay=3",
181+
"--rerun-except=Error",
182+
"--rerun-except=Exception",
183+
]
184+
filterwarnings = [
185+
"ignore::UserWarning",
186+
"ignore:numpy.dtype size changed",
187+
"ignore:numpy.ufunc size changed",
188+
]

0 commit comments

Comments
 (0)