-
Notifications
You must be signed in to change notification settings - Fork 90
Open
Labels
help wanted: good first issuerequest for community contributions that are good for new contributorsrequest for community contributions that are good for new contributorspriority: lowalternative solution already working and/or relevant to only specific user(s)alternative solution already working and/or relevant to only specific user(s)topic: docsissues related to documentationissues related to documentation
Milestone
Description
What would you like changed or added to the documentation and why?
It would be nice if we could create a short tutorial to show how one could run PyNWB in the browser with Pyodide. The example below shows that we can at least install PyNWB with Pyodide.
Basic example for installing PyNWB with Pyodide
<html>
<head>
<meta charset="utf-8" />
</head>
<body>
<script type="text/javascript" src="https://cdn.jsdelivr.net/pyodide/dev/full/pyodide.js"></script>
<script type="text/javascript">
async function main() {
let pyodide = await loadPyodide();
await pyodide.loadPackage("micropip");
const micropip = pyodide.pyimport("micropip");
await pyodide.loadPackage("h5py");
await pyodide.loadPackage("pandas");
await pyodide.loadPackage("numpy");
await pyodide.loadPackage("scipy");
await pyodide.loadPackage("jsonschema");
await pyodide.loadPackage("setuptools");
await pyodide.loadPackage("ruamel.yaml");
await micropip.install("hdmf");
await micropip.install("pynwb==2.2.0");
await pyodide.runPython(`
import hdmf
print("HDMF Version: %s" % hdmf.__version__)
import pynwb
print("PyNWB Version: %s" % pynwb.__version__)
import h5py
print("h5py Version: %s" % h5py.__version__)
print("h5py Drivers: %s" % str(h5py.registered_drivers()))
`);
}
main();
</script>
</body>
</html>
Example of the above HTML running in Firefox

Comments
- Installing pynwb with micropip fails when not specifying the version due to version conflicts for h5py version ranges. This is probably due to micropip getting confused by the bad/yanked 2.5.1 PyNWB release https://pypi.org/project/pynwb/2.5.1/
- The
ros3driver does not appear to be installed forh5pywhich would be nice to have for reading files from DANDI - I had to use the
devversion of Pyodide for this to work. With the current0.21.3release micropip for h5py did not work - The install process can probably be simplified (i.e., not all
loadPackagecalls listed in the example are necessary). I mainly went through the requirements.txt for HDMF and try to load the packages one-by-one to see if all the dependencies work. - The above example does not actually load any NWB data file. It would be nice to show how to actually read from an NWB file either using streaming or from the file system (file system access in the browser is limited
Do you have any interest in helping write or edit the documentation?
Yes, but I would need guidance.
Code of Conduct
- I agree to follow this project's Code of Conduct
- Have you checked the Contributing document?
- Have you ensured this change was not already requested?
Metadata
Metadata
Assignees
Labels
help wanted: good first issuerequest for community contributions that are good for new contributorsrequest for community contributions that are good for new contributorspriority: lowalternative solution already working and/or relevant to only specific user(s)alternative solution already working and/or relevant to only specific user(s)topic: docsissues related to documentationissues related to documentation