helpers

Helpers used by the tm_devices package.

Attributes

PACKAGE_NAME

Constant string with the name of this package.

PYVISA_PY_BACKEND

Constant string which indicates to use the pure Python PyVISA-py backend when creating VISA connections.

SYSTEM_DEFAULT_VISA_BACKEND

Constant string which indicates to use the current system’s default VISA backend when creating VISA connections.

USB_MODEL_ID_LOOKUP

A mapping of device model series to their USBTMC connection information.

VALID_DEVICE_CONNECTION_TYPES

Mapping of each device type to its supported connection types.

VISA_RESOURCE_EXPRESSION_REGEX

A regex pattern used to capture pieces of VISA resource expressions.

Classes

AliasDict

A custom dictionary class that supports aliases as secondary keys.

ConfigFileType

Class holding valid config file extensions.

ConnectionTypes

Class holding the valid connection types supported.

DMConfigOptions

Device Management Configuration options.

DeviceConfigEntry

Dataclass for holding configuration information for a single device.

DeviceTypes

Class holding the valid device types supported.

LoadImpedanceAFG

AFG/IAFG Impedance Values.

LoggingLevels

A class holding the valid logging levels supported.

ReadOnlyCachedProperty

An implementation of cached_property that is read-only.

SASSetWaveformFileTypes

Supported file types for the command MMEMory:OPEN:SASSet[:WAVeform].

SerialConfig

Serial configuration properties for connecting to a device over SERIAL (ASRL).

Singleton

A metaclass that converts a standard class into a Singleton (one instance).

SupportedModels

Class containing all model series supported by the device management system.

SupportedRequestTypes

All request types supported by a RESTAPIControl.

USBTMCConfiguration

Dataclass for holding USBTMC configuration information.

Functions

check_for_update

Check for an update for the provided package.

check_network_connection

Check the network connection to the device using the external ping command.

check_port_connection

Check if the given port is open on the device.

check_visa_connection

Check if a VISA connection can be made to the device.

configure_logging

Configure the logging for this package.

create_visa_connection

Create a VISA resource.

detect_visa_resource_expression

Check if a given string is a VISA resource expression.

disable_all_loggers

Temporarily disable all logging calls of severity ‘level’ and below within this context.

get_model_series

Get the series string from the full model number.

get_version

Get a Version object from a string.

get_visa_backend

Create a human-readable VISA backend name based on the currently used VISA library path.

ping_address

Ping the given address.

raise_error

Raise an AssertionError with the provided message indicating there was an error.

raise_failure

Raise an AssertionError with the provided message indicating there was a failure.

register_additional_usbtmc_mapping

Register USBTMC connection information for a device that doesn’t have native tm_devices USBTMC support.

sanitize_enum

Sanitize a string value into its enum value.

validate_address

Validate an IP address or hostname.

verify_values

Compare and verify actual value with expected value.

Modules

alias_dict

A Module containing a custom dictionary class that works with alias keys.

constants_and_dataclasses

Module containing constants and dataclasses for the tm_devices package.

dataclass_mixins

Module containing helper mixins for dataclasses.

enums

Module containing Enums for the tm_devices package.

functions

Module containing helpers for the tm_devices package.

logging

Helpers for logging.

read_only_cached_property

A read-only version of functools.cached_property.

singleton_metaclass

A Module containing a metaclass that converts any class into a Singleton.

standalone_helpers

Module containing helpers for the tm_devices package that only use standard library imports.

stubgen

Helper functions for adding to previously generated stub files.

verification_functions

Common functions for verifying values and printing out errors and failures.