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
Add tutorial about reading and exploring an NWB File #1453
Add tutorial about reading and exploring an NWB File #1453
Conversation
this looks great, @weiglszonja! One issue with how this is currently set up is that it requires the NWB files to exist locally, which is tricky, because the server that runs this won't have access to that file. Maybe we could also offer an s3 streaming version and show the rest through that. |
in fact, I think we could combine the s3 streaming tutorial with this one |
If only for find-ability, I think it will be useful to keep a separate tutorial around for S3, even if that tutorial is then very brief and only shows how to open a file and then points to this tutorial for details. Other than that, I think using S3 for this tutorial is fine, but I think it would be useful to at least briefly discuss the main difference between downloading a file and using it via S3. |
@weiglszonja yes, once this tutorial is ready we should route people to it. We should also use this section to route users to more advanced and specialized read tutorials as they become available. In general, the nwb-overview documentation is for providing a bit of context and then routing users to more in-depth tutorials on specific repos. |
As far as I know, using inline code-blocks has the disadvantage that the code-blocks are not being executed and as such are not being tested. |
@oruebel |
I see, thanks for the clarification. I think the S3 tutorial we didn't end up making DANDI a dependency because it was such a brief tutorial. Since you are significantly expanding this now here, I think it is worth revisiting this question since, ideally, we want to be able to have all these tutorial be run to ensure they keep working in the future. The options we have then are:
|
I'm not sure how frequently this readthedocs build is happening in the background, but it will definitely slow it down if we go for option 1. Also is it feasible given that streaming requires a special setup with the ROS3 driver? (let me know @CodyCBakerPhD if I'm missing something here) If we go for option 3, is it possible to hide code snippets? So the tutorial would look as it is (showing how to download a file or stream it from S3) but in the background it would actually read a small file added to the repo? |
What I've had to do in the past so setup CI to perform streaming would be difficult to do on the readthedocs environment side, and also pretty costly to do every time a new build is done. If you just want to test the code blocks inside the docs to make sure they always continue running, I'd suggest just adding them as tests to the main testing suite that I assume is already setup to test other streaming behavior.
We did something like that a while back on the NWBCT - I no longer have the sphinx builds from that, but this snippet is what did it: catalystneuro/nwb-conversion-tools@8e9e6dc#diff-5adb8bffbac6c004685f555404d3586533e8c94f26c82fbe3592f81d977ae513R165-R176 Basically it adds an arrow that expands the code block when you click it, but otherwise minimizes it. |
Thank you @rly, looks good! 👍 |
docs/gallery/general/read_basics.py
Outdated
# .. seealso:: | ||
# You can learn more about streaming data in the :ref:`streaming` tutorial. | ||
# | ||
# Then, we will use the ``DandiAPIClient`` to obtain the S3 URL that points to the NWB File |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we use intersphinx to link to the API documentation for DANDIAPIClient?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh sure, I'll add it!
# Conflicts: # CHANGELOG.md
@weiglszonja it looks like you are becoming a sphinx expert! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. Thanks for all the hard work in putting this tutorial together.
In two spots in this tutorial, it is noted "# Reverse the last dimension because the data were stored in BGR instead of RGB" @bendichter Could we correct this in the dandiset and release a new version where this transformation is not necessary? |
Co-authored-by: Oliver Ruebel <oruebel@users.noreply.github.com>
I don't have permission to merge this. @weiglszonja, do you? |
@rly I generally don't make changes to datasets that I wasn't involved in converting and publishing to begin with |
also for this particular dataset I know they have Python and MATLAB code associated with it, and I would not want to make changes that might break their code |
@bendichter I don't have merge permission |
Add new tutorial about reading, exploring and doing basic visualisations with an existing NWB File.
This tutorial demonstrates how to:
stim_on_time
columnnwbwidgets
,HDFView
Checklist
flake8
from the source directory.