Source code for semi_cr.core.lab.pins.base
from collections.abc import Sequence
from typing import TypedDict
from qcodes.instrument import InstrumentBase, InstrumentChannel
[docs]
class PinInfo(TypedDict):
type: str
pads: Sequence[str]
Pins = dict[str, PinInfo]
PinMap = dict[str, Sequence[str]]
[docs]
class BasePinChannel(InstrumentChannel):
def __init__(
self,
parent,
name: str,
instruments: Sequence[InstrumentBase] | None = None,
**kwargs,
) -> None:
super().__init__(parent, name, **kwargs)
self._instruments = list(instruments or [])
@property
def instruments(self) -> list[InstrumentBase]:
return self._instruments
@instruments.setter
def instruments(self, instrument_list: Sequence[InstrumentBase]) -> None:
self._instruments = list(instrument_list)
def __repr__(self) -> str:
parent_short_name = self.parent.short_name
return (
f"<{type(self).__name__}: {self.short_name} of "
f"{type(self._parent).__name__}: {parent_short_name}>"
)