> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.conductorquantum.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.conductorquantum.com/_mcp/server.

# stanza.base.channels



## Module Contents

### Classes

| Name | Description |
|------|-------------|
| [`ChannelConfig`](#stanzabasechannelschannelconfig) | Configuration for an instrument channel. |
| [`Parameter`](#stanzabasechannelsparameter) | Instrument parameter with validation and metadata. |
| [`Validators`](#stanzabasechannelsvalidators) | Common validators for instrument parameters. |
| [`InstrumentChannel`](#stanzabasechannelsinstrumentchannel) | Base class for instrument channels with parameter management. |
| [`ControlChannel`](#stanzabasechannelscontrolchannel) | Standard control channel implementation with voltage parameter. |
| [`MeasurementChannel`](#stanzabasechannelsmeasurementchannel) | Standard measurement channel implementation with measurement parameters. |

### API

```python
class stanza.base.channels.ChannelConfig
```

Configuration for an instrument channel.

Attributes:
    name: Unique channel string identifier, used to reference
        the gate or contact on the device
    voltage_range: Min and max voltage limits (V)
    control_channel: Physical control channel number
    measure_channel: Physical measurement channel number
    output_mode: Output mode (dc, ac, etc.)
    enabled: Whether channel is enabled
    unit: Channel units
    metadata: Additional channel metadata

```python
name: str
```

**Value**: `None`


```python
voltage_range: tuple[float | None, float | None]
```

**Value**: `None`


```python
pad_type: stanza.models.PadType
```

**Value**: `None`


```python
electrode_type: stanza.models.GateType | stanza.models.ContactType | stanza.models.GPIOType
```

**Value**: `None`


```python
control_channel: int | None
```

**Value**: `None`


```python
measure_channel: int | None
```

**Value**: `None`


```python
breakout_channel: int | None
```

**Value**: `None`


```python
output_mode: str
```

**Value**: `dc`


```python
enabled: bool
```

**Value**: `True`


```python
unit: str
```

**Value**: `V`


```python
metadata: dict[str, typing.Any] | None
```

**Value**: `None`


```python
__post_init__() -> None
```


```python
class stanza.base.channels.Parameter
```

Instrument parameter with validation and metadata.

Attributes:
    name: Parameter name
    value: Current parameter value
    unit: Parameter unit
    validator: Value validation function
    getter: Value getter function
    setter: Value setter function
    metadata: Additional parameter metadata

```python
name: str
```

**Value**: `None`


```python
value: typing.Any
```

**Value**: `None`


```python
unit: str
```

**Value**: ``


```python
validator: collections.abc.Callable[[typing.Any], bool] | None
```

**Value**: `None`


```python
getter: collections.abc.Callable[[], typing.Any] | None
```

**Value**: `None`


```python
setter: collections.abc.Callable[[typing.Any], None] | None
```

**Value**: `None`


```python
metadata: dict[str, typing.Any] | None
```

**Value**: `None`


```python
__post_init__() -> None
```


```python
validate(value: typing.Any) -> bool
```

Validate parameter value.


```python
set(value: typing.Any) -> None
```

Set parameter value with validation.


```python
get() -> typing.Any
```

Get parameter value.


```python
class stanza.base.channels.Validators
```

Common validators for instrument parameters.

```python
range_validator(
    min_val: float, max_val: float
) -> collections.abc.Callable[[float], bool]
```

Create a range validator.

**Parameters:**

<ParamField path="min_val" type="float">
  Minimum allowed value
</ParamField>

<ParamField path="max_val" type="float">
  Maximum allowed value
</ParamField>

**Returns:**

Validator function that checks if value is within range


```python
positive_validator(value: float) -> bool
```

Validate that value is positive.


```python
negative_validator(value: float) -> bool
```

Validate that value is negative.


```python
non_zero_validator(value: float) -> bool
```

Validate that value is non-zero.


```python
class stanza.base.channels.InstrumentChannel(config: stanza.base.channels.ChannelConfig)
```

**Bases**: `abc.ABC`

Base class for instrument channels with parameter management.

Attributes:
    name: Unique channel string identifier
    channel_id: Physical channel identifier
    config: Channel configuration
    parameters: Dictionary of channel parameters

### Initialization

Initialize instrument channel.


```python
__str__() -> str
```

Return a string representation of the channel.


```python
channel_info: dict[str, typing.Any]
```

Return a dictionary of channel information.


```python
_setup_parameters() -> None
```

Setup channel-specific parameters.

Must be implemented by subclasses to define their specific parameters.


```python
add_parameter(param: stanza.base.channels.Parameter) -> None
```

Add a parameter to this channel.


```python
get_parameter(name: str) -> stanza.base.channels.Parameter
```

Get parameter by name.


```python
set_parameter(
    name: str, value: typing.Any
) -> None
```

Set parameter value.


```python
get_parameter_value(name: str) -> typing.Any
```

Get parameter value.


```python
class stanza.base.channels.ControlChannel(config: stanza.base.channels.ChannelConfig)
```

**Bases**: `stanza.base.channels.InstrumentChannel`

Standard control channel implementation with voltage parameter.

Provides voltage control functionality with range validation based on
the channel configuration.

### Initialization

Initialize instrument channel.


```python
_setup_parameters() -> None
```

Setup voltage parameter with range validation.


```python
class stanza.base.channels.MeasurementChannel(config: stanza.base.channels.ChannelConfig)
```

**Bases**: `stanza.base.channels.InstrumentChannel`

Standard measurement channel implementation with measurement parameters.

Provides current measurement functionality with conversion factor support
for ADC-based measurements.

### Initialization

Initialize instrument channel.


```python
_setup_parameters() -> None
```

Setup measurement parameters with validation.