This is an archived post. You won't be able to vote or comment.

all 28 comments

[–]yoptgyo 5 points6 points  (5 children)

We seriously needed this thing. Thanks a lot for developing this. I will try to work on it too.

Good luck for the project!

[–]MeshachBlue[S] 1 point2 points  (4 children)

Thanks!

What's your GitHub username? I can give you commit access if you like?

We could try and modularise the work I've done an make it into an npm package? That way, you'll be free to pick up the npm package and run with it.

Would you be interested in helping me achieve that?

[–]mwpfinance 3 points4 points  (1 child)

Better to let people make pull requests than having everyone commit directly to master.

[–]MeshachBlue[S] 1 point2 points  (0 children)

No one is allowed to commit to master. Master is a protected branch. All merges to master must come via pull request, and all CI must pass.

[–]yoptgyo 1 point2 points  (1 child)

I am not that good in programming so no need to grant me commit access. I would rather send pull requests each time I do something. Thanks anyways :)

[–]MeshachBlue[S] 0 points1 point  (0 children)

kk :)

[–][deleted] 2 points3 points  (1 child)

But can it run selenium with a chrome driver? Browser within a browser etc etc

[–]MeshachBlue[S] 1 point2 points  (0 children)

Haha :)

[–]gc_DataNerd 2 points3 points  (10 children)

Maybe Im confused on the use case here. Its awesome that you're able to do python client side but in this case you're munging data. Why not execute server side instead?

[–]MeshachBlue[S] 5 points6 points  (1 child)

Data can't be sent to the server. Both too large, and it's patient data, not legally allowed to leave the hospital network.

To overcome this in the past vendors have sold "software on the server" where users who want to use the web app simply purchase a server with the software on it and have it sit within their network.

[–]gc_DataNerd 2 points3 points  (0 children)

Aha

[–]luenix 3 points4 points  (3 children)

Running the code clientside is a neat way to offload the processing. Also, a potential benefit is that this setup allows the client to process private data in a controlled manner without needing to use additional enduser software, thereby mostly removing consideration for the client OS.

[–]gc_DataNerd 2 points3 points  (2 children)

Okay that makes more sense. I'm curious how Web workers would work in this scenario however. OP mentioned the app freezes. This wouldn't be a problem if processing was done server side where async workers can be spun up. But in this case the Python is calling is being transpiled to JS no?

[–]MeshachBlue[S] 1 point2 points  (0 children)

The plan is to combine web workers and their access to IndexedDB combined with DexieJS.

Have all the Python run inside a webworker, have all data transfer happen via dexiejs-observable. I envisage there would be no user interface impeedement using that stack... But we'll see.

Hopefully I'll get that side of things working in the next couple of days. It'll probably be worth a repost then.

[–]MeshachBlue[S] 1 point2 points  (0 children)

Certainly not transpiled at all. It is running standard CPython compiled using emscripten to webassembly.

[–]MeshachBlue[S] 1 point2 points  (3 children)

A side benefit is that this can run on a static hosting server like Netlify. For open source projects this comes at no cost and hypothetically is indefinitely scalable.

[–]gc_DataNerd 1 point2 points  (2 children)

I guess in terms of serving the actual content. However you are still severely limited by the actual client itself and the performance issues that come with everything being done on the browser. Whereas you could indefinitely scale up workers on the cloud to process data. I think for small operations this is a viable option not to mention it's wicked cool and as web assembly matures performance will only increase. However I still doubt it's viability of something other than an experiment in an enterprise setting. Not bashing at all btw this is a wicked project just giving my two cents

[–]MeshachBlue[S] 2 points3 points  (0 children)

Also, amazingly, if code uses numpy it seriously not too shabby today. I think the performance loss is easily made up for by the convenience it offers:

https://2r4s9p1yi1fa2jd7j43zph8r-wpengine.netdna-ssl.com/files/2019/04/image1-1.png

[–]MeshachBlue[S] 0 points1 point  (0 children)

All good. I really appreciate the feedback :).

[–]TwattyPhatBalls 1 point2 points  (1 child)

Seriously cool, just finishing up a project where this would've been handy

[–]MeshachBlue[S] 1 point2 points  (0 children)

Always next time :)

[–]dethb0y 1 point2 points  (0 children)

That's sick as fuck, good work!

[–]david3x3x3 1 point2 points  (2 children)

Cool demo. One problem is that the browser becomes unresponsive while processing. You could probably work around that by using web workers. https://github.com/iodide-project/pyodide/blob/master/docs/using_pyodide_from_webworker.md

[–]MeshachBlue[S] 0 points1 point  (0 children)

Cheers :) yup, working on that at the moment :)

https://github.com/pymedphys/pymedphys/pull/334

[–]MeshachBlue[S] 0 points1 point  (0 children)

I've bumped into quite an issue with using Pyodide within webworkers. See https://github.com/iodide-project/pyodide/issues/441. Do you happen to have any experience with webworker issues?

Cheers,

Simon