AllenNeuralDynamics / AllenNeuralDynamics/brainwasher

Save/Reconstitute Starting State

Đang mở
#24 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
Python
Star
0
Fork
1
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

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.

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.