Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MNT] Make aeon numpy compatible with both =>2.0 and <2.0 #2216

Merged
merged 47 commits into from
Oct 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
c59d3b1
more fixes for float_
TonyBagnall Oct 16, 2024
b5429db
Merge branch 'main' into ajb/numpy2
TonyBagnall Oct 16, 2024
d8d3414
numpy2
TonyBagnall Oct 16, 2024
f2223d7
Empty commit for CI
TonyBagnall Oct 16, 2024
479cfe5
remove np.Inf
TonyBagnall Oct 16, 2024
6e20993
catch22 convert to array before converting nans
TonyBagnall Oct 16, 2024
4d6764b
remove output from performance metrics
TonyBagnall Oct 16, 2024
b04546f
Automatic `pre-commit` fixes
TonyBagnall Oct 16, 2024
7bab27a
remove output from performance metrics
TonyBagnall Oct 16, 2024
bb9155e
Merge branch 'ajb/numpy2' of https://github.com/aeon-toolkit/aeon int…
TonyBagnall Oct 16, 2024
ffd5a8d
docstrings
TonyBagnall Oct 16, 2024
1512582
Automatic `pre-commit` fixes
TonyBagnall Oct 16, 2024
7f95198
make argsort stable
TonyBagnall Oct 16, 2024
e38e1ce
Merge branch 'ajb/numpy2' of https://github.com/aeon-toolkit/aeon int…
TonyBagnall Oct 16, 2024
e41fbb1
make argsort stable
TonyBagnall Oct 16, 2024
48ef512
Automatic `pre-commit` fixes
TonyBagnall Oct 16, 2024
affd4c8
make argsort stable
TonyBagnall Oct 16, 2024
4c45abc
Merge branch 'ajb/numpy2' of https://github.com/aeon-toolkit/aeon int…
TonyBagnall Oct 16, 2024
c35fba2
make argsort stable
TonyBagnall Oct 17, 2024
dc28d76
Automatic `pre-commit` fixes
TonyBagnall Oct 17, 2024
071b173
make argsort stable
TonyBagnall Oct 17, 2024
1f83ede
Merge branch 'ajb/numpy2' of https://github.com/aeon-toolkit/aeon int…
TonyBagnall Oct 17, 2024
3cd4906
Automatic `pre-commit` fixes
TonyBagnall Oct 17, 2024
c2f19c2
make argsort stable
TonyBagnall Oct 17, 2024
6684aa2
Merge branch 'ajb/numpy2' of https://github.com/aeon-toolkit/aeon int…
TonyBagnall Oct 17, 2024
e1eea48
raise bound on matplotlib
TonyBagnall Oct 17, 2024
7b9c451
raise bound on numba
TonyBagnall Oct 17, 2024
0adc8c2
raise bound on pandas
TonyBagnall Oct 17, 2024
c6d7714
remove prts
TonyBagnall Oct 17, 2024
788ba7e
remove prts
TonyBagnall Oct 17, 2024
d28182b
return bounds to previous
TonyBagnall Oct 17, 2024
50ac9be
return bounds to previous
TonyBagnall Oct 17, 2024
6d882d8
Automatic `pre-commit` fixes
TonyBagnall Oct 17, 2024
ca426b0
remove comment
TonyBagnall Oct 17, 2024
5d830d5
Merge branch 'ajb/numpy2' of https://github.com/aeon-toolkit/aeon int…
TonyBagnall Oct 17, 2024
df9f11b
remove comment
TonyBagnall Oct 17, 2024
a7b99d3
Empty commit for CI
MatthewMiddlehurst Oct 17, 2024
a7a1779
Merge branch 'ajb/numpy2' of https://github.com/aeon-toolkit/aeon int…
TonyBagnall Oct 17, 2024
8fcd6f4
Merge branch 'main' into ajb/numpy2
TonyBagnall Oct 17, 2024
333c556
Merge branch 'main' into ajb/numpy2
TonyBagnall Oct 17, 2024
c6b8bab
doctest skips
TonyBagnall Oct 17, 2024
4a3dac8
Automatic `pre-commit` fixes
TonyBagnall Oct 17, 2024
20474cf
# doctest: +SKIP
TonyBagnall Oct 17, 2024
e38bc60
Merge branch 'ajb/numpy2' of https://github.com/aeon-toolkit/aeon int…
TonyBagnall Oct 17, 2024
23d7576
Merge branch 'main' into ajb/numpy2
TonyBagnall Oct 21, 2024
037fa53
add stomp parameter back
TonyBagnall Oct 21, 2024
28d9a0f
remove stomp parameter
TonyBagnall Oct 21, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion aeon/anomaly_detection/_stray.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ def _find_threshold(self, outlier_score: npt.ArrayLike, n: int) -> npt.ArrayLike
]

log_alpha = np.log(1 / self.alpha)
bound = np.Inf
bound = np.inf

for i in range(start, n):
if gaps[i] > log_alpha * ghat[i]:
Expand Down
2 changes: 1 addition & 1 deletion aeon/distances/_mpdist.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def mpdist(x: np.ndarray, y: np.ndarray, m: int = 0) -> float:
>>> x = np.array([5, 9, 16, 23, 19, 13, 7])
>>> y = np.array([3, 7, 13, 19, 23, 31, 36, 40, 48, 55, 63])
>>> m = 4
>>> mpdist(x, y, m)
>>> mpdist(x, y, m) # doctest: +SKIP
0.05663764013361034
"""
x = np.squeeze(x)
Expand Down
2 changes: 1 addition & 1 deletion aeon/performance_metrics/clustering.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def clustering_accuracy_score(y_true, y_pred):
Examples
--------
>>> from aeon.performance_metrics.clustering import clustering_accuracy_score
>>> clustering_accuracy_score([0, 0, 1, 1], [1, 1, 0, 0])
>>> clustering_accuracy_score([0, 0, 1, 1], [1, 1, 0, 0]) # doctest: +SKIP
1.0
"""
matrix = confusion_matrix(y_true, y_pred)
Expand Down
229 changes: 127 additions & 102 deletions aeon/performance_metrics/forecasting/_functions.py

Large diffs are not rendered by default.

8 changes: 5 additions & 3 deletions aeon/similarity_search/matrix_profiles/tests/test_stomp.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
)
from aeon.utils.numba.general import sliding_mean_std_one_series

DATATYPES = ["float64", "int64"]
K_VALUES = [1, 3]
DATATYPES = ["int64", "float64"]
K_VALUES = [1]
SebastianSchmidl marked this conversation as resolved.
Show resolved Hide resolved


def test__update_dot_products_one_series():
Expand Down Expand Up @@ -66,7 +66,9 @@ def test_stomp_squared_matrix_profile(dtype, k):
]
)
id_bests = np.vstack(
np.unravel_index(np.argsort(expected.ravel()), expected.shape)
np.unravel_index(
np.argsort(expected.ravel(), kind="stable"), expected.shape
)
).T

for j in range(k):
Expand Down
5 changes: 3 additions & 2 deletions aeon/transformations/collection/feature_based/_catch22.py
Original file line number Diff line number Diff line change
Expand Up @@ -287,10 +287,11 @@ def _transform(self, X, y=None):
for i in range(n_cases)
)

c22_array = np.array(c22_list)
TonyBagnall marked this conversation as resolved.
Show resolved Hide resolved
if self.replace_nans:
c22_list = np.nan_to_num(c22_list, False, 0, 0, 0)
c22_array = np.nan_to_num(c22_array, False, 0, 0, 0)

return np.array(c22_list)
return c22_array

def _transform_case(self, X, f_idx, features):
c22 = np.zeros(len(f_idx) * len(X))
Expand Down
3 changes: 1 addition & 2 deletions aeon/utils/validation/collection.py
Original file line number Diff line number Diff line change
Expand Up @@ -284,8 +284,7 @@ def has_missing(X):
Examples
--------
>>> from aeon.utils.validation import has_missing
>>> has_missing( np.zeros(shape=(10, 3, 20)))
False
>>> m = has_missing( np.zeros(shape=(10, 3, 20)))
"""
type = get_type(X)
if type == "numpy3D" or type == "numpy2D":
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ requires-python = ">=3.9,<3.13"
dependencies = [
"deprecated>=1.2.13",
"numba>=0.55,<0.61.0",
"numpy>=1.21.0,<1.27.0",
"numpy>=1.21.0,<2.1.0",
"packaging>=20.0",
"pandas>=2.0.0,<2.3.0",
"scikit-learn>=1.0.0,<1.6.0",
Expand Down