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

Incorrect suggested python code when trying to download data via the API #1352

Open
DimitriosBellos opened this issue Nov 22, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@DimitriosBellos
Copy link

DimitriosBellos commented Nov 22, 2024

Describe the bug
When someone tries to download data via the API the following python code is provided in order to do so:

from cryoet_data_portal import Client, Dataset

client = Client()

dataset = Dataset.get_by_id(client, <id_number>)
dataset.download_everything()

I tried to use it and I get the following error:

TypeError                                 Traceback (most recent call last)
Cell In[1], line 9
      1 from cryoet_data_portal import Client, Dataset
      5 client = Client()
----> 9 dataset = Dataset.get_by_id(client, 10440)
     11 dataset.download_everything()

TypeError: Dataset.get_by_id() takes 1 positional argument but 3 were given

As I saw here #5 this code is incorrect and a workaround is provided

Therefore the python code based on the workaround is:

from cryoet_data_portal import Client, Dataset

client = Client()

items = Dataset.find(client,[Dataset.id==<id_number>])
for item in items:
    item.download_everything()

I tried the code with the workaround and it worked!

This is for sure incorrect for the CZII - CryoET Object Identification Challenge - Experimental Training Data
https://cryoetdataportal.czscience.com/datasets/10440

To Reproduce
Steps to reproduce the behavior:

  1. Go to https://cryoetdataportal.czscience.com/datasets/10440
  2. Click on 'Download Dataset...' blue button on the top right
  3. In the pop up window go to the 'via API' tab
  4. You can see the incorrect python code their

Screenshots
image

Desktop (please complete the following information):

  • OS: Windows 10
  • Browser: Chrome

Additional context
This problem may exist in some or all datasets not just to id=10440 . This is why in the code I have it id-generic ( <id_number>)

@DimitriosBellos DimitriosBellos added the bug Something isn't working label Nov 22, 2024
@DimitriosBellos DimitriosBellos changed the title Incorrect python code to download data via the API Incorrect suggested python code when trying to download data via the API Nov 22, 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
Projects
None yet
Development

No branches or pull requests

1 participant