ISISComputingGroup / ISISComputingGroup/ibex_bluesky_core

Implement `read` and `describe` on the DAE configuration signals

Open
#25 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
4
Forks
0
Avg merge
1d 33m
Merged PRs (30d)
6

Description

If we want sub-values in the XML-encoded DAE configuration signals to be emitted in documents, we need to implement `read` and `describe`. We need to do this manually rather than via `StandardReadable`.

It's not immediately obvious that most of these _would_ ever want to be emitted in documents. But if we do want to do this, an example of how to do this for one signal is:

```python
async def read(self) -> Dict[str, Reading]:
reading = await self.period_settings.read()
period_settings = convert_xml_to_period_settings(reading[self.period_settings.name]["value"])

ts = reading[self.period_settings.name]["timestamp"]

return {
f"{self.name}-periods_soft_num": {
"value": period_settings.periods_soft_num,
"timestamp": ts,
}
}

async def describe(self) -> Dict[str, DataKey]:
return {
f"{self.name}-periods_soft_num": {
"dtype": "number",
"shape": [],
"source": self.period_settings.source
}
}
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.