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
HyperSpy on pyodide (and jupyterlite) #3255
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## RELEASE_next_major #3255 +/- ##
======================================================
+ Coverage 80.78% 80.82% +0.04%
======================================================
Files 140 140
Lines 20360 20395 +35
Branches 4820 4825 +5
======================================================
+ Hits 16447 16485 +38
+ Misses 2840 2834 -6
- Partials 1073 1076 +3
☔ View full report in Codecov by Sentry. |
3e554fb
to
1cc70f9
Compare
@ericpre Super cool! Let me know if you want me to test anything or review. |
…ly no threading in pyodide
…est suite is ran without `--mpl`, so the baseline images are not necessary in the wheel
@CSSFrancis, if you can have a look, that would be great! Now that |
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.
LGTM other than the comments above.
…ries are not installed
I have tried to use the following code to generate a file with a saved custom component to dumps the class and I can't even saved the file: import hyperspy.api as hs
from hyperspy.component import Component
class CustomComponent(Component):
def __init__(self, p1=1, p2=2):
Component.__init__(self, ('p1', 'p2'))
self.p1.value = p1
self.p2.value = p2
self.p1.grad = self.grad_p1
self.p2.grad = self.grad_p2
def function(self, x):
p1 = self.p1.value
p2 = self.p2.value
return p1 + x * p2
def grad_p1(self, x):
return 0
def grad_p2(self, x):
return x
s = hs.signals.Signal1D(range(10))
m = s.create_model()
c = CustomComponent()
m.append(c)
m.store('a')
import hyperspy
version = hyperspy.__version__
s.save(f"hs{version}_custom_component.hspy") It seems that saving custom component is broken., but surprisingly, the code is covered according to codecov... |
@ericpre, would you like to fill a bug report for the pickling issue that you report above. I wonder if |
3aa9f7b
into
hyperspy:RELEASE_next_major
Required changes to get HyperSpy to work on pyodide: https://ericpre.github.io/jupyterlite-hyperspy
@CSSFrancis 😃
Progress of the PR
dask.get
) on pyodide, becausedask.threaded
doesn't exist - pyodide currently doesn't support threading,dill
bycloudpickle
-dill
doesn't work on pyodide,upcoming_changes
folder (seeupcoming_changes/README.rst
),readthedocs
doc build of this PR (link in github checks)