Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I've been playing around to try and run python code from the web application. As such, we could have an analogous implementation in Python and use the nice web application to manage and analyse our experiments.
There are multiply ways to achieve this:
Advantage: easy (?!), actual python code is being executed
Disadvantage: long load time as it needs to initialize the full pyodide environment (though only inside the web worker)
Advantage: easy and fast, code can be optimized during build
Disadvantage: for the purpose of "proof of concept", this is not much different than just writing js/ts directly
Advantage: skips the overhead of loading pyodide and interpreting the python code; could scale to larger models and then be more efficient than js/ts
Disadvantage: more challenging, would make more sense with more performance oriented libraries like Rust or C++
I decided to try the first option. Some notes
run
method only, instead of the full BMI with all controlsI tried several approaches that go me almost there. Finally I managed to forward model output through comlink, but only through serialization on the python side and deserialization on the ts side. Then, comlink will do something similar again. How (un)desireable is that?
This PR still needs some work to reconcile the best elements of the different approaches I've tried and end up with a fully working version.