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] Poor error message when loading a non existent file #1059

Closed
TonyBagnall opened this issue Jan 16, 2024 · 0 comments · Fixed by #1157
Closed

[BUG] Poor error message when loading a non existent file #1059

TonyBagnall opened this issue Jan 16, 2024 · 0 comments · Fixed by #1157
Assignees
Labels
bug Something isn't working datasets Datasets and data loaders good first issue Good for newcomers

Comments

@TonyBagnall
Copy link
Contributor

Describe the bug

if I problem does not exist on tsc.com or locally, the error message could be more informative

Steps/Code to reproduce the bug

from aeon.datasets import load_classification
X,y=load_classification("foo",extract_path="C:\\Temp\\")



### Expected results

Single informative error should be thrown

### Actual results

```python-traceback

Traceback (most recent call last):
  File "C:\code\tsml-eval\venv\lib\site-packages\aeon\datasets\_data_loaders.py", line 441, in _download_and_extract
    zipfile.ZipFile(zip_file_name, "r").extractall(extract_path)
  File "C:\Users\ajb\AppData\Local\Programs\Python\Python39\lib\zipfile.py", line 1257, in __init__
    self._RealGetContents()
  File "C:\Users\ajb\AppData\Local\Programs\Python\Python39\lib\zipfile.py", line 1324, in _RealGetContents
    raise BadZipFile("File is not a zip file")
zipfile.BadZipFile: File is not a zip file

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\code\tsml-eval\venv\lib\site-packages\aeon\datasets\_data_loaders.py", line 514, in _load_tsc_dataset
    _download_and_extract(
  File "C:\code\tsml-eval\venv\lib\site-packages\aeon\datasets\_data_loaders.py", line 448, in _download_and_extract
    raise zipfile.BadZipFile(
zipfile.BadZipFile: Could not unzip dataset. Please make sure the URL is valid.

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "C:\code\tsml-eval\tsml_eval\local\classification_process.py", line 42, in <module>
    data_characteristics()
  File "C:\code\tsml-eval\tsml_eval\local\classification_process.py", line 31, in data_characteristics
    trainX, trainY = load_classification(p, split="TRAIN", extract_path="C:\\Data\\")
  File "C:\code\tsml-eval\venv\lib\site-packages\aeon\datasets\_data_loaders.py", line 1157, in load_classification
    return _load_tsc_dataset(
  File "C:\code\tsml-eval\venv\lib\site-packages\aeon\datasets\_data_loaders.py", line 519, in _load_tsc_dataset
    raise ValueError(
ValueError: Invalid dataset name =AconityMINIPrinterLargeEq is not available on extract path =C:\Data\. Nor is it available on https://timeseriesclassification.com/aeon-toolkit/AconityMINIPrinterLargeEq.zip

Process finished with exit code 1

Versions

No response

@TonyBagnall TonyBagnall added the bug Something isn't working label Jan 16, 2024
@TonyBagnall TonyBagnall self-assigned this Jan 16, 2024
@MatthewMiddlehurst MatthewMiddlehurst added good first issue Good for newcomers datasets Datasets and data loaders labels Jan 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working datasets Datasets and data loaders good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants