AllenNeuralDynamics / AllenNeuralDynamics/brainwasher

Save/Reconstitute Starting State

オープン
#24 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
Python
スター
0
フォーク
1
PR マージ指標
30日以内にマージされた PR はありません

説明

It should be possible to reconstitute the starting state either from reset or from most software crash situations.

Requirements:
1. We need to know:
* waste container contents and volumes
* reaction vessel contents
* prime states
* nice-to-have: how much liquid was pulled from the source reservoirs
* nice-to-have: how many times each valve has been cycled (useful for scheduling replacements later).
* pump contents
We will probably reset everything else to put it into a known state (example: pump position).
1. We should be able to relaunch machine into this known state.

This become important in the event of a power failure where the machine may fail with liquid inside of it, and that liquid may need to be directed to a particular waste container.

A few implementation options exist:
* write the output state to a file in a known location on the PC
* double-buffer if needed (2 files)
* pass the state in as a filepath or data structure upon instrument `__init__`.
* re-wrap every method in a `try`/`finally` block ([link](https://stackoverflow.com/questions/11349183/how-to-wrap-every-method-of-a-class)), so that we can update state after every method executes.

For syntactically describing state, we can:
* use objects from pydantic so that we can serialize them to dictionary output in human readable form
* drawback: capturing anything state-like from a python object may need to be additionally represented in this model somewhere.
* ignore syntax altogether and just pickle live objects to a file every time we want to capture state.
* drawback: we can't read this
* If we can represent State through all keyword arguments across all object instances, we can just periodically update the config `devices` dict. Then when we relaunch, the system will recover from the correct state.

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。