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

[DOC] initial add of jupyterlite #785

Closed
wants to merge 64 commits into from

Conversation

jdkent
Copy link
Member

@jdkent jdkent commented Apr 11, 2023

Closes #784 .

Changes proposed in this pull request:

  • add jupyterlite buttons to every notebook

@codecov
Copy link

codecov bot commented Apr 11, 2023

Codecov Report

Patch coverage: 25.80% and project coverage change: -0.71 ⚠️

Comparison is base (77f9eee) 88.65% compared to head (c60a644) 87.95%.

❗ Current head c60a644 differs from pull request most recent head 3a645de. Consider uploading reports for the commit 3a645de to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #785      +/-   ##
==========================================
- Coverage   88.65%   87.95%   -0.71%     
==========================================
  Files          41       42       +1     
  Lines        4752     4807      +55     
==========================================
+ Hits         4213     4228      +15     
- Misses        539      579      +40     
Impacted Files Coverage Δ
nimare/extract/extract.py 47.86% <14.28%> (ø)
nimare/extract/cognitiveatlas.py 27.27% <27.27%> (ø)

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@jdkent
Copy link
Member Author

jdkent commented Apr 12, 2023

need to think about how to add dependencies to the python package:
https://jupyterlite.readthedocs.io/en/latest/howto/configure/kernels.html

@JulioAPeraza
Copy link
Collaborator

I was trying to create an environment to load the pyodide kernel in Jupytelite, but we ran out of memory in RTD.

@JulioAPeraza
Copy link
Collaborator

We also rely on nilearn for running the examples, which is not part of the pyodide kernel. Installing nilearn and nimare for running the notebook will take a lot of time.

@jdkent
Copy link
Member Author

jdkent commented Apr 26, 2023

I'm curious if we can build our own pyodide distribution in a github action and load the built/packaged pyodide in readthedocs?

@JulioAPeraza
Copy link
Collaborator

https://github.com/pyodide/pyodide/discussions/2719

@JulioAPeraza
Copy link
Collaborator

Installing the env using mamba seems to solve the memory issue in RTD but it looks like cognitiveatlas and pymare=0.0.4rc2 are not part of the conda-forge channel.

@JulioAPeraza
Copy link
Collaborator

I have been trying to install a nimare wheel in pyodide, but some of the dependencies don't have a wheel available. For the nimare wheel available in Pypi I got this error:

ValueError: Can't find a pure Python 3 wheel for: 'numba', 'numpy<1.24,>=1.18', 'cognitiveatlas', 'indexed-gzip>=1.4.0', 'numba>=0.49'

And for the wheel created by this PR using a github action, I got this error:

ERROR: Could not find a version that satisfies the requirement cognitiveatlas (from nimare) (from versions: none)
ERROR: No matching distribution found for cognitiveatlas

The dependency with indexed-gzip was already addressed in a previous PR, and I think we can bump the versions for numba and numpy; but I'm not sure what to do about cognitiveatlas.

@JulioAPeraza
Copy link
Collaborator

We will also need to find a server to host the pyodide wheel because they cannot be uploaded to PyPi: https://pyodide.org/en/stable/development/building-and-testing-packages.html#notes

@JulioAPeraza
Copy link
Collaborator

Alternatively, we can leave the build-pyodide action just for testing nimare in the pyodide kernel, and make sure the next release of nimare is a pure Python package and thus installable via micropip.install("nimare") in Jupyterlite.

@jdkent
Copy link
Member Author

jdkent commented May 1, 2023

I am in support of trying to make nimare pure python if the only non-pure dependency is indexed_gzip, then that sounds like a very reasonable change.

@JulioAPeraza JulioAPeraza mentioned this pull request May 2, 2023
@JulioAPeraza
Copy link
Collaborator

Sounds good.
We will also need to add Python 3.11 support before the next release. That will make nimare usable in the pyodide kernel, given that their latest version (0.23.1) run on Python 3.11.3.
Python 3.11 support is pending the numba 0.57.0 release.

@JulioAPeraza
Copy link
Collaborator

At least now we don't get the error with cognitiveatlas. I will be able to test the build again once #796 gets merged.

@JulioAPeraza JulioAPeraza added the enhancement New feature or request label May 2, 2023
@jdkent
Copy link
Member Author

jdkent commented May 3, 2023

I think the numba issue is going to be non-trivial
follow the conversation here:
pyodide/pyodide#621
numba/numba#3284
numba/llvmlite#836

Unfortunately, I would consider this to be blocking since we depend on numba for sparse and sparse is essential for optimizing several core workflows for running meta-analyses.

@jdkent
Copy link
Member Author

jdkent commented May 30, 2023

I subscribed to the relevant issues to keep track on updates to this, but since this cannot be worked on for the forseeable future, I'm closing this pull request.

@jdkent jdkent closed this May 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

add jupyterlite links to the examples gallery
2 participants