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

Example Notebooks for 001259 #106

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

pauladkisson
Copy link
Contributor

@pauladkisson pauladkisson commented Dec 19, 2024

This PR adds two example notebooks for the 001259 dataset.

@pauladkisson
Copy link
Contributor Author

From Alessandra:

from dandi.dandiapi import DandiAPIClient
import h5py
import remfile

dandiset_id = "001172"

with DandiAPIClient() as client:
    client.dandi_authenticate() #This line is necessary because the dataset is in embargoed mode and only owners can view the data, once it will be published this line can be removed.
    asset = client.get_dandiset(dandiset_id, 'draft').get_asset_by_path(nwbfile_path)
    s3_url = asset.get_content_url(follow_redirects=1, strip_query=False)

file = remfile.File(s3_url)
h5_file = h5py.File(file, "r")

@pauladkisson
Copy link
Contributor Author

Thanks @alessandratrapani! Turns out the problem was strip_query. I had it set to True which removed some kind of authentication info present in the s3_url.

@pauladkisson pauladkisson marked this pull request as ready for review January 16, 2025 19:57
@kabilar kabilar requested a review from bendichter January 17, 2025 20:22
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

Successfully merging this pull request may close these issues.

1 participant