Skip to content

Commit fb3328b

Browse files
Tests and changes for 7.0.0 (#80)
* testing * versions * seql * cov * release * softdep * testing for latest sklearn * maybe mark * copy * copy * copy * more testing * examples and bounds * bad hints
1 parent 78d0eea commit fb3328b

29 files changed

+438
-158
lines changed

.github/workflows/periodic_tests.yml

+29-6
Original file line numberDiff line numberDiff line change
@@ -12,27 +12,50 @@ concurrency:
1212

1313
jobs:
1414
check-manifest:
15-
runs-on: ubuntu-20.04
15+
runs-on: ubuntu-24.04
1616

1717
steps:
1818
- uses: actions/checkout@v4
1919

2020
- uses: actions/setup-python@v5
2121
with:
22-
python-version: "3.10"
22+
python-version: "3.11"
2323

2424
- uses: pre-commit/[email protected]
2525
with:
2626
extra_args: check-manifest --hook-stage manual
2727

28+
test-no-soft-deps:
29+
runs-on: ubuntu-24.04
30+
31+
steps:
32+
- uses: actions/checkout@v4
33+
34+
- uses: actions/setup-python@v5
35+
with:
36+
python-version: "3.11"
37+
38+
- name: Install
39+
uses: nick-fields/retry@v3
40+
with:
41+
timeout_minutes: 30
42+
max_attempts: 3
43+
command: python -m pip install .[dev]
44+
45+
- name: Show dependencies
46+
run: python -m pip list
47+
48+
- name: Run tests
49+
run: python -m pytest -n logical
50+
2851
pytest:
2952
runs-on: ${{ matrix.os }}
3053

3154
strategy:
3255
fail-fast: false
3356
matrix:
34-
os: [ ubuntu-20.04, macos-14, windows-2022 ]
35-
python-version: [ "3.9", "3.10", "3.11", "3.12" ]
57+
os: [ ubuntu-24.04, macos-14, windows-2022 ]
58+
python-version: [ "3.9", "3.10", "3.11", "3.12", "3.13" ]
3659

3760
steps:
3861
- uses: actions/checkout@v4
@@ -55,14 +78,14 @@ jobs:
5578
run: python -m pytest -n logical
5679

5780
codecov:
58-
runs-on: ubuntu-20.04
81+
runs-on: ubuntu-24.04
5982

6083
steps:
6184
- uses: actions/checkout@v4
6285

6386
- uses: actions/setup-python@v5
6487
with:
65-
python-version: "3.10"
88+
python-version: "3.11"
6689

6790
- name: Disable Numba JIT
6891
run: echo "NUMBA_DISABLE_JIT=1" >> $GITHUB_ENV

.github/workflows/pr_precommit.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@ concurrency:
1414

1515
jobs:
1616
pre-commit:
17-
runs-on: ubuntu-20.04
17+
runs-on: ubuntu-24.04
1818

1919
steps:
2020
- uses: actions/checkout@v4
2121

2222
- uses: actions/setup-python@v5
2323
with:
24-
python-version: "3.10"
24+
python-version: "3.11"
2525

2626
- uses: tj-actions/changed-files@v46
2727
id: changed-files

.github/workflows/pr_pytest.yml

+30-5
Original file line numberDiff line numberDiff line change
@@ -17,20 +17,45 @@ concurrency:
1717
cancel-in-progress: true
1818

1919
jobs:
20+
test-no-soft-deps:
21+
runs-on: ubuntu-24.04
22+
23+
steps:
24+
- uses: actions/checkout@v4
25+
26+
- uses: actions/setup-python@v5
27+
with:
28+
python-version: "3.11"
29+
30+
- name: Install
31+
uses: nick-fields/retry@v3
32+
with:
33+
timeout_minutes: 30
34+
max_attempts: 3
35+
command: python -m pip install .[dev]
36+
37+
- name: Show dependencies
38+
run: python -m pip list
39+
40+
- name: Run tests
41+
run: python -m pytest -n logical
42+
2043
pytest:
2144
runs-on: ${{ matrix.os }}
2245

2346
strategy:
2447
fail-fast: false
2548
matrix:
26-
os: [ ubuntu-20.04, windows-2022 ]
27-
python-version: [ "3.9", "3.10", "3.11", "3.12" ]
49+
os: [ ubuntu-24.04, windows-2022 ]
50+
python-version: [ "3.9", "3.10", "3.11", "3.12", "3.13" ]
2851
# skip python versions unless the PR has the 'full pytest actions' label
2952
pr-testing:
3053
- ${{ (github.event_name != 'pull_request' || !contains(github.event.pull_request.labels.*.name, 'full pytest actions')) }}
3154
exclude:
3255
- pr-testing: true
3356
python-version: "3.10"
57+
- pr-testing: true
58+
python-version: "3.12"
3459

3560
steps:
3661
- uses: actions/checkout@v4
@@ -53,14 +78,14 @@ jobs:
5378
run: python -m pytest -n logical
5479

5580
codecov:
56-
runs-on: ubuntu-20.04
81+
runs-on: ubuntu-24.04
5782

5883
steps:
5984
- uses: actions/checkout@v4
6085

6186
- uses: actions/setup-python@v5
6287
with:
63-
python-version: "3.10"
88+
python-version: "3.11"
6489

6590
- name: Disable Numba JIT
6691
run: echo "NUMBA_DISABLE_JIT=1" >> $GITHUB_ENV
@@ -73,7 +98,7 @@ jobs:
7398
command: python -m pip install .[all_extras,dev,unstable_extras]
7499

75100
- name: Tests
76-
run: python -m pytest -n logical --cov=tsml_eval --cov-report=xml --timeout 1800
101+
run: python -m pytest -n logical --cov=tsml --cov-report=xml --timeout 1800
77102

78103
- uses: codecov/codecov-action@v5
79104
env:

.github/workflows/precommit_autoupdate.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@ on:
88

99
jobs:
1010
pre-commit-auto-update:
11-
runs-on: ubuntu-20.04
11+
runs-on: ubuntu-24.04
1212

1313
steps:
1414
- uses: actions/checkout@v4
1515

1616
- uses: actions/setup-python@v5
1717
with:
18-
python-version: "3.10"
18+
python-version: "3.11"
1919

2020
- uses: browniebroke/pre-commit-autoupdate-action@v1
2121

.github/workflows/release.yml

+12-8
Original file line numberDiff line numberDiff line change
@@ -8,29 +8,29 @@ on:
88

99
jobs:
1010
check-manifest:
11-
runs-on: ubuntu-20.04
11+
runs-on: ubuntu-24.04
1212

1313
steps:
1414
- uses: actions/checkout@v4
1515

1616
- uses: actions/setup-python@v5
1717
with:
18-
python-version: "3.10"
18+
python-version: "3.11"
1919

2020
- uses: pre-commit/[email protected]
2121
with:
2222
extra_args: check-manifest --hook-stage manual
2323

2424
build-project:
2525
needs: check-manifest
26-
runs-on: ubuntu-20.04
26+
runs-on: ubuntu-24.04
2727

2828
steps:
2929
- uses: actions/checkout@v4
3030

3131
- uses: actions/setup-python@v5
3232
with:
33-
python-version: "3.10"
33+
python-version: "3.11"
3434

3535
- name: Build project
3636
run: |
@@ -51,7 +51,7 @@ jobs:
5151

5252
strategy:
5353
matrix:
54-
os: [ ubuntu-20.04, macos-14, windows-2022 ]
54+
os: [ ubuntu-24.04, macos-14, windows-2022 ]
5555
python-version: [ "3.9", "3.10", "3.11", "3.12" ]
5656

5757
steps:
@@ -93,7 +93,13 @@ jobs:
9393

9494
upload-wheels:
9595
needs: test-wheels
96-
runs-on: ubuntu-20.04
96+
runs-on: ubuntu-24.04
97+
98+
environment:
99+
name: release
100+
url: https://pypi.org/p/tsml/
101+
permissions:
102+
id-token: write
97103

98104
steps:
99105
- uses: actions/download-artifact@v4
@@ -103,5 +109,3 @@ jobs:
103109

104110
- name: Publish package to PyPI
105111
uses: pypa/gh-action-pypi-publish@release/v1
106-
with:
107-
password: ${{ secrets.PYPI_TOKEN }}

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Please see [`tsml_eval`](https://github.com/time-series-machine-learning/tsml-ev
1616
is more of a sandbox for testing out new ideas and algorithms. It may contain some
1717
algorithms and implementations that are not available in the other toolkits.
1818

19-
The current release of `tsml` is v0.6.1.
19+
The current release of `tsml` is v0.7.0.
2020

2121
## Installation
2222

pyproject.toml

+6-4
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,16 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "tsml"
7-
version = "0.6.1"
8-
description = "A development sandbox for time series machine learning algorithms."
7+
version = "0.7.0"
8+
description = "A development sandbox for time series machine learning algorithms which dont fit into aeon."
99
authors = [
1010
{name = "Matthew Middlehurst", email = "[email protected]"},
1111
]
1212
maintainers = [
1313
{name = "Matthew Middlehurst", email = "[email protected]"},
1414
]
1515
readme = "README.md"
16-
requires-python = ">=3.9,<3.13"
16+
requires-python = ">=3.9,<3.14"
1717
keywords = [
1818
"data-science",
1919
"machine-learning",
@@ -36,8 +36,10 @@ classifiers = [
3636
"Programming Language :: Python :: 3.10",
3737
"Programming Language :: Python :: 3.11",
3838
"Programming Language :: Python :: 3.12",
39+
"Programming Language :: Python :: 3.13",
3940
]
4041
dependencies = [
42+
"aeon>=1.0.0",
4143
"numba>=0.55.0",
4244
"numpy>=1.21.0",
4345
"scipy>=1.9.0",
@@ -49,7 +51,7 @@ dependencies = [
4951
[project.optional-dependencies]
5052
all_extras = [
5153
"grailts",
52-
# "scikit-fda>=0.7.0",
54+
"scikit-fda>=0.7.0; python_version > '3.9' and python_version < '3.13'",
5355
"statsmodels>=0.12.1",
5456
"wildboar",
5557
]

tsml/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
"""tsml."""
22

3-
__version__ = "0.6.1"
3+
__version__ = "0.7.0"

tsml/base.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ def _convert_X(
115115
pad_unequal: bool = False,
116116
concatenate_channels: bool = False,
117117
) -> Union[np.ndarray, List[np.ndarray]]:
118-
dtypes = self._get_tags()["X_types"]
118+
dtypes = _safe_tags(self)["X_types"]
119119

120120
if isinstance(X, np.ndarray) and X.ndim == 3:
121121
if "3darray" in dtypes:
@@ -247,6 +247,9 @@ def _check_n_features(self, X: Union[np.ndarray, List[np.ndarray]], reset: bool)
247247
f"is expecting {self.n_features_in_[1]} series length as input."
248248
)
249249

250+
def _get_tags(self) -> dict:
251+
return _safe_tags(self)
252+
250253
def _more_tags(self) -> dict:
251254
return _DEFAULT_TAGS
252255

tsml/compose/_channel_ensemble.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,7 @@ def predict_proba(self, X: Union[np.ndarray, List[np.ndarray]]) -> np.ndarray:
330330
def _more_tags(self) -> dict:
331331
return {
332332
"X_types": ["np_list", "3darray"],
333+
"equal_length_only": False,
333334
}
334335

335336
@classmethod
@@ -497,9 +498,7 @@ def predict(self, X: Union[np.ndarray, List[np.ndarray]]) -> np.ndarray:
497498
return np.average(preds, axis=0)
498499

499500
def _more_tags(self) -> dict:
500-
return {
501-
"X_types": ["np_list", "3darray"],
502-
}
501+
return {"X_types": ["np_list", "3darray"], "equal_length_only": False}
503502

504503
@classmethod
505504
def get_test_params(

tsml/dictionary_based/_mrseql.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,9 @@ def fit(self, X: Union[np.ndarray, List[np.ndarray]], y: np.ndarray) -> object:
6666
self :
6767
Reference to self.
6868
"""
69-
X, y = self._validate_data(X=X, y=y, ensure_min_samples=2)
69+
X, y = self._validate_data(
70+
X=X, y=y, ensure_min_samples=2, ensure_equal_length=True
71+
)
7072
X = self._convert_X(X)
7173

7274
check_classification_targets(y)
@@ -115,7 +117,7 @@ def predict(self, X: Union[np.ndarray, List[np.ndarray]]) -> np.ndarray:
115117
if self.n_classes_ == 1:
116118
return np.repeat(list(self.class_dictionary_.keys()), X.shape[0], axis=0)
117119

118-
X = self._validate_data(X=X, reset=False)
120+
X = self._validate_data(X=X, reset=False, ensure_equal_length=True)
119121
X = self._convert_X(X)
120122

121123
return self.clf_.predict(_convert_data(X))
@@ -139,7 +141,7 @@ def predict_proba(self, X: Union[np.ndarray, List[np.ndarray]]) -> np.ndarray:
139141
if self.n_classes_ == 1:
140142
return np.repeat([[1]], X.shape[0], axis=0)
141143

142-
X = self._validate_data(X=X, reset=False)
144+
X = self._validate_data(X=X, reset=False, ensure_equal_length=True)
143145
X = self._convert_X(X)
144146

145147
return self.clf_.predict_proba(_convert_data(X))

tsml/dictionary_based/_mrsqm.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,9 @@ def fit(self, X: Union[np.ndarray, List[np.ndarray]], y: np.ndarray) -> object:
100100
self :
101101
Reference to self.
102102
"""
103-
X, y = self._validate_data(X=X, y=y, ensure_min_samples=2)
103+
X, y = self._validate_data(
104+
X=X, y=y, ensure_min_samples=2, ensure_equal_length=True
105+
)
104106
X = self._convert_X(X)
105107

106108
check_classification_targets(y)
@@ -152,7 +154,7 @@ def predict(self, X: Union[np.ndarray, List[np.ndarray]]) -> np.ndarray:
152154
if self.n_classes_ == 1:
153155
return np.repeat(list(self.class_dictionary_.keys()), X.shape[0], axis=0)
154156

155-
X = self._validate_data(X=X, reset=False)
157+
X = self._validate_data(X=X, reset=False, ensure_equal_length=True)
156158
X = self._convert_X(X)
157159

158160
return self.clf_.predict(_convert_data(X))
@@ -176,7 +178,7 @@ def predict_proba(self, X: Union[np.ndarray, List[np.ndarray]]) -> np.ndarray:
176178
if self.n_classes_ == 1:
177179
return np.repeat([[1]], X.shape[0], axis=0)
178180

179-
X = self._validate_data(X=X, reset=False)
181+
X = self._validate_data(X=X, reset=False, ensure_equal_length=True)
180182
X = self._convert_X(X)
181183

182184
return self.clf_.predict_proba(_convert_data(X))

0 commit comments

Comments
 (0)