Net class is the primary abstraction for interacting with hardware instruments. It provides a unified interface for controlling different types of hardware including power supplies, oscilloscopes, GPIO, ADC, DAC, and more.
Import
Class Methods
Instance Methods
Method Reference
Net.get(name, type, *, setup_function=None, teardown_function=None)
Create a Net instance for the specified net name and type.
Returns: Net instance appropriate for the specified type
Net.list_saved()
List all nets configured on the Lager Box.
list[dict] - List of net configurations with keys:
name(str) - Net namerole(str) - Net type/rolechannel(int) - Hardware channel numberinstrument(str) - Associated instrument type
Net.list_all_from_env()
List nets from the LAGER_MUXES environment variable (legacy behavior).
list[dict] - List of net information
Net.save_local_net(data)
Save a net configuration to the Lager Box.
Net.delete_local_net(name, role=None)
Delete a net configuration from the Lager Box.
Returns:
bool - True if net was deleted
Net.rename_local_net(old_name, new_name)
Rename a net configuration.
Returns:
bool - True if net was renamed
Net.get_local_nets()
Get all local net configurations.
list[dict] - List of net configuration dictionaries
Net.save_local_nets(nets)
Save multiple net configurations at once.
Net.delete_all_local_nets()
Delete all net configurations from the Lager Box.
bool - True if nets were deleted
Net.filter_nets(all_nets, name, role=None)
Filter a list of nets by name and optionally by role.
Returns:
list[dict] - Matching nets
enable()
Enable the net and connect to hardware.
- Analog: Connects to multiplexer and enables oscilloscope channel
- Logic: Enables logic analyzer channel
- Battery: Enables battery simulation output
- PowerSupply: Enables power supply output
- ELoad: Enables electronic load
disable(teardown=True)
Disable the net and disconnect from hardware.
NetType Enum
Available net types:Properties
name
Get the net name.
type
Get the net type.
Examples
List and Use Nets
Simple Nets (GPIO, ADC, DAC)
Complex Nets (Power, Scope)
Manage Net Configuration
Notes
- Simple nets (GPIO, ADC, DAC, Thermocouple) work directly without
enable()/disable()calls - Complex nets (Analog, Logic, PowerSupply, Battery, ELoad) require
enable()before use - Always call
disable()when finished with complex nets to properly release hardware - Net names must match those configured on the Lager Box
- Use
Net.list_saved()to see all available nets

