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

scrap_zenodo.py: crashes when keys are missing in data received from Internet #28

Open
benoistlaurent opened this issue Nov 7, 2023 · 0 comments

Comments

@benoistlaurent
Copy link

>> python scripts/scrap_zenodo.py --query params/query.yml --output ../data
2023-11-07 14:13:16 INFO /data/mdverse/mdverse-sources/scripts/scrap_zenodo.py
2023-11-07 14:13:16 INFO Scrap molecular dynamics datasets and files from Zenodo.
[...]
2023-11-07 14:13:59 DEBUG https://zenodo.org:443 "GET /api/records?q=resource_type.type%3A%22dataset%22+AND+filetype%3A%22zip%22++AND+%28%22molecular+dynamics%22+OR+%22molecular+dynamic%22+OR+%22molecular-dynamics%22+OR+%22molecular-dynamic%22+OR+%22md+trajectory%22+OR+%22md+trajectories%22+OR+%22md+simulation%22+OR+%22md+simulations%22+OR+%22gromacs%22+OR+%22gromos%22+OR+%22namd%22+OR+%22amber%22+OR+%22desmond%22+OR+%22amber96%22+OR+%22amber99%22+OR+%22amber14%22+OR+%22charmm%22+OR+%22charmm27%22+OR+%22charmm36%22+OR+%22martini%22%29&size=1000&page=1&status=published&access_token=hk5IwtmwSMMc55NwySokszz7bzNhleyxjWQlU5uOAQW6qZbVgvTlkHJiJ5w9 HTTP/1.1" 200 None
Traceback (most recent call last):
  File "/data/mdverse/mdverse-sources/scripts/scrap_zenodo.py", line 431, in <module>
    datasets_tmp, texts_tmp, files_tmp = extract_records(resp_json)
                                         ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/data/mdverse/mdverse-sources/scripts/scrap_zenodo.py", line 340, in extract_records
    "file_type": file_in["type"],
                 ~~~~~~~^^^^^^^^
KeyError: 'type'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant