Skip to content

Conversation

@KDW1
Copy link

@KDW1 KDW1 commented Jan 21, 2026

Added an alternative setting for the PathView application so that you can either use Pyodide web assembly or send client-side fetch requests to a Flask web server that has execution, evaluation, and traceback routes (the initialization code of the server borrows from the init() function found in worker.ts.

Major Changes:

  • Added a backendPreferenceStore which is nearly identical in form to themeStore since it switches between two binary values. It is binded to 'Q' (arbitrarily so), and toggling it calls switchBackend(preference : BackendPreference) from backend.ts
  • The backendPreferenceStore is accessed from backend.ts and passed in as an event parameter sent along with the "init" message posted to the worker. This sets the backendPreference for said worker
  • Every function within worker.ts that previously called await pyodide.runPythonAsync(...) now has a fetch request counterpart, such that the Flask backend route is shallow copy of what pyodide was doing

Current issues:

  • It seems like we're running multiple excess requests due to an error Scope: 'NoneType' object is not iterable which comes from the generateStreamingStartCode() function in pythonHelpers.ts, specifically the find_scopes() funciton

KDW1 added 21 commits January 14, 2026 11:38
…lp me identify what routes to replace with the Flask alternative
…ven't implemented nay backend changes), also added backendpref store and structure
…eyboard shortcuts, currently working on modifying handleRun and handleContinue
… out what other data structures (like nodeRegistry and some of the python generation code) I need to convert
…out how to replicate the validateGraphBridge() functionality
…imply redirect pyodide execution requests to the web server!
… -> Pyodide backend -> workers in order to avoid accessing localStorage from the level of the workers in the Pyodide backend
…he store, instead of the value being passed down! Also identified where the rror is thrown about a owrker not being initialized
… seem to have finished eval and exec. Trying to figure out how to run streaming with flask now
@RemDelaporteMathurin RemDelaporteMathurin changed the title Merging flask-backend branch into pathsim Adding a Flask backend Jan 21, 2026
@KDW1
Copy link
Author

KDW1 commented Jan 21, 2026

TODOS

  • Review the requirements for handleRun() in the main index page for the SvelteKit application, in terms of whether simulation is running or not, etc...
  • Fix the issue where the Flask version doesn't interact with the console's stdout and stderror
  • Fix the Scope: 'NoneType' object is not iterable error, which is most likely connected to the excess api calls!
  • Finish pull request description

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant