clement-moulin-frier / vivarium

MIT License
6 stars 0 forks source link

[WIP] Load scenes from clients #79

Closed Marsolo1 closed 4 days ago

Marsolo1 commented 7 months ago

Description

Added a system to load scenes with controllers, using grpc.

Related Issue (if applicable)

closes #63

How to Test

Launch the server

python3 scripts/run_server.py

Launch the Panel interface

panel serve scripts/run_interface.py --autoreload

instanciate a NotebookController

from vivarium.controllers.notebook_controller import NotebookController
controller = NotebookController()

call the load_scene func

controller.load_scene("session_1")

Now the scene should have changed and controller.agents should only show 1 agent.

IMPORTANT: Currently does not work with the web interface, you have to run it again to see the changes

Marsolo1 commented 7 months ago

@clement-moulin-frier @corentinlger For now the server part of loading scenes work, however the web interface causes lots of errors if it is active when loading a scene because of the periodic callback. Do you have any idea on how we could prevent that?

corentinlger commented 7 months ago

@clement-moulin-frier @corentinlger For now the server part of loading scenes work, however the web interface causes lots of errors if it is active when loading a scene because of the periodic callback. Do you have any idea on how we could prevent that?

@clement-moulin-frier To fix this we just used a lock system on the server side (to prevent sending data to clients if the new state hasn't been loaded yet). Now @Marsolo1 is seing how to reload the configs on client side when the scene has been updated on the server.

corentinlger commented 4 days ago

I close the PR because it is no longer compatible with current project API.