Source code for qblox_scheduler.backends.qblox.enums
# Repository: https://gitlab.com/qblox/packages/software/qblox-scheduler
# Licensed according to the LICENSE file on the main branch
#
# Copyright 2020-2025, Quantify Consortium
# Copyright 2025, Qblox B.V.
"""Enums used by Qblox backend."""
from __future__ import annotations
import warnings
from enum import Enum, EnumMeta
[docs]
class _DeprecatedEnum(EnumMeta):
def __call__(cls, *args, **kwargs): # noqa: ANN204
if len(args) == 1:
item = args[0]
if (
item.lower() == "bypassed"
or item.lower() == "enabled"
or item.lower() == "delay_comp"
):
warnings.warn(
"QbloxFilterConfig and QbloxFilterMarkerDelay have been renamed to "
"FilterConfig and FilterMarkerDelay, "
"and will be deprecated in qblox_scheduler v2.0",
FutureWarning,
stacklevel=2,
)
return EnumMeta.__call__(cls, *args, **kwargs)
def __getattribute__(cls, item): # noqa: ANN001, ANN204
if item.lower() == "bypassed" or item.lower() == "enabled" or item.lower() == "delay_comp":
warnings.warn(
"QbloxFilterConfig and QbloxFilterMarkerDelay have been renamed to "
"FilterConfig and FilterMarkerDelay, "
"and will be deprecated in qblox_scheduler v2.0",
FutureWarning,
stacklevel=2,
)
return EnumMeta.__getattribute__(cls, item)
def __getitem__(cls, item): # noqa: ANN001, ANN204
if item.lower() == "bypassed" or item.lower() == "enabled" or item.lower() == "delay_comp":
warnings.warn(
"QbloxFilterConfig and QbloxFilterMarkerDelay have been renamed to "
"FilterConfig and FilterMarkerDelay, "
"and will be deprecated in qblox_scheduler v2.0",
FutureWarning,
stacklevel=2,
)
return EnumMeta.__getitem__(cls, item)
[docs]
class ChannelMode(str, Enum):
"""Enum for the channel mode of the Sequencer."""
[docs]
class FilterConfig(str, Enum):
"""Configuration of a filter."""
[docs]
DELAY_COMP = "delay_comp"
[docs]
class FilterMarkerDelay(str, Enum):
"""Marker delay setting of a filter."""
[docs]
DELAY_COMP = "delay_comp"
[docs]
class QbloxFilterConfig(str, Enum, metaclass=_DeprecatedEnum):
"""Deprecated."""
[docs]
DELAY_COMP = "delay_comp"
[docs]
class QbloxFilterMarkerDelay(str, Enum, metaclass=_DeprecatedEnum):
"""Deprecated."""
[docs]
DELAY_COMP = "delay_comp"
[docs]
class DistortionCorrectionLatencyEnum(int, Enum):
"""Settings related to distortion corrections."""
"""Setting for no distortion correction delay compensation"""
"""Setting for delay compensation equal to exponential overshoot or undershoot correction"""
"""Setting for delay compensation equal to exponential overshoot or undershoot correction"""
"""Setting for delay compensation equal to exponential overshoot or undershoot correction"""
"""Setting for delay compensation equal to exponential overshoot or undershoot correction"""
"""Setting for delay compensation equal to FIR filter"""
def __int__(self) -> int:
"""Enable direct conversion to int."""
return self.value
def __index__(self) -> int:
"""Support index operations."""
return self.value
def __and__(self, other: DistortionCorrectionLatencyEnum | int) -> int:
"""Support bitwise AND operations."""
if isinstance(other, Enum):
return self.value & other.value
return self.value & other
def __rand__(self, other: DistortionCorrectionLatencyEnum | int) -> int:
"""Support bitwise AND operations, other order."""
return self.__and__(other)
def __or__(self, other: DistortionCorrectionLatencyEnum | int) -> int:
"""Support bitwise OR operations."""
if isinstance(other, Enum):
return self.value | other.value
return self.value | other
def __ror__(self, other: DistortionCorrectionLatencyEnum | int) -> int:
"""Support bitwise OR operations, other order."""
return self.__or__(other)
[docs]
class LoCalEnum(str, Enum):
"""Settings related to the LO part of automatic mixer corrections."""
[docs]
ON_LO_FREQ_CHANGE = "on_lo_freq_change"
[docs]
ON_LO_INTERM_FREQ_CHANGE = "on_lo_interm_freq_change"
[docs]
class SidebandCalEnum(str, Enum):
"""Settings related to the NCO part of automatic mixer corrections."""
[docs]
ON_INTERM_FREQ_CHANGE = "on_interm_freq_change"