Describe the bug
The download dialog for datasets causes an error when run as a python script due to the argument given to the download_everything function.
Click on Download Dataset and move to the via API tab
Copy and paste the code and save it as a python script
Run the script and see the following error
0%| | 0.00/7.65G [00:00<?, ?iB/s]
Traceback (most recent call last):
File "/Users/dmccarthy/Downloads/test_download.py", line 6, in <module>
dataset.download_everything('10162')
File "/opt/miniconda3/envs/cryoet/lib/python3.12/site-packages/cryoet_data_portal/_models.py", line 105, in download_everything
download_directory(self.s3_prefix, recursive_prefix, dest_path)
File "/opt/miniconda3/envs/cryoet/lib/python3.12/site-packages/cryoet_data_portal/_file_tools.py", line 106, in download_directory
local_file = get_destination_path(
^^^^^^^^^^^^^^^^^^^^^
File "/opt/miniconda3/envs/cryoet/lib/python3.12/site-packages/cryoet_data_portal/_file_tools.py", line 65, in get_destination_path
raise ValueError("Recursive downloads require a base directory")
ValueError: Recursive downloads require a base directory
Removing the argument to download everything fixes the problem, resulting in the dataset being downloaded in the current working directory. Correct code:
Describe the bug The download dialog for datasets causes an error when run as a python script due to the argument given to the download_everything function.
To Reproduce Steps to reproduce the behavior:
Go to dataset 10162
Click on Download Dataset and move to the via API tab
Copy and paste the code and save it as a python script
Run the script and see the following error
Removing the argument to download everything fixes the problem, resulting in the dataset being downloaded in the current working directory. Correct code:
client = Client()
dataset = Dataset.get_by_id(client, 10162) dataset.download_everything()