ImperialCollegeLondon / gridlington-vis

BSD 3-Clause "New" or "Revised" License
1 stars 0 forks source link

Add ability to select Live model or preset data after startup #113

Open AdrianDAlessandro opened 7 months ago

AdrianDAlessandro commented 7 months ago

Problem: As it stands, the only way to run the vis system with the pre-set data is to run it in develop mode. This presents a couple of issues:

  1. The develop mode requires the entire code to be available so that the docker image can build, instead of pulling the image from github. This means the Live Model version and the Pre-set Data version can be out of sync.
  2. There is no ability to change between live and preset data without going into the machine and manually stopping and starting the container.
  3. Currently, the pre-set data version does not include any WESIM data, so there are no plots from it (like the weather table)

Proposed Solution: It's possible to add a toggle to the Control view to solve all three of the above. This will require some refactoring, so there probably isn't time for it, but it is possible.

A simpler solution that only fixes 1 would be to create a run_pre_set.sh that runs configure.py with a different argument that runs the production version but does not set LIVE_MODEL to true.

Number 3 can be solved by removing the if LIVE_MODEL statement at the top of data.py

pclemow commented 6 months ago

This is a particular problem given the pre-recorded data is likely to be the most common way to run the system. It would definitely be preferable to have it switchable but seperate run scripts for live and pre-recorded would be good too. Is that possible?

AdrianDAlessandro commented 6 months ago

I can throw the separate run scripts together very quickly, so I will do that. If the toggle turns out easier than I first thought, I'll do that too, but it might end up being a bit buggy.