QsysShot¶
- class guppylang.emulator.QsysShot(entries: Iterable[TaggedResult] | None = None)[source]¶
Results from a single shot execution.
- __abstractmethods__ = frozenset({})¶
- __eq__(other)¶
Return self==value.
- __getitem__(index: int | slice) tuple[str, int | float | bool | list[int | float | bool]] | list[tuple[str, int | float | bool | list[int | float | bool]]] [source]¶
- __hash__ = None¶
- __repr__()¶
Return repr(self).
- as_dict() dict[str, int | float | bool | list[int | float | bool]] [source]¶
Convert results to a dictionary.
For duplicate tags, the last value is used.
- Returns:
dict: A dictionary where the keys are the tags and the values are the data.
- Example:
>>> results = QsysShot() >>> results.append("tag1", 1) >>> results.append("tag2", 2) >>> results.append("tag2", 3) >>> results.as_dict() {'tag1': 1, 'tag2': 3}
- collate_tags() dict[str, list[int | float | bool | list[int | float | bool]]] [source]¶
Collate all the entries with the same tag in to a dictionary with a list containing all the data for that tag.