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

Download dialog for datasets has a typo #1309

Open
dgmccart opened this issue Nov 5, 2024 · 0 comments
Open

Download dialog for datasets has a typo #1309

dgmccart opened this issue Nov 5, 2024 · 0 comments
Assignees
Labels
bug Something isn't working frontend

Comments

@dgmccart
Copy link
Collaborator

dgmccart commented Nov 5, 2024

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:

  1. Go to dataset 10162
  2. Click on Download Dataset and move to the via API tab
  3. Copy and paste the code and save it as a python script
Screenshot 2024-11-05 at 3 17 12 PM
  1. 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:

from cryoet_data_portal import Client, Dataset

client = Client()

dataset = Dataset.get_by_id(client, 10162)
dataset.download_everything()
@dgmccart dgmccart added the bug Something isn't working label Nov 5, 2024
@codemonkey800 codemonkey800 self-assigned this Nov 6, 2024
codemonkey800 added a commit that referenced this issue Nov 6, 2024
#1308
#1309

Fixes issue with API code snippet when downloading all datasets

## Demo

### Download Dataset

<img width="548" alt="image"
src="https://github.com/user-attachments/assets/ec6bb16c-7c11-40bb-b720-dc5a3e25448b">

### Download All Annotations

<img width="539" alt="image"
src="https://github.com/user-attachments/assets/eb09e081-82a6-4b5b-82a8-835bad1babb4">
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working frontend
Projects
None yet
Development

No branches or pull requests

2 participants