Comments (11)
Oh, of course! My bad -- here you go!
const script = `
import micropip
import numpy as np
import os
os.environ['MPLBACKEND'] = 'AGG'
import io, base64
import sys
sys.setrecursionlimit(1000)
await micropip.install('seaborn==0.9.0')
import seaborn as sns
data = np.asarray([[1, 0, .5], [1, 0, .5], [1, 0, .5]])
fig = sns.clustermap(data)
buf = io.BytesIO()
fig.savefig(buf, format='png')`
await self.pyodide.loadPackagesFromImports(script);
const res = await self.pyodide.runPythonAsync(script);
from matplotlib-pyodide.
I think so. For a function with an i64 argument, dynCall
always gets a BigInt
. But to load or store BigInt
into the wasm memory without BigUint64Array
requires some bitwise operations. See here in my libffi port:
Both with and without WASM_BIGINT, we are expected to handle BigInt
but without it HEAPU64
doesn't exist. Without BigInt
support at all, it's just impossible to call functions with an i64
argument from Javascript as the error message says.
from matplotlib-pyodide.
Thanks for the report, could you provide a minimal code example to reproduce this error?
from matplotlib-pyodide.
We still don't fully support Safari: we don't run Safari tests in the continuous integration and I don't think any of the core devs use macs so we don't test things locally in Safari. I frequently do manual experiments in both Firefox and Chrome but not in Safari. So it may be a long time before issues like this are addressed.
from matplotlib-pyodide.
use macs so we don't test things locally in Safari
Actually once pyodide/pyodide#1912 is resolved, we could potentially run Safari in CI. It adds more maintenance work, but then we do have recurrent requests to for better Safari support as well...
from matplotlib-pyodide.
Thanks for the report, could you provide a minimal code example to reproduce this error?
Thank you for your prompt response!! I believe this should do it:
I'm using Version 14.1.2 of Safari.
from matplotlib-pyodide.
Thanks @ashley-hh ! Could you please copy paste it as a code snippet so that we wouldn't have to re-type it manually?
from matplotlib-pyodide.
Thanks! I can reproduce on Safari 14.1. As far as I can tell the error happens when calling sns.clustermap, even without the savefig part.
BTW, in Safari 13.1 I get,
Error: WebAssembly function with an i64 argument can't be called from JavaScript (
evaluating `dynCall("viiii", index, [a1, a2, a3, a4])`
The error is likely different because 14.1 got BigInt support. So far not much ideas of how to fix it, but clearly some argument is not being converted while it should be, since we are building without WASM_BIGINT as far as I know.
from matplotlib-pyodide.
The flag WASM_BIGINT
says that BigUint64Array
and BigInt64Array
exist. Emscripten always assumes that BigInt
exists.
from matplotlib-pyodide.
@hoodmane Are you sure? https://emscripten.org/docs/getting_started/FAQ.html#how-do-i-pass-int64-t-and-uint64-t-values-from-js-into-wasm-functions doesn't sound like it.
from matplotlib-pyodide.
It's funny, grepping around the emscripten source, I don't find much evidence for my claim that WASM_BIGINT
works this way, but the libffi tests pass when built without WASM_BIGINT
so that makes me think it's probably true anyways.
from matplotlib-pyodide.
Related Issues (20)
- Custom fonts
- a better method for configuring where matplotlib figures are added to the DOM HOT 3
- Move matplotlib benchmarks to this repo
- Add tests HOT 1
- Use matplotlib figures externally HOT 1
- matplotlab chinese font messy code HOT 1
- Document some pyodide matplotlib suggestions for node and deno HOT 4
- ModuleNotFoundError: No module named 'matplotlib.backends.html5_canvas_backend' in Pyodide v0.22.0 onwards HOT 1
- Add support for plt.pause(...) HOT 3
- Upgrade build dependency to v1.x HOT 3
- AttributeError: 'TimerWasm' object has no attribute '_timer' HOT 3
- setting plt.rcParams['figure.figsize'] does not work. HOT 1
- "module://matplotlib_pyodide.wasm_backend" should auto clear the old pictures instead of generate new pictures HOT 4
- matplotlib always generates double times of output divs HOT 1
- Interactive Slider Issue: 'Figure' object has no attribute 'canvas' HOT 3
- plotting fails with `document.pyodideMplTarget` set HOT 9
- Generating the same graph multiple times with new `document.pyodideMplTarget` objects cause every 2nd graph to disappear. HOT 1
- Attempts to grab fonts from `${origin}/fonts`? HOT 5
- html5_canvas_backend no longer works. HOT 2
- wasm_backend vs. html5_canvas_backend HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from matplotlib-pyodide.