Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make last datapoint measured easily accessible #97

Open
g-kimbell opened this issue Sep 20, 2024 · 1 comment
Open

Make last datapoint measured easily accessible #97

g-kimbell opened this issue Sep 20, 2024 · 1 comment

Comments

@g-kimbell
Copy link

It would be very useful for us to easily access the last datapoint from a pipeline, e.g. if we want to check that we are measuring a sensible open circuit voltage.

The first solution is to snapshot and transfer the file, but this can be extremely slow.

I implemented a solution which grabs the last json file saved, however this is still relatively slow (ssh in, check data folder, transfer latest json)

Having this accessible from the database would be nice, for example 'ketchup status -vv' also gives a column with last datapoint of every pipeline.

@PeterKraus
Copy link
Contributor

PeterKraus commented Sep 20, 2024

The short term plan is to expose the current "status" of any component using the DriverInterface:

@in_devmap
def dev_status(self, key: tuple, **kwargs: dict) -> Reply:
"""
Get the status report from the specified device component.
Iterates over all :class:`Attrs` on the component that have `status=True` and
returns their values in a :class:`dict`.
"""

The actual implementation will then be up to the individual drivers. The rough plan is that if a task is running on the device, the task main loop handles caching the data and storing the latest "datapoint" on the instance of the component, which then gets returned by this dev_status call; if a task is not running, the hardware can be optionally queried for a reply with fresh data.

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

No branches or pull requests

3 participants
@PeterKraus @g-kimbell and others