Skip to content

Commit 96dba26

Browse files
committed
drop obsolete python
1 parent ab0c99f commit 96dba26

3 files changed

Lines changed: 16 additions & 15 deletions

File tree

AGENTS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
## Codex specific instructions
88

9-
Set the UV_CACHE directory to the repository's `.uv-cache` directory to workaround
9+
Set the UV_CACHE_DIR directory to the repository's `.uv-cache` directory to workaround
1010
sandboxing issues.
1111

1212

dtw/dtw.py

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -351,17 +351,18 @@ def dtw(x, y=None,
351351

352352

353353
if y is None:
354-
x = numpy.array(x)
355-
if len(x.shape) != 2:
356-
_error("A 2D local distance matrix was expected")
357354
lm = numpy.array(x)
355+
if lm.ndim != 2:
356+
_error("A 2D local distance matrix was expected")
358357
else:
359-
x2, y2 = numpy.atleast_2d(x), numpy.atleast_2d(y)
360-
if x2.shape[0] == 1:
361-
x2 = x2.T
362-
if y2.shape[0] == 1:
363-
y2 = y2.T
364-
lm = scipy.spatial.distance.cdist(x2, y2, metric=dist_method)
358+
x, y = numpy.asarray(x), numpy.asarray(y)
359+
if x.ndim > 2 or y.ndim > 2:
360+
_error("Input arrays should be 1 or 2 dimensional")
361+
if x.ndim == 1:
362+
x = numpy.atleast_2d(x).T
363+
if y.ndim == 1:
364+
y = numpy.atleast_2d(y).T
365+
lm = scipy.spatial.distance.cdist(x, y, metric=dist_method)
365366

366367
wfun = _canonicalizeWindowFunction(window_type)
367368

pyproject.toml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,10 @@
44
[build-system]
55
# Minimum requirements for the build system to execute.
66
# PEP 508 specifications.
7-
requires = ["setuptools",
7+
requires = [
8+
"setuptools>=69",
89
"wheel",
9-
"Cython",
10+
"Cython>=3",
1011
'numpy>=2.0; python_version>="3.9"',
1112
'numpy; python_version<"3.9"',
1213
]
@@ -19,11 +20,10 @@ build-backend = "setuptools.build_meta"
1920
name = "dtw-python"
2021
dynamic = ["version"]
2122
dependencies = [
22-
'numpy>=1.23.5; python_version>="3.9"',
23-
'numpy; python_version<"3.9"',
23+
"numpy>=2.0",
2424
"scipy"
2525
]
26-
requires-python = ">= 3.6"
26+
requires-python = ">=3.9"
2727
authors = [
2828
{name = "Toni Giorgino", email = "toni.giorgino@gmail.com"},
2929
]

0 commit comments

Comments
 (0)