4 ms·
Pyodide Spin Out and 0.17 Release
- rwlincoln 6y agoRecently, I was able to get Andes v1.3.5 (a Python package for power system transient dynamics simulation using SymPy) to run in WebAssembly using Pyodide v0.16.1. https://andesapp.github.io/ https://andesapp.github.io/
- rahimnathwani 6y agoI'm not your target user, but I'm curious what happens to the pjm5bus_out.txt file that's generated. Can you somehow make that available to JS so it can be downloaded by the user?
- mulmboy 6y agoYeah that can be done with BrowserFS - probably among other ways https://github.com/pyodide/pyodide/issues/613 https://github.com/pyodide/pyodide/issues/613
- rwlincoln 6y agoThe file is written to the in-memory virtual file system provided by Emscripten. It can be accessed from the console: pyodide._module.FS.readFile("/pjm5bus_out.txt", { encoding: 'utf8' }) I published this just to demonstrate that Time Domain Simulation was working to Hantao Cui, the author of Andes. Small Signal Stability Analysis will require SciPy and an ARPACK package. I would like to create a PWA that runs Andes in a web worker, like I did for MATPOWER: https://matpower.app/ https://matpower.app/
- geofft 6y agoI was curious how this differs from Brython. https://hacks.mozilla.org/2019/04/pyodide-bringing-the-scientific-python-stack-to-the-browser/ https://hacks.mozilla.org/2019/04/pyodide-bringing-the-scien... answers that: Pyodide is actual CPython compiled with emscripten, so you can build the existing ecosystem of native modules like NumPy and friends for Pyodide. Brython is a separate implementation.
- emrah 6y agoBrython is very slow, nice PoC but not very practical
- neoncontrails 6y agoDid this example confuse anyone else? > For instance, given an Array in JavaScript, > window.x = ["a", "b", "c"]; > We can access it in Python as, ''' >>> from js import x # import x from global Javascript scope >>> type(x) <class 'JsProxy'> >>> x[0] # can index x directly 'a' >>> x[1] = 'c' # modify x >>> x.to_py() # convert x to a Python list ['a', 'c'] ''' Should be ['a', 'c', 'c'], shouldn't it? Is this a typo? Implicit cast to set somewhere?
- rthz 6y agoYes, it was indeed a typo. Thanks!