-
Notifications
You must be signed in to change notification settings - Fork 0
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
Raising importErr when data is not available for testing. #27
Conversation
datasets/wadi.py
Outdated
path = get_data_path(key="WADI") | ||
if ( | ||
not (path / "WADI_14days_new.csv").exists() | ||
) or ( | ||
not (path / "WADI_attackdataLABLE.csv").exists() | ||
): | ||
raise ImportError( | ||
"Test data not found. Please download the data " | ||
"from the official repository " | ||
"https://itrust.sutd.edu.sg/itrust-labs_datasets/dataset_info/" | ||
f" and place it in {path}" | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
make this a function check_data
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes good idea
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few more comments
"from the official repository " | ||
f"{official_repo[dataset]}" | ||
f"and place it in {data_path}" | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was thinking more of putting this function in each dataset, but it can be ok like this if you prefer.
benchmark_utils/__init__.py
Outdated
raise ValueError("dataset must be either 'WADI' or 'SWaT'") | ||
|
||
for file in required_files: | ||
if not os.path.exists(os.path.join(data_path, file)): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't use os.path
but use pathlib.Path
.
datasets/swat.py
Outdated
|
||
with safe_import_context() as import_ctx: | ||
import pandas as pd | ||
|
||
# Checking if the data is available | ||
path = get_data_path(key="SWaT") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you use a global variable, make it all capital.
Co-authored-by: Thomas Moreau <thomas.moreau.2010@gmail.com>
…chopt-tsad into datasets-importerr
No description provided.