Skip to content

Commit beffd0c

Browse files
New estimators and data io fix (#8)
* actually change python version * dummy classifiers and sklearn lower bound change * test fix * test fix * dev * early sklearn version fixes * all interval classifiers * dummy and conversion bugfix * version * test * testing update * version * pandas * stop all workflows failing * copy check * new estimators and data loading fix * new ver * ci * gcc * only macos * codecov check
1 parent 1dad889 commit beffd0c

File tree

22 files changed

+12838
-281
lines changed

22 files changed

+12838
-281
lines changed

.github/workflows/release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,10 @@ jobs:
7373

7474
- if: matrix.os == 'windows-latest'
7575
name: Windows install
76-
run: python -m pip install "${env:WHEELNAME}[extras,dev]"
76+
run: python -m pip install "${env:WHEELNAME}[dev,extras,unstable_extras]"
7777
- if: matrix.os != 'windows-latest'
7878
name: Unix install
79-
run: python -m pip install "${{ env.WHEELNAME }}[extras,dev]"
79+
run: python -m pip install "${{ env.WHEELNAME }}[dev,extras,unstable_extras]"
8080

8181
- name: Tests
8282
run: python -m pytest

.github/workflows/tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ jobs:
4343
python-version: ${{ matrix.python-version }}
4444

4545
- name: Install
46-
run: python -m pip install .[dev,extras]
46+
run: python -m pip install .[dev,extras,unstable_extras]
4747

4848
- name: Tests
4949
run: python -m pytest
@@ -63,7 +63,7 @@ jobs:
6363
run: echo "NUMBA_DISABLE_JIT=1" >> $GITHUB_ENV
6464

6565
- name: Install
66-
run: python -m pip install .[dev,extras]
66+
run: python -m pip install .[dev,extras,unstable_extras]
6767

6868
- name: Tests
6969
run: python -m pytest --cov=tsml --cov-report=xml

pyproject.toml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "tsml"
7-
version = "0.0.7"
7+
version = "0.1.0"
88
description = "A toolkit for time series machine learning algorithms."
99
authors = [
1010
{name = "Matthew Middlehurst", email = "m.middlehurst@uea.ac.uk"},
@@ -43,9 +43,13 @@ dependencies = [
4343

4444
[project.optional-dependencies]
4545
extras = [
46-
"pycatch22>=0.4.2",
4746
"pyfftw>=0.12.0",
4847
"statsmodels>=0.12.1",
48+
"wildboar>=1.1.0",
49+
]
50+
unstable_extras = [
51+
"mrsqm>=0.0.1 ; platform_system == 'Darwin'", # requires gcc and fftw to be installed for Windows and some other OS (see http://www.fftw.org/index.html)
52+
"pycatch22>=0.4.2", # Known to fail installation on some setups
4953
]
5054
dev = [
5155
"pre-commit",

tsml/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# -*- coding: utf-8 -*-
22
"""tsml."""
33

4-
__version__ = "0.0.7"
4+
__version__ = "0.1.0"

tsml/datasets/_data_io.py

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ def load_from_ts_file(
3030
data is unequal length, a list of 2D numpy arrays will be returned. If labels are
3131
present, they will be returned as well as the data.
3232
33-
The only mandatory tags in the loaded file are @equallength and one of
34-
@targetlabels or @classlabels. Other details can be inferred, though some error
35-
checking will be done if they are present.
33+
The only mandatory tags in the loaded file are one of @targetlabels or @classlabels.
34+
Other details can be inferred, though some error checking will be done if they are
35+
present.
3636
3737
Parameters
3838
----------
@@ -304,11 +304,9 @@ def load_from_ts_file(
304304
"required."
305305
)
306306

307-
# Equal length tag is required.
307+
# Assume equal length if no tag.
308308
if not equallength_tag:
309-
raise IOError(
310-
"Unable to read .ts file. The @equallength tag is required."
311-
)
309+
equallength = True
312310

313311
n_instances = len(lines) - data_start_line
314312
data_dims = len(first_line) - 1 if has_labels else len(first_line)
@@ -384,13 +382,19 @@ def load_from_ts_file(
384382
)
385383

386384
dimensions = line[:data_dims]
387-
if not equallength:
388-
data_length = len(dimensions[0].strip().split(","))
385+
split = dimensions[0].strip().split(",")
386+
length = len(split)
387+
if equallength and length != data_length:
388+
raise IOError(
389+
"Unable to read .ts file. Inconsistent number of channels."
390+
f"Expected {data_dims} but read {read_dims} on line {data_idx}."
391+
)
389392

390393
# Process the data for each channel
391-
series = np.zeros((data_dims, data_length), dtype=X_dtype)
392-
for i in range(data_dims):
393-
series[i, :] = dimensions[i].strip().split(",")
394+
series = np.zeros((data_dims, length), dtype=X_dtype)
395+
series[0, :] = split
396+
for n in range(1, data_dims):
397+
series[n, :] = dimensions[n].strip().split(",")
394398

395399
X[data_idx] = series
396400

tsml/datasets/tests/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# -*- coding: utf-8 -*-
2+
"""Testing for data loaders."""

0 commit comments

Comments
 (0)