Skip to content

Commit

Permalink
Merge 8fa4637 into 6c93c8d
Browse files Browse the repository at this point in the history
  • Loading branch information
terrorfisch committed Sep 30, 2021
2 parents 6c93c8d + 8fa4637 commit 481afe4
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 3 deletions.
4 changes: 3 additions & 1 deletion qupulse/hardware/awgs/tabor.py
Expand Up @@ -12,7 +12,7 @@

from qupulse.utils.types import ChannelID
from qupulse._program._loop import Loop, make_compatible
from qupulse.hardware.util import voltage_to_uint16, find_positions
from qupulse.hardware.util import voltage_to_uint16, find_positions, traced
from qupulse.hardware.awgs.base import AWG, AWGAmplitudeOffsetHandling
from qupulse._program.tabor import TaborSegment, TaborException, TaborProgram, PlottableProgram, TaborSequencing,\
make_combined_wave
Expand All @@ -21,6 +21,7 @@
__all__ = ['TaborAWGRepresentation', 'TaborChannelPair']


@traced
class TaborAWGRepresentation:
def __init__(self, instr_addr=None, paranoia_level=1, external_trigger=False, reset=False, mirror_addresses=()):
"""
Expand Down Expand Up @@ -306,6 +307,7 @@ def selector(channel_pair: 'TaborChannelPair', *args, **kwargs) -> Any:
return selector


@traced
class TaborChannelPair(AWG):
CONFIG_MODE_PARANOIA_LEVEL = None

Expand Down
3 changes: 2 additions & 1 deletion qupulse/hardware/awgs/tektronix.py
Expand Up @@ -19,7 +19,7 @@
from qupulse._program._loop import Loop, make_compatible
from qupulse._program.waveforms import Waveform as QuPulseWaveform
from qupulse.utils.types import TimeType
from qupulse.hardware.util import voltage_to_uint16, get_sample_times
from qupulse.hardware.util import voltage_to_uint16, get_sample_times, traced
from qupulse.utils import pairwise


Expand Down Expand Up @@ -238,6 +238,7 @@ def amplitudes(self) -> Tuple[float]:
return self._amplitudes


@traced
class TektronixAWG(AWG):
"""Driver for Tektronix AWG object (5000/7000 series).
Expand Down
3 changes: 3 additions & 0 deletions qupulse/hardware/awgs/zihdawg.py
Expand Up @@ -24,6 +24,7 @@
from qupulse._program.seqc import HDAWGProgramManager, UserRegister, WaveformFileSystem
from qupulse.hardware.awgs.base import AWG, ChannelNotFoundException, AWGAmplitudeOffsetHandling
from qupulse.pulses.parameters import ConstantParameter
from qupulse.hardware.util import traced


logger = logging.getLogger('qupulse.hdawg')
Expand All @@ -43,6 +44,7 @@ def valid_fn(*args, **kwargs):
return valid_fn


@traced
class HDAWGRepresentation:
"""HDAWGRepresentation represents an HDAWG8 instruments and manages a LabOne data server api session. A data server
must be running and the device be discoverable. Channels are per default grouped into pairs."""
Expand Down Expand Up @@ -290,6 +292,7 @@ class HDAWGModulationMode(Enum):
ADVANCED = 5 # AWG output modulates corresponding sines from modulation carriers.


@traced
class HDAWGChannelGroup(AWG):
"""Represents a channel pair of the Zurich Instruments HDAWG as an independent AWG entity.
It represents a set of channels that have to have(hardware enforced) the same control flow and sample rate.
Expand Down
2 changes: 2 additions & 0 deletions qupulse/hardware/dacs/alazar.py
Expand Up @@ -14,6 +14,7 @@

from qupulse.utils.types import TimeType
from qupulse.hardware.dacs.dac_base import DAC
from qupulse.hardware.util import traced


logger = logging.getLogger(__name__)
Expand Down Expand Up @@ -200,6 +201,7 @@ def __repr__(self):
return 'OneBufferPerWindow()'


@traced
class AlazarCard(DAC):
def __init__(self, card, config: Optional[ScanlineConfiguration]=None):
self.__card = card
Expand Down
10 changes: 9 additions & 1 deletion qupulse/hardware/util.py
Expand Up @@ -3,11 +3,19 @@

import numpy as np

try:
from autologging import traced
except ImportError:
def traced(obj):
"""Noop traced that is used if autologging package is not available"""
return obj

from qupulse._program.waveforms import Waveform
from qupulse.utils.types import TimeType
from qupulse.utils import pairwise

__all__ = ['voltage_to_uint16', 'get_sample_times']

__all__ = ['voltage_to_uint16', 'get_sample_times', 'traced']


def voltage_to_uint16(voltage: np.ndarray, output_amplitude: float, output_offset: float, resolution: int) -> np.ndarray:
Expand Down
1 change: 1 addition & 0 deletions setup.cfg
Expand Up @@ -45,6 +45,7 @@ tabor-instruments =
zurich-instruments = zhinst
Faster-fractions = gmpy2
tektronix = tek_awg>=0.2.1
autologging = autologging
# sadly not open source for external legal reasons
# commented out because pypi does not allow direct dependencies
# atsaverage = atsaverage @ git+ssh://git@git.rwth-aachen.de/qutech/cpp-atsaverage.git@master#egg=atsaverage&subdirectory=python_source
Expand Down

0 comments on commit 481afe4

Please sign in to comment.