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

updating notebooks #3

Open
djarecka opened this issue Jun 8, 2021 · 12 comments
Open

updating notebooks #3

djarecka opened this issue Jun 8, 2021 · 12 comments
Assignees

Comments

@djarecka
Copy link
Member

djarecka commented Jun 8, 2021

@bendichter - I'm thinking about updating the notebooks from this repo, but I wonder if your yesterday notebooks were not related to this repo

@bendichter
Copy link
Member

bendichter commented Jun 8, 2021

I just made that on my own, but we could add it to this repo! Eventually. It's a bit messy right now.

@djarecka
Copy link
Member Author

djarecka commented Jun 8, 2021

So does it make sense to update NWBWidget-demo.ipynb and 000004_demo_analysis.ipynb (they are failing in the current form), or you have a different idea for the content in this repo.

@satra
Copy link
Member

satra commented Jun 9, 2021

it would be good to update them and perhaps use the nwbstreaming environment directly to pull in the streaming data.

@bendichter
Copy link
Member

I can work on this

@bendichter bendichter self-assigned this Jun 10, 2021
@bendichter
Copy link
Member

@satra
Copy link
Member

satra commented Jun 10, 2021

thanks that looks nice. regarding the search paths, there is a dedicated endpoint for that:

https://dandi.readme.io/reference#dandisets_versions_assets_paths_read

that specific api return will change shortly (dandi/dandi-archive#312), but that's what you should use instead of the current formulation.

@bendichter
Copy link
Member

@satra I'd like to be able to demonstrate API best practices but I don't understand how to use this. What I need is an API where I can input the dandiset identifier and the nwb file path and have it output the asset_id of that NWB file. Is that possible with the API?

@satra
Copy link
Member

satra commented Jun 11, 2021

yes that api has exactly those things but will return a list of objects. path is a parameter to that api endpoint. if you fill in the values in readme.io it will show you the corresponding python code.

@bendichter
Copy link
Member

@satra

I've been playing around with it and this is the closest I've gotten

image

but this neither returns the single object I am looking for nor returns the asset ID. Also, the documentations says:

The specified path must be a folder; it either must end in a slash or (to refer to the root folder) must be the empty string.

but I want to specify the path of a file.

@satra
Copy link
Member

satra commented Jun 11, 2021

really sorry, i gave the wrong api endpoint.

import requests

url = "https://api.dandiarchive.org/api/dandisets/000053/versions/draft/assets/"

querystring = {"path":"sub-npI1"}

headers = {"Accept": "application/json"}

response = requests.request("GET", url, headers=headers, params=querystring)

print(response.text)

@satra
Copy link
Member

satra commented Jun 11, 2021

and you should be able to give the fullpath. the other endpoint returns the list of objects at a given level in the hierarchy

@bendichter
Copy link
Member

that works, thanks @satra

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

3 participants