IdnPattern#

class IdnPattern(
vendors: tuple[str, ...],
model: str,
num_channels: int | None = None,
)[source]#

Bases: object

Which *IDN? replies a driver handles.

Variables:
  • vendors (tuple[str, ...]) – Case-insensitive substrings, one of which must appear in the manufacturer field (e.g. ("KEYSIGHT TECHNOLOGIES", "AGILENT TECHNOLOGIES")).

  • model (str) – Regular expression searched case-insensitively in the model field. Anchor it (r"^DP83[12]") so a family pattern doesn’t swallow a longer model number.

  • num_channels (int | None) – SCPI-programmable channel count for the matched model, or None where the category doesn’t track channels (dmm, eload). Not necessarily the physical output count.

Example:

IdnPattern(vendors=("RIGOL TECHNOLOGIES",), model=r"^DP83[12]", num_channels=3)
vendors: tuple[str, ...]#
model: str#
num_channels: int | None = None#
matches(manufacturer: str, model: str) → bool[source]#

True when manufacturer contains one of vendors and model matches the regex.