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

[BUG] fix extract_path arg in sktime.datasets.load_UCR_UEA_dataset #5744

Merged
merged 2 commits into from Jan 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions sktime/datasets/_data_io.py
Expand Up @@ -241,6 +241,8 @@ def _load_dataset(name, split, return_X_y, return_type=None, extract_path=None):
if extract_path is None:
# default for first check is sktime/datasets/data
check_path = os.path.join(MODULE, "data")
else:
check_path = extract_path

def _get_data_from(path):
return _load_provided_dataset(name, split, return_X_y, return_type, path)
Expand Down
10 changes: 10 additions & 0 deletions sktime/datasets/tests/test_data_io.py
Expand Up @@ -84,6 +84,16 @@ def test_load_UCR_UEA_dataset():
assert X.shape == (42, 1) and y.shape == (42,)


def test_load_UCR_UEA_local():
"""Tests load_UCR_UEA_dataset looks for local file if extract_path is set.

A FileNotFoundError indicates the function looked for the file and everything up
to that point went fine.
"""
with pytest.raises(FileNotFoundError):
load_UCR_UEA_dataset(name="UnitTest", extract_path=" ")


_CHECKS = {
"uschange": {
"columns": ["Income", "Production", "Savings", "Unemployment"],
Expand Down