<commit_before># -*- coding: utf-8 -*-
"""
    lantz.drivers.tektronix.tds2024b
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    Implements the drivers to control an oscilloscope.

    :copyright: 2012 by Lantz Authors, see AUTHORS for more details.
    :license: BSD, see LICENSE for more details.
"""

from numpy import array, arange

from lantz.feat import Feat
from lantz.action import Action
from lantz.visa import VisaDriver

class TDS2024(VisaDriver):
    """Tektronix TDS2024 200 MHz 4 Channel Digital Real-Time Oscilloscope
    """

    def __init__(self, port):
        super().__init__(port)
        timeout=10

    @Action()
    def autoconf(self):
        """Autoconfig oscilloscope.
        """
        self.send(':AUTOS EXEC')

    def initialize(self):
        """initiate.
        """
        self.send(':ACQ:STATE ON')
        return "Init"

    @Feat()
    def idn(self):
        """IDN.
        """
        return self.query('ID?')

    @Feat()
    def trigger(self):
        """Trigger state.
        """
        return self.query(':TRIG:STATE?')

    @trigger.setter
    def trigger(self, mode):
        """Set trigger state.
        """
        self.query('TRIG:MAIN:MODE {}'.format(mode))

    @Action()
    def triggerlevel(self):
        """Set trigger level to 50% of the minimum adn maximum
        values of the signal.
        """
        self.send('TRIG:MAIn SATLevel')

    @Action()
    def forcetrigger(self):
        """Force trigger event.
        """
        self.send('TRIG FORCe')

    @Action()
    def datasource(self, chn):
        """Selects channel.
        """
        self.send(':DATA:SOURCE CH{}'.format(chn))

    @Action()
    def acqparams(self):
        """ X/Y Increment Origin and Offset.
        """
        commands = 'XZE?;XIN?;YZE?;YMU?;YOFF?'
        #params = self.query(":WFMPRE:XZE?;XIN?;YZE?;YMU?;YOFF?;")
        params = self.query(':WFMPRE:{}'.format(commands))
        params = {k: float(v) for k, v in zip(commands.split(';'), commands.split(';'))}<commit_msg>Corrected a minor mistake in the driver of TDS2024<commit_after># -*- coding: utf-8 -*-
"""
    lantz.drivers.tektronix.tds2024b
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    Implements the drivers to control an oscilloscope.

    :copyright: 2012 by Lantz Authors, see AUTHORS for more details.
    :license: BSD, see LICENSE for more details.
"""

from numpy import array, arange

from lantz.feat import Feat
from lantz.action import Action
from lantz.visa import VisaDriver

class TDS2024(VisaDriver):
    """Tektronix TDS2024 200 MHz 4 Channel Digital Real-Time Oscilloscope
    """

    def __init__(self, port):
        super().__init__(port)
        timeout=10

    @Action()
    def autoconf(self):
        """Autoconfig oscilloscope.
        """
        self.send(':AUTOS EXEC')

    def initialize(self):
        """initiate.
        """
        self.send(':ACQ:STATE ON')
        return "Init"

    @Feat()
    def idn(self):
        """IDN.
        """
        return self.query('ID?')

    @Feat()
    def trigger(self):
        """Trigger state.
        """
        return self.query(':TRIG:STATE?')

    @trigger.setter
    def trigger(self, mode):
        """Set trigger state.
        """
        self.query('TRIG:MAIN:MODE {}'.format(mode))

    @Action()
    def triggerlevel(self):
        """Set trigger level to 50% of the minimum adn maximum
        values of the signal.
        """
        self.send('TRIG:MAIn SATLevel')

    @Action()
    def forcetrigger(self):
        """Force trigger event.
        """
        self.send('TRIG FORCe')

    @Action()
    def datasource(self, chn):
        """Selects channel.
        """
        self.send(':DATA:SOURCE CH{}'.format(chn))

    @Action()
    def acqparams(self):
        """ X/Y Increment Origin and Offset.
        """
        commands = 'XZE?;XIN?;YZE?;YMU?;YOFF?'
        #params = self.query(":WFMPRE:XZE?;XIN?;YZE?;YMU?;YOFF?;")
        params = self.query(':WFMPRE:{}'.format(commands))
        params = {k: float(v) for k, v in zip(commands.split(';'), params.split(';'))}
{'fraction_non_alphanumeric': 0.1634355828220859, 'fraction_numerical': 0.013251533742331288, 'mean_word_length': 2.354732510288066, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5610755', 'n_tokens_mistral': 1374, 'n_tokens_neox': 1299, 'n_words': 317}