repo_id
stringclasses
400 values
commit_sha
stringclasses
400 values
commit_index
int32
0
951
in_repo_split
stringclasses
1 value
cross_repo_split
stringclasses
1 value
test_file
stringlengths
7
121
test_function
stringlengths
1
108
assertion_type
stringclasses
32 values
difficulty
stringclasses
8 values
context_lines
int32
3
600
prefix
large_stringlengths
44
113k
target
large_stringlengths
1
498
anchor_sha
stringclasses
400 values
anchor_index
int32
0
951
qna_source
stringclasses
1 value
pymeasure/pymeasure
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
train
train
tests/adapters/test_protocol.py
test_write_and_read_with_and_without_bytes
assert
string_literal
22
from unittest.mock import call import pytest from pymeasure.adapters.protocol import to_bytes, ProtocolAdapter from pytest import mark, raises, fixture, warns def adapter(): return ProtocolAdapter() def mockAdapter(): adapter = ProtocolAdapter(connection_attributes={'timeout': 100}, ...
b"a"
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
v2_extractor_at_anchor
pymeasure/pymeasure
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
train
train
tests/adapters/test_protocol.py
test_write
assert
string_literal
21
from unittest.mock import call import pytest from pymeasure.adapters.protocol import to_bytes, ProtocolAdapter from pytest import mark, raises, fixture, warns def adapter(): return ProtocolAdapter() def mockAdapter(): adapter = ProtocolAdapter(connection_attributes={'timeout': 100}, ...
b"5"
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
v2_extractor_at_anchor
pymeasure/pymeasure
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
train
train
tests/display/test_inputs.py
test_init_from_param
assert
string_literal
40
import pytest from unittest import mock from pymeasure.display.Qt import QtCore from pymeasure.display.inputs import ScientificInput, BooleanInput, ListInput from pymeasure.experiment.parameters import BooleanParameter, ListParameter, FloatParameter class TestScientificInput: @pytest.mark.parametrize("min_,max_,d...
' m'
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
v2_extractor_at_anchor
pymeasure/pymeasure
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
train
train
tests/instruments/mksinst/test_mks974b.py
test_status
assert
string_literal
14
import pytest from pymeasure.test import expected_protocol from pymeasure.instruments.mksinst.mks974b import MKS974B, Unit def test_status(): """Verify the communication of the status.""" with expected_protocol( MKS974B, [("@253T?", "@253ACKO"), (None, b"FF")], ) as inst: ...
"Ok"
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
v2_extractor_at_anchor
pymeasure/pymeasure
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
train
train
tests/instruments/oxfordinstruments/test_ips120_10.py
test_control_mode_getter
assert
string_literal
10
from pymeasure.test import expected_protocol from pymeasure.instruments.oxfordinstruments.ips120_10 import IPS120_10 def test_control_mode_getter(): with expected_protocol(IPS120_10, [("X", "X00A0C1M00P00")] ) as inst: assert inst.control_mode ==
"RL"
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
v2_extractor_at_anchor
pymeasure/pymeasure
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
train
train
tests/instruments/oxfordinstruments/test_ps120_10.py
test_control_mode_getter
assert
string_literal
10
from pymeasure.test import expected_protocol from pymeasure.instruments.oxfordinstruments.ps120_10 import PS120_10 def test_control_mode_getter(): with expected_protocol(PS120_10, [("X", "X00A0C1M00P00")] ) as inst: assert inst.control_mode ==
"RL"
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
v2_extractor_at_anchor
pymeasure/pymeasure
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
train
train
tests/instruments/redpitaya/test_redpitaya_scpi.py
test_ain1_gain_getter
assert
string_literal
14
import datetime import pytest from pymeasure.test import expected_protocol from pymeasure.instruments.redpitaya import RedPitayaScpi def test_ain1_gain_getter(): with expected_protocol( RedPitayaScpi, [(b'ACQ:SOUR1:GAIN?', b'LV')], ) as inst: assert inst.ain1.gain ==
'LV'
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
v2_extractor_at_anchor
pymeasure/pymeasure
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
train
train
tests/instruments/redpitaya/test_redpitaya_scpi_with_device.py
test_acquisition
assert
string_literal
64
import datetime import pytest from pymeasure.instruments.redpitaya import RedPitayaScpi def redpitaya_scpi(connected_device_address: str): """ to use the tests in this file invoke pytest as: pytest -k redpitaya_scpi --device-address TCPIP::x.y.z.k::port::SOCKET where you replace x.y.z.k byt the device IP ...
'LV'
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
v2_extractor_at_anchor
pymeasure/pymeasure
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
train
train
tests/instruments/teledyne/test_teledyneMAUI.py
test_bwlimit
assert
string_literal
29
import pytest from pymeasure.instruments.teledyne.teledyne_oscilloscope import sanitize_source from pymeasure.instruments.teledyne.teledyneMAUI import TeledyneMAUI from pymeasure.test import expected_protocol INVALID_CHANNELS = ["INVALID_SOURCE", "C1 C2", "C1 MATH", "C1234567", "CHANNEL"] VALID_CHANNELS = [('C1', 'C1...
"ON"
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
v2_extractor_at_anchor
pymeasure/pymeasure
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
train
train
tests/instruments/test_connection_configuration.py
test_distinct_interface_specific_defaults
assert
string_literal
15
import pytest import serial from pymeasure.adapters import SerialAdapter, VISAAdapter from pymeasure.instruments import Instrument def test_distinct_interface_specific_defaults(): """As an instrument implementor, I can easily prescribe default settings that are different between interfaces. """ instr1...
'\r'
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
v2_extractor_at_anchor
pymeasure/pymeasure
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
train
train
tests/adapters/test_adapter.py
test_write
assert
string_literal
17
import logging from unittest import mock import pytest from pymeasure.adapters import Adapter, FakeAdapter, ProtocolAdapter def adapter(): return Adapter() def fake(): return FakeAdapter() def test_write(fake): fake.write("abc") assert fake._buffer ==
"abc"
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
v2_extractor_at_anchor
pymeasure/pymeasure
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
train
train
tests/adapters/test_protocol.py
test_read_write_sequence
assert
string_literal
24
from unittest.mock import call import pytest from pymeasure.adapters.protocol import to_bytes, ProtocolAdapter from pytest import mark, raises, fixture, warns def adapter(): return ProtocolAdapter() def mockAdapter(): adapter = ProtocolAdapter(connection_attributes={'timeout': 100}, ...
b"a3"
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
v2_extractor_at_anchor
pymeasure/pymeasure
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
train
train
tests/adapters/test_protocol.py
test_read_write_sequence
assert
string_literal
26
from unittest.mock import call import pytest from pymeasure.adapters.protocol import to_bytes, ProtocolAdapter from pytest import mark, raises, fixture, warns def adapter(): return ProtocolAdapter() def mockAdapter(): adapter = ProtocolAdapter(connection_attributes={'timeout': 100}, ...
b"a4"
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
v2_extractor_at_anchor
pymeasure/pymeasure
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
train
train
tests/experiment/test_sequencer.py
test_sequencer
assert
variable
41
import pytest from io import StringIO from pymeasure.experiment.sequencer import SequenceHandler, SequenceEvaluationError def non_empty_lines(text): lines = text.split("\n") linect = 0 for line in lines: if line.strip() != "": linect += 1 return linect @pytest.mark.parametrize("se...
c
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
v2_extractor_at_anchor
pymeasure/pymeasure
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
train
train
tests/instruments/agilent/test_agilentE5062A.py
test_ch_traces
assert
variable
63
import pytest from pymeasure.test import expected_protocol from pymeasure.instruments.agilent.agilentE5062A import AgilentE5062A import numpy as np DISPLAY_LAYOUT_OPTIONS = [ "D1", "D12", "D1_2", "D112", "D1_1_2", "D123", "D1_2_3", "D12_33", "D...
p
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
v2_extractor_at_anchor
pymeasure/pymeasure
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
train
train
tests/instruments/agilent/test_agilentE5062A.py
test_ch_start_frequency
assert
variable
58
import pytest from pymeasure.test import expected_protocol from pymeasure.instruments.agilent.agilentE5062A import AgilentE5062A import numpy as np DISPLAY_LAYOUT_OPTIONS = [ "D1", "D12", "D1_2", "D112", "D1_1_2", "D123", "D1_2_3", "D12_33", "D...
f
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
v2_extractor_at_anchor
pymeasure/pymeasure
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
train
train
tests/instruments/agilent/test_agilentE5062A.py
test_ch_sweep_type
assert
variable
62
import pytest from pymeasure.test import expected_protocol from pymeasure.instruments.agilent.agilentE5062A import AgilentE5062A import numpy as np DISPLAY_LAYOUT_OPTIONS = [ "D1", "D12", "D1_2", "D112", "D1_1_2", "D123", "D1_2_3", "D12_33", "D...
t
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
v2_extractor_at_anchor
pymeasure/pymeasure
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
train
train
tests/instruments/agilent/test_agilentE5062A.py
test_ch_averaging
assert
variable
66
import pytest from pymeasure.test import expected_protocol from pymeasure.instruments.agilent.agilentE5062A import AgilentE5062A import numpy as np DISPLAY_LAYOUT_OPTIONS = [ "D1", "D12", "D1_2", "D112", "D1_1_2", "D123", "D1_2_3", "D12_33", "D...
n
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
v2_extractor_at_anchor
pymeasure/pymeasure
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
train
train
tests/instruments/agilent/test_agilentE5062A_with_device.py
test_ch_start_frequency
assert
variable
34
import pytest from pymeasure.instruments.agilent.agilentE5062A import AgilentE5062A import numpy as np DISPLAY_LAYOUT_OPTIONS = [ "D1", "D12", "D1_2", "D112", "D1_1_2", "D123", "D1_2_3", "D12_33", "D11_23", "D13_23", "D12_13", ...
f
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
v2_extractor_at_anchor
pymeasure/pymeasure
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
train
train
tests/instruments/agilent/test_agilentE5062A_with_device.py
test_ch_scan_points
assert
variable
34
import pytest from pymeasure.instruments.agilent.agilentE5062A import AgilentE5062A import numpy as np DISPLAY_LAYOUT_OPTIONS = [ "D1", "D12", "D1_2", "D112", "D1_1_2", "D123", "D1_2_3", "D12_33", "D11_23", "D13_23", "D12_13", ...
p
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
v2_extractor_at_anchor
pymeasure/pymeasure
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
train
train
tests/instruments/agilent/test_agilentE5062A_with_device.py
test_ch_sweep_type
assert
variable
34
import pytest from pymeasure.instruments.agilent.agilentE5062A import AgilentE5062A import numpy as np DISPLAY_LAYOUT_OPTIONS = [ "D1", "D12", "D1_2", "D112", "D1_1_2", "D123", "D1_2_3", "D12_33", "D11_23", "D13_23", "D12_13", ...
t
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
v2_extractor_at_anchor
pymeasure/pymeasure
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
train
train
tests/instruments/agilent/test_agilentE5062A_with_device.py
test_ch_averaging
assert
variable
37
import pytest from pymeasure.instruments.agilent.agilentE5062A import AgilentE5062A import numpy as np DISPLAY_LAYOUT_OPTIONS = [ "D1", "D12", "D1_2", "D112", "D1_1_2", "D123", "D1_2_3", "D12_33", "D11_23", "D13_23", "D12_13", ...
n
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
v2_extractor_at_anchor
pymeasure/pymeasure
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
train
train
tests/instruments/agilent/test_agilentE5062A.py
test_ch_IF_bandwidth
assert
variable
58
import pytest from pymeasure.test import expected_protocol from pymeasure.instruments.agilent.agilentE5062A import AgilentE5062A import numpy as np DISPLAY_LAYOUT_OPTIONS = [ "D1", "D12", "D1_2", "D112", "D1_1_2", "D123", "D1_2_3", "D12_33", "D...
bw
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
v2_extractor_at_anchor
pymeasure/pymeasure
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
train
train
tests/instruments/agilent/test_agilentE5062A_with_device.py
test_ch_IF_bandwidth
assert
variable
34
import pytest from pymeasure.instruments.agilent.agilentE5062A import AgilentE5062A import numpy as np DISPLAY_LAYOUT_OPTIONS = [ "D1", "D12", "D1_2", "D112", "D1_1_2", "D123", "D1_2_3", "D12_33", "D11_23", "D13_23", "D12_13", ...
bw
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
v2_extractor_at_anchor
pymeasure/pymeasure
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
train
train
tests/adapters/test_serial.py
test_adapter_write_read
assert
variable
13
import pytest import serial from pymeasure.adapters import SerialAdapter def adapter(): return SerialAdapter(serial.serial_for_url("loop://", timeout=0.2)) @pytest.mark.parametrize("msg", ["OUTP\n", "POWER 22 dBm\n"]) def test_adapter_write_read(adapter, msg): adapter.write(msg) assert adapter.read() ==...
msg
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
v2_extractor_at_anchor
pymeasure/pymeasure
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
train
train
tests/experiment/test_sequencer.py
test_sequencer
assert
variable
39
import pytest from io import StringIO from pymeasure.experiment.sequencer import SequenceHandler, SequenceEvaluationError def non_empty_lines(text): lines = text.split("\n") linect = 0 for line in lines: if line.strip() != "": linect += 1 return linect @pytest.mark.parametrize("se...
lev
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
v2_extractor_at_anchor
pymeasure/pymeasure
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
train
train
tests/instruments/agilent/test_agilentE5062A.py
test_ch_visible_traces
assert
variable
64
import pytest from pymeasure.test import expected_protocol from pymeasure.instruments.agilent.agilentE5062A import AgilentE5062A import numpy as np DISPLAY_LAYOUT_OPTIONS = [ "D1", "D12", "D1_2", "D112", "D1_1_2", "D123", "D1_2_3", "D12_33", "D...
opt
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
v2_extractor_at_anchor
pymeasure/pymeasure
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
train
train
tests/instruments/agilent/test_agilentE5062A.py
test_trigger_source
assert
variable
61
import pytest from pymeasure.test import expected_protocol from pymeasure.instruments.agilent.agilentE5062A import AgilentE5062A import numpy as np DISPLAY_LAYOUT_OPTIONS = [ "D1", "D12", "D1_2", "D112", "D1_1_2", "D123", "D1_2_3", "D12_33", "D...
src
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
v2_extractor_at_anchor
pymeasure/pymeasure
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
train
train
tests/instruments/agilent/test_agilentE5062A_with_device.py
test_trigger_source
assert
variable
33
import pytest from pymeasure.instruments.agilent.agilentE5062A import AgilentE5062A import numpy as np DISPLAY_LAYOUT_OPTIONS = [ "D1", "D12", "D1_2", "D112", "D1_1_2", "D123", "D1_2_3", "D12_33", "D11_23", "D13_23", "D12_13", ...
src
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
v2_extractor_at_anchor
pymeasure/pymeasure
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
train
train
tests/instruments/agilent/test_agilentE5062A_with_device.py
test_ch_visible_traces
assert
variable
36
import pytest from pymeasure.instruments.agilent.agilentE5062A import AgilentE5062A import numpy as np DISPLAY_LAYOUT_OPTIONS = [ "D1", "D12", "D1_2", "D112", "D1_1_2", "D123", "D1_2_3", "D12_33", "D11_23", "D13_23", "D12_13", ...
opt
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
v2_extractor_at_anchor
pymeasure/pymeasure
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
train
train
tests/instruments/hp/test_hp8116a_with_device.py
test_given_ask_called_then_return_value_valid
assert
variable
53
import pytest import math import time from pymeasure.instruments.hp import HP8116A, hp8116a pytest.skip('Only work with connected hardware', allow_module_level=True) class TestHP8116A: RESOURCE = 'GPIB0::12' HAS_OPTION_001 = True BOOLEANS = [False, True] OPERATING_MODES_WO_OPT001 = ['normal', 'trigg...
str
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
v2_extractor_at_anchor
pymeasure/pymeasure
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
train
train
tests/instruments/hp/test_hp8116a_with_device.py
test_given_ask_called_then_return_value_valid
assert
variable
54
import pytest import math import time from pymeasure.instruments.hp import HP8116A, hp8116a pytest.skip('Only work with connected hardware', allow_module_level=True) class TestHP8116A: RESOURCE = 'GPIB0::12' HAS_OPTION_001 = True BOOLEANS = [False, True] OPERATING_MODES_WO_OPT001 = ['normal', 'trigg...
ret
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
v2_extractor_at_anchor
pymeasure/pymeasure
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
train
train
tests/adapters/test_serial_with_loopback.py
test_read_all
assert
variable
39
import pytest from serial import Serial from time import time from pymeasure.adapters import SerialAdapter class TestSerialLoopback: ADAPTER_TIMEOUT = 1.0 # Seconds def adapter(self, connected_device_address): device = connected_device_address.split(",")[0] return SerialAdapter( ...
data
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
v2_extractor_at_anchor
pymeasure/pymeasure
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
train
train
tests/display/test_inputs.py
test_init_from_param
assert
variable
37
import pytest from unittest import mock from pymeasure.display.Qt import QtCore from pymeasure.display.inputs import ScientificInput, BooleanInput, ListInput from pymeasure.experiment.parameters import BooleanParameter, ListParameter, FloatParameter class TestScientificInput: @pytest.mark.parametrize("min_,max_,d...
min_
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
v2_extractor_at_anchor
pymeasure/pymeasure
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
train
train
tests/display/test_inputs.py
test_init_from_param
assert
variable
38
import pytest from unittest import mock from pymeasure.display.Qt import QtCore from pymeasure.display.inputs import ScientificInput, BooleanInput, ListInput from pymeasure.experiment.parameters import BooleanParameter, ListParameter, FloatParameter class TestScientificInput: @pytest.mark.parametrize("min_,max_,d...
max_
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
v2_extractor_at_anchor
pymeasure/pymeasure
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
train
train
tests/experiment/test_procedure.py
test_parameters
assert
variable
21
import pytest import pickle from pymeasure.experiment.procedure import Procedure, ProcedureWrapper from pymeasure.experiment.parameters import Parameter from pymeasure.units import ureg from data.procedure_for_testing import RandomProcedure def test_parameters(): class TestProcedure(Procedure): x = Param...
objs
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
v2_extractor_at_anchor
pymeasure/pymeasure
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
train
train
tests/experiment/test_results.py
test_parameter_reading
assert
variable
34
import os import pickle import tempfile from unittest import mock import pandas as pd import pytest import numpy as np from pymeasure.units import ureg from pymeasure.experiment.results import Results, CSVFormatter from pymeasure.experiment.procedure import Procedure, Parameter from pymeasure.experiment import Boolea...
seed
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
v2_extractor_at_anchor
pymeasure/pymeasure
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
train
train
tests/instruments/hp/test_hp8116a_with_device.py
test_operating_modes_no_option001
assert
variable
56
import pytest import math import time from pymeasure.instruments.hp import HP8116A, hp8116a pytest.skip('Only work with connected hardware', allow_module_level=True) class TestHP8116A: RESOURCE = 'GPIB0::12' HAS_OPTION_001 = True BOOLEANS = [False, True] OPERATING_MODES_WO_OPT001 = ['normal', 'trigg...
case
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
v2_extractor_at_anchor
pymeasure/pymeasure
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
train
train
tests/instruments/hp/test_hp8116a_with_device.py
test_given_resetted_when_check_errors_then_no_error
assert
variable
53
import pytest import math import time from pymeasure.instruments.hp import HP8116A, hp8116a pytest.skip('Only work with connected hardware', allow_module_level=True) class TestHP8116A: RESOURCE = 'GPIB0::12' HAS_OPTION_001 = True BOOLEANS = [False, True] OPERATING_MODES_WO_OPT001 = ['normal', 'trigg...
list
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
v2_extractor_at_anchor
pymeasure/pymeasure
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
train
train
tests/adapters/test_protocol.py
test_write_index
assert
numeric_literal
30
from unittest.mock import call import pytest from pymeasure.adapters.protocol import to_bytes, ProtocolAdapter from pytest import mark, raises, fixture, warns def adapter(): return ProtocolAdapter() def mockAdapter(): adapter = ProtocolAdapter(connection_attributes={'timeout': 100}, ...
1
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
v2_extractor_at_anchor
pymeasure/pymeasure
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
train
train
tests/adapters/test_protocol.py
test_partial_write
assert
numeric_literal
32
from unittest.mock import call import pytest from pymeasure.adapters.protocol import to_bytes, ProtocolAdapter from pytest import mark, raises, fixture, warns def adapter(): return ProtocolAdapter() def mockAdapter(): adapter = ProtocolAdapter(connection_attributes={'timeout': 100}, ...
0
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
v2_extractor_at_anchor
pymeasure/pymeasure
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
train
train
tests/adapters/test_serial_with_loopback.py
test_read
assert
numeric_literal
31
import pytest from serial import Serial from time import time from pymeasure.adapters import SerialAdapter class TestSerialLoopback: ADAPTER_TIMEOUT = 1.0 # Seconds def adapter(self, connected_device_address): device = connected_device_address.split(",")[0] return SerialAdapter( ...
3
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
v2_extractor_at_anchor
pymeasure/pymeasure
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
train
train
tests/adapters/test_visa.py
test_write_read
assert
numeric_literal
34
import importlib.util import pytest import pyvisa from pymeasure.adapters import VISAAdapter from pymeasure.test import expected_protocol SIM_RESOURCE = 'ASRL2::INSTR' is_pyvisa_sim_installed = bool(importlib.util.find_spec('pyvisa_sim')) def adapter(): adapter = VISAAdapter(SIM_RESOURCE, visa_library='@sim', ...
1
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
v2_extractor_at_anchor
pymeasure/pymeasure
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
train
train
tests/display/test_inputs.py
test_setValue_within_range_should_set
assert
numeric_literal
19
import pytest from unittest import mock from pymeasure.display.Qt import QtCore from pymeasure.display.inputs import ScientificInput, BooleanInput, ListInput from pymeasure.experiment.parameters import BooleanParameter, ListParameter, FloatParameter class TestScientificInput: def test_setValue_within_range_shoul...
5
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
v2_extractor_at_anchor
pymeasure/pymeasure
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
train
train
tests/experiment/test_metadata.py
test_metadata_default
assert
numeric_literal
9
import pytest from pymeasure.experiment.parameters import Metadata from pymeasure.experiment.procedure import Procedure def test_metadata_default(): p = Metadata('Test', default=5) assert p.value ==
5
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
v2_extractor_at_anchor
pymeasure/pymeasure
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
train
train
tests/experiment/test_parameters.py
test_parameter_default
assert
numeric_literal
13
import pytest from pymeasure.experiment.parameters import Parameter from pymeasure.experiment.parameters import IntegerParameter from pymeasure.experiment.parameters import BooleanParameter from pymeasure.experiment.parameters import FloatParameter from pymeasure.experiment.parameters import ListParameter from pymeasu...
5
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
v2_extractor_at_anchor
pymeasure/pymeasure
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
train
train
tests/experiment/test_parameters.py
test_integer_value
assert
numeric_literal
18
import pytest from pymeasure.experiment.parameters import Parameter from pymeasure.experiment.parameters import IntegerParameter from pymeasure.experiment.parameters import BooleanParameter from pymeasure.experiment.parameters import FloatParameter from pymeasure.experiment.parameters import ListParameter from pymeasu...
0
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
v2_extractor_at_anchor
pymeasure/pymeasure
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
train
train
tests/experiment/test_parameters.py
test_list_value
assert
numeric_literal
14
import pytest from pymeasure.experiment.parameters import Parameter from pymeasure.experiment.parameters import IntegerParameter from pymeasure.experiment.parameters import BooleanParameter from pymeasure.experiment.parameters import FloatParameter from pymeasure.experiment.parameters import ListParameter from pymeasu...
1
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
v2_extractor_at_anchor
pymeasure/pymeasure
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
train
train
tests/experiment/test_procedure.py
test_parameters
assert
numeric_literal
16
import pytest import pickle from pymeasure.experiment.procedure import Procedure, ProcedureWrapper from pymeasure.experiment.parameters import Parameter from pymeasure.units import ureg from data.procedure_for_testing import RandomProcedure def test_parameters(): class TestProcedure(Procedure): x = Param...
5
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
v2_extractor_at_anchor
pymeasure/pymeasure
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
train
train
tests/experiment/test_workers.py
test_zmq_topic_filtering_works
assert
numeric_literal
46
import importlib import logging import pytest import os import tempfile from time import sleep from pymeasure.experiment import Listener, Procedure from pymeasure.experiment.workers import Worker from pymeasure.experiment.results import Results from data.procedure_for_testing import RandomProcedure tcp_libs_availabl...
3
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
v2_extractor_at_anchor
pymeasure/pymeasure
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
train
train
tests/instruments/activetechnologies/test_AWG401x.py
test_AFG_init
assert
numeric_literal
13
from pymeasure.test import expected_protocol from pymeasure.instruments import Instrument from pymeasure.instruments.activetechnologies import AWG401x_AFG from pymeasure.instruments.activetechnologies.AWG401x import ChannelAFG, SequenceEntry def test_AFG_init(): with expected_protocol( AWG401x_AFG, ...
2
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
v2_extractor_at_anchor
pymeasure/pymeasure
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
train
train
tests/instruments/agilent/test_agilent34450A_with_device.py
test_configure_current
assert
numeric_literal
47
import pytest from pymeasure.instruments.agilent.agilent34450A import Agilent34450A from pyvisa.errors import VisaIOError pytest.skip('Only work with connected hardware', allow_module_level=True) class TestAgilent34450A: RESOURCE = "USB0::10893::45848::MY56511723::0::INSTR" BOOLEANS = [False, True] RESO...
1
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
v2_extractor_at_anchor
pymeasure/pymeasure
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
train
train
tests/instruments/agilent/test_agilent34450A_with_device.py
test_configure_current
assert
numeric_literal
54
import pytest from pymeasure.instruments.agilent.agilent34450A import Agilent34450A from pyvisa.errors import VisaIOError pytest.skip('Only work with connected hardware', allow_module_level=True) class TestAgilent34450A: RESOURCE = "USB0::10893::45848::MY56511723::0::INSTR" BOOLEANS = [False, True] RESO...
0
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
v2_extractor_at_anchor
pymeasure/pymeasure
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
train
train
tests/instruments/ametek/test_ametek7270.py
test_harmonic_getter
assert
numeric_literal
12
import pytest from pymeasure.test import expected_protocol from pymeasure.instruments.ametek import Ametek7270 def test_harmonic_getter(): with expected_protocol( Ametek7270, [(b'REFN', b'7\n')], ) as inst: assert inst.harmonic ==
7
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
v2_extractor_at_anchor
pymeasure/pymeasure
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
train
train
tests/instruments/anritsu/test_anritsuMS464xB.py
test_init
assert
numeric_literal
14
import pytest from pymeasure.test import expected_protocol from pymeasure.instruments.anritsu import AnritsuMS464xB, AnritsuMS4642B, AnritsuMS4644B,\ AnritsuMS4645B, AnritsuMS4647B def test_init(): with expected_protocol( AnritsuMS464xB, [], ) as instr: assert len(instr.channels) =...
4
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
v2_extractor_at_anchor
pymeasure/pymeasure
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
train
train
tests/instruments/anritsu/test_anritsuMS464xB.py
test_init_with_different_channel_numbers
assert
numeric_literal
18
import pytest from pymeasure.test import expected_protocol from pymeasure.instruments.anritsu import AnritsuMS464xB, AnritsuMS4642B, AnritsuMS4644B,\ AnritsuMS4645B, AnritsuMS4647B def test_init_with_different_channel_numbers(): # Test init with different number of active channels and installed ports with...
2
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
v2_extractor_at_anchor
pymeasure/pymeasure
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
train
train
tests/instruments/anritsu/test_anritsuMS464xB.py
test_init_unknown_active_channels
assert
numeric_literal
21
import pytest from pymeasure.test import expected_protocol from pymeasure.instruments.anritsu import AnritsuMS464xB, AnritsuMS4642B, AnritsuMS4644B,\ AnritsuMS4645B, AnritsuMS4647B def test_init_unknown_active_channels(): # Test init with unknown active channels and traces with expected_protocol( ...
3
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
v2_extractor_at_anchor
pymeasure/pymeasure
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
train
train
tests/instruments/anritsu/test_anritsuMS464xB.py
test_init_unknown_active_channels
assert
numeric_literal
22
import pytest from pymeasure.test import expected_protocol from pymeasure.instruments.anritsu import AnritsuMS464xB, AnritsuMS4642B, AnritsuMS4644B,\ AnritsuMS4645B, AnritsuMS4647B def test_init_unknown_active_channels(): # Test init with unknown active channels and traces with expected_protocol( ...
8
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
v2_extractor_at_anchor
pymeasure/pymeasure
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
train
train
tests/instruments/hp/test_hp34401a_with_device.py
test_given_function_when_set_then_function_is_set
assert
numeric_literal
33
import pytest import time import logging from pymeasure.instruments.hp.hp34401A import HP34401A log = logging.getLogger(__name__) log.addHandler(logging.NullHandler()) FUNCTIONS = ["DCV", "DCV_RATIO", "ACV", "DCI", "ACI", "R2W", "R4W", "FREQ", "PERIOD", "CONTINUITY", "DIODE"] FUNCTIONS_WITH_RANGE = ["DC...
0
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
v2_extractor_at_anchor
pymeasure/pymeasure
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
train
train
tests/instruments/hp/test_hp437b_with_device.py
test_range
assert
numeric_literal
28
import pytest from time import sleep from pymeasure.instruments.hp import HP437B from pymeasure.instruments.hp.hp437b import MeasurementUnit, OperatingMode, TriggerMode, \ GroupTriggerMode import numpy as np class TestHP437B: BOOLEANS = [True, False] FILTER_VALUES = reversed([1, 2, 4, 8, 16, 32, 64, 128,...
5
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
v2_extractor_at_anchor
pymeasure/pymeasure
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
train
train
tests/instruments/hp/test_hp8116a_with_device.py
test_given_resetted_when_check_errors_then_no_error
assert
numeric_literal
54
import pytest import math import time from pymeasure.instruments.hp import HP8116A, hp8116a pytest.skip('Only work with connected hardware', allow_module_level=True) class TestHP8116A: RESOURCE = 'GPIB0::12' HAS_OPTION_001 = True BOOLEANS = [False, True] OPERATING_MODES_WO_OPT001 = ['normal', 'trigg...
0
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
v2_extractor_at_anchor
pymeasure/pymeasure
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
train
train
tests/instruments/hp/test_hp8116a_with_device.py
test_given_invalid_duty_cycle_when_check_errors_then_error
assert
numeric_literal
55
import pytest import math import time from pymeasure.instruments.hp import HP8116A, hp8116a pytest.skip('Only work with connected hardware', allow_module_level=True) class TestHP8116A: RESOURCE = 'GPIB0::12' HAS_OPTION_001 = True BOOLEANS = [False, True] OPERATING_MODES_WO_OPT001 = ['normal', 'trigg...
1
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
v2_extractor_at_anchor
pymeasure/pymeasure
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
train
train
tests/instruments/hp/test_hp8116a_with_device.py
test_given_two_error_conditions_when_check_errors_then_two_errors
assert
numeric_literal
63
import pytest import math import time from pymeasure.instruments.hp import HP8116A, hp8116a pytest.skip('Only work with connected hardware', allow_module_level=True) class TestHP8116A: RESOURCE = 'GPIB0::12' HAS_OPTION_001 = True BOOLEANS = [False, True] OPERATING_MODES_WO_OPT001 = ['normal', 'trigg...
2
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
v2_extractor_at_anchor
pymeasure/pymeasure
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
train
train
tests/instruments/hp/test_hp856Xx.py
test_normalized_reference_position
assert
numeric_literal
25
from datetime import datetime import pytest from pymeasure.test import expected_protocol from pymeasure.instruments.hp import HP8560A, HP8561B from pymeasure.instruments.hp.hp856Xx import Trace, MixerMode, CouplingMode, DemodulationMode, \ DetectionModes, AmplitudeUnits, HP856Xx, ErrorCode, FrequencyReference, P...
8
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
v2_extractor_at_anchor
pymeasure/pymeasure
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
train
train
tests/instruments/hp/test_hp8753e_with_device.py
test_hp8753e_with_device_sweep_time
assert
numeric_literal
51
import logging from time import sleep import numpy import pytest from pymeasure.adapters import PrologixAdapter from pymeasure.instruments.hp import HP8753E log = logging.getLogger(__name__) log.addHandler(logging.NullHandler()) def hp8753e(connected_device_address): try: # This allows a PrologixAdapter...
0
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
v2_extractor_at_anchor
pymeasure/pymeasure
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
train
train
tests/instruments/hp/test_hp8753e_with_device.py
test_hp8753e_with_device_scan_single
assert
numeric_literal
54
import logging from time import sleep import numpy import pytest from pymeasure.adapters import PrologixAdapter from pymeasure.instruments.hp import HP8753E log = logging.getLogger(__name__) log.addHandler(logging.NullHandler()) def hp8753e(connected_device_address): try: # This allows a PrologixAdapter...
2
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
v2_extractor_at_anchor
pymeasure/pymeasure
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
train
train
tests/instruments/hp/test_hp8753e_with_device.py
test_hp8753e_with_device_data_complex
assert
numeric_literal
63
import logging from time import sleep import numpy import pytest from pymeasure.adapters import PrologixAdapter from pymeasure.instruments.hp import HP8753E log = logging.getLogger(__name__) log.addHandler(logging.NullHandler()) def hp8753e(connected_device_address): try: # This allows a PrologixAdapter...
4
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
v2_extractor_at_anchor
pymeasure/pymeasure
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
train
train
tests/instruments/hp/test_hp8753e_with_device.py
test_hp8753e_with_device_reset
assert
numeric_literal
50
import logging from time import sleep import numpy import pytest from pymeasure.adapters import PrologixAdapter from pymeasure.instruments.hp import HP8753E log = logging.getLogger(__name__) log.addHandler(logging.NullHandler()) def hp8753e(connected_device_address): try: # This allows a PrologixAdapter...
3
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
v2_extractor_at_anchor
pymeasure/pymeasure
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
train
train
tests/instruments/hp/test_hp8753e_with_device.py
test_hp8753e_with_device_averages
assert
numeric_literal
53
import logging from time import sleep import numpy import pytest from pymeasure.adapters import PrologixAdapter from pymeasure.instruments.hp import HP8753E log = logging.getLogger(__name__) log.addHandler(logging.NullHandler()) def hp8753e(connected_device_address): try: # This allows a PrologixAdapter...
1
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
v2_extractor_at_anchor
pymeasure/pymeasure
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
train
train
tests/instruments/inficon/test_sqm160.py
test_number_of_channels
assert
numeric_literal
13
import pytest from pymeasure.test import expected_protocol from pymeasure.instruments.inficon.sqm160 import calculate_checksum, SQM160 def test_number_of_channels(): """Verify the communication of the number of channels.""" with expected_protocol( SQM160, [(b"!#JO8", b"!%A6v\x86"), ], ...
6
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
v2_extractor_at_anchor
pymeasure/pymeasure
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
train
train
tests/instruments/ipgphotonics/test_yar.py
test_power_off
assert
numeric_literal
15
import pytest from pymeasure.test import expected_protocol from pymeasure.instruments.ipgphotonics.yar import YAR init_comm = [("RNP", "RNP: 0.200"), ("RMP", "RMP: 10.5"), ("RDPT", "RDPT: 0.100")] def test_power_off(): """Verify, that power 'Off' is translated to 0.""" with expected_protocol( YAR...
0
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
v2_extractor_at_anchor
pymeasure/pymeasure
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
train
train
tests/instruments/ipgphotonics/test_yar.py
test_init_sets_minimum_display_power
assert
numeric_literal
18
import pytest from pymeasure.test import expected_protocol from pymeasure.instruments.ipgphotonics.yar import YAR init_comm = [("RNP", "RNP: 0.200"), ("RMP", "RMP: 10.5"), ("RDPT", "RDPT: 0.100")] def test_init_sets_minimum_display_power(): """Test, that a different minimum power is shown in the translation of '...
5
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
v2_extractor_at_anchor
pymeasure/pymeasure
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
train
train
tests/instruments/keithley/test_keithley2182.py
test_active_channel
assert
numeric_literal
14
import pytest from pymeasure.test import expected_protocol from pymeasure.instruments.keithley.keithley2182 import Keithley2182 def test_active_channel(): with expected_protocol( Keithley2182, [(":SENS:CHAN?", "1"), (":SENS:CHAN 2", None), ], ) as inst: assert inst.a...
1
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
v2_extractor_at_anchor
pymeasure/pymeasure
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
train
train
tests/instruments/keithley/test_keithley2306.py
test_step
assert
numeric_literal
12
from pymeasure.test import expected_protocol from pymeasure.instruments.keithley.keithley2306 import Keithley2306 def test_step(): with expected_protocol( Keithley2306, [(b":SENS:PCUR:STEP:TLEV3?", 4)], ) as instr: step = instr.ch1.pulse_current_step(3) assert ...
4
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
v2_extractor_at_anchor
pymeasure/pymeasure
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
train
train
tests/instruments/keithley/test_keithley2306_with_device.py
test_display_channel
assert
numeric_literal
68
import time import pytest import math from pymeasure.instruments.keithley.keithley2306 import Keithley2306 pytest.skip('Only work with connected hardware', allow_module_level=True) class TestKeithley2306: RESOURCE = "USB0::10893::6039::CN57266430::INSTR" CHANNELS = [1, 2] RELAYS = [1, 2, 3, 4] BOOL...
1
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
v2_extractor_at_anchor
pymeasure/pymeasure
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
train
train
tests/instruments/keithley/test_keithley2306_with_device.py
test_current_range
assert
numeric_literal
69
import time import pytest import math from pymeasure.instruments.keithley.keithley2306 import Keithley2306 pytest.skip('Only work with connected hardware', allow_module_level=True) class TestKeithley2306: RESOURCE = "USB0::10893::6039::CN57266430::INSTR" CHANNELS = [1, 2] RELAYS = [1, 2, 3, 4] BOOL...
5
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
v2_extractor_at_anchor
pymeasure/pymeasure
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
train
train
tests/instruments/keithley/test_keithley2306_with_device.py
test_pulse_current_step_timeout_initial
assert
numeric_literal
69
import time import pytest import math from pymeasure.instruments.keithley.keithley2306 import Keithley2306 pytest.skip('Only work with connected hardware', allow_module_level=True) class TestKeithley2306: RESOURCE = "USB0::10893::6039::CN57266430::INSTR" CHANNELS = [1, 2] RELAYS = [1, 2, 3, 4] BOOL...
2
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
v2_extractor_at_anchor
pymeasure/pymeasure
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
train
train
tests/instruments/keithley/test_keithley2306_with_device.py
test_pulse_current_step_delay
assert
numeric_literal
69
import time import pytest import math from pymeasure.instruments.keithley.keithley2306 import Keithley2306 pytest.skip('Only work with connected hardware', allow_module_level=True) class TestKeithley2306: RESOURCE = "USB0::10893::6039::CN57266430::INSTR" CHANNELS = [1, 2] RELAYS = [1, 2, 3, 4] BOOL...
0
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
v2_extractor_at_anchor
pymeasure/pymeasure
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
train
train
tests/instruments/keithley/test_keithley2306_with_device.py
test_source_voltage_protection
assert
numeric_literal
69
import time import pytest import math from pymeasure.instruments.keithley.keithley2306 import Keithley2306 pytest.skip('Only work with connected hardware', allow_module_level=True) class TestKeithley2306: RESOURCE = "USB0::10893::6039::CN57266430::INSTR" CHANNELS = [1, 2] RELAYS = [1, 2, 3, 4] BOOL...
8
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
v2_extractor_at_anchor
pymeasure/pymeasure
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
train
train
tests/instruments/keithley/test_keithleyDAQ6510_with_device.py
test_beep
assert
numeric_literal
21
import pytest import logging from pymeasure.instruments.keithley import KeithleyDAQ6510 log = logging.getLogger(__name__) log.addHandler(logging.NullHandler()) def daq6510(connected_device_address): instr = KeithleyDAQ6510(connected_device_address) instr.adapter.connection.timeout = 10000 return instr de...
0
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
v2_extractor_at_anchor
pymeasure/pymeasure
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
train
train
tests/instruments/keithley/test_keithleyDMM6500.py
test_current_ac_digits_getter
assert
numeric_literal
13
import pytest from pymeasure.test import expected_protocol from pymeasure.instruments.keithley import KeithleyDMM6500 def test_current_ac_digits_getter(): with expected_protocol( KeithleyDMM6500, [(b'*LANG SCPI', None), (b':DISP:CURR:AC:DIG?', b'6\n')], ) as inst: ...
6
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
v2_extractor_at_anchor
pymeasure/pymeasure
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
train
train
tests/instruments/keithley/test_keithleyDMM6500.py
test_current_digits_getter
assert
numeric_literal
13
import pytest from pymeasure.test import expected_protocol from pymeasure.instruments.keithley import KeithleyDMM6500 def test_current_digits_getter(): with expected_protocol( KeithleyDMM6500, [(b'*LANG SCPI', None), (b':DISP:CURR:DIG?', b'3\n')], ) as inst: asser...
3
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
v2_extractor_at_anchor
pymeasure/pymeasure
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
train
train
tests/instruments/keithley/test_keithleyDMM6500_with_device.py
test_given_function_when_set_then_function_is_set
assert
numeric_literal
106
import pytest import logging from pymeasure.instruments.keithley import KeithleyDMM6500 log = logging.getLogger(__name__) log.addHandler(logging.NullHandler()) FUNCTIONS = [ "voltage", "voltage ac", "current", "current ac", "resistance", "resistance 4W", "diode", "capacitance", "te...
0
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
v2_extractor_at_anchor
pymeasure/pymeasure
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
train
train
tests/instruments/kepco/test_kepcobop.py
test_bop_test_getter
assert
numeric_literal
10
from pymeasure.test import expected_protocol from pymeasure.instruments.kepco import KepcoBOP3612 def test_bop_test_getter(): with expected_protocol( KepcoBOP3612, [(b'DIAG:TST?', b'0')], ) as inst: assert inst.bop_test ==
0
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
v2_extractor_at_anchor
pymeasure/pymeasure
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
train
train
tests/instruments/keysight/test_keysightDSOX1102G_with_device.py
test_ch_offset
assert
numeric_literal
45
from time import sleep import logging import pytest import numpy as np from pymeasure.instruments.keysight.keysightDSOX1102G import KeysightDSOX1102G from pyvisa.errors import VisaIOError pytest.skip('Only work with connected hardware', allow_module_level=True) class TestKeysightDSOX1102G: RESOURCE = "USB0::108...
1
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
v2_extractor_at_anchor
pymeasure/pymeasure
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
train
train
tests/instruments/keysight/test_keysightDSOX1102G_with_device.py
test_waveform_data
assert
numeric_literal
48
from time import sleep import logging import pytest import numpy as np from pymeasure.instruments.keysight.keysightDSOX1102G import KeysightDSOX1102G from pyvisa.errors import VisaIOError pytest.skip('Only work with connected hardware', allow_module_level=True) class TestKeysightDSOX1102G: RESOURCE = "USB0::108...
0
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
v2_extractor_at_anchor
pymeasure/pymeasure
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
train
train
tests/instruments/kuhneelectronic/test_kusg245_250a.py
test_power_setpoint
assert
numeric_literal
25
import pytest from pymeasure.test import expected_protocol from pymeasure.instruments.kuhneelectronic import Kusg245_250A from pymeasure.instruments.kuhneelectronic.kusg245_250a import termination_character, encoding termination_character = termination_character.encode(encoding=encoding)[0] def test_power_setpoint()...
0
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
v2_extractor_at_anchor
pymeasure/pymeasure
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
train
train
tests/instruments/lakeshore/test_lakeshore211.py
test_relays
assert
numeric_literal
14
from pymeasure.test import expected_protocol from pymeasure.instruments.lakeshore.lakeshore211 import LakeShore211 def test_relays(): with expected_protocol( LakeShore211, [(b"RELAY? 1", b"0\r\n"), (b"RELAY 1 2", None), (b"RELAY? 1", b"2\r\n") ], ...
0
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
v2_extractor_at_anchor
pymeasure/pymeasure
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
train
train
tests/instruments/lakeshore/test_lakeshore211.py
test_relays
assert
numeric_literal
16
from pymeasure.test import expected_protocol from pymeasure.instruments.lakeshore.lakeshore211 import LakeShore211 def test_relays(): with expected_protocol( LakeShore211, [(b"RELAY? 1", b"0\r\n"), (b"RELAY 1 2", None), (b"RELAY? 1", b"2\r\n") ], ...
2
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
v2_extractor_at_anchor
pymeasure/pymeasure
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
train
train
tests/instruments/lecroy/test_lecroyT3DSO1204.py
test_download_one_point
assert
numeric_literal
57
import pytest from pymeasure.instruments.teledyne.teledyne_oscilloscope import sanitize_source from pymeasure.instruments.lecroy.lecroyT3DSO1204 import LeCroyT3DSO1204 from pymeasure.test import expected_protocol INVALID_CHANNELS = ["INVALID_SOURCE", "C1 C2", "C1 MATH", "C1234567", "CHANNEL"] VALID_CHANNELS = [('C1',...
1
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
v2_extractor_at_anchor
pymeasure/pymeasure
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
train
train
tests/instruments/lecroy/test_lecroyT3DSO1204.py
test_download_two_points
assert
numeric_literal
57
import pytest from pymeasure.instruments.teledyne.teledyne_oscilloscope import sanitize_source from pymeasure.instruments.lecroy.lecroyT3DSO1204 import LeCroyT3DSO1204 from pymeasure.test import expected_protocol INVALID_CHANNELS = ["INVALID_SOURCE", "C1 C2", "C1 MATH", "C1234567", "CHANNEL"] VALID_CHANNELS = [('C1',...
2
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
v2_extractor_at_anchor
pymeasure/pymeasure
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
train
train
tests/instruments/lecroy/test_lecroyT3DSO1204_with_device.py
test_ch_offset
assert
numeric_literal
41
from time import sleep from unittest.mock import ANY import numpy as np import pytest from pyvisa.errors import VisaIOError from pymeasure.instruments.lecroy.lecroyT3DSO1204 import LeCroyT3DSO1204 class TestLeCroyT3DSO1204: BOOLEANS = [False, True] CHANNEL_COUPLINGS = ["ac 1M", "dc 1M", "ground"] ACQUIS...
1
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
v2_extractor_at_anchor
pymeasure/pymeasure
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
train
train
tests/instruments/racal/test_racal1992.py
test_total_a_by_b
assert
numeric_literal
13
from pymeasure.test import expected_protocol from pymeasure.instruments.racal import Racal1992 def test_total_a_by_b(): with expected_protocol( Racal1992, [ (' TA', 'TA+00000000001.E+00'), ], ) as instr: instr.operating_mode = 'total_a_by_b' ...
1
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
v2_extractor_at_anchor
pymeasure/pymeasure
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
train
train
tests/instruments/redpitaya/test_redpitaya_scpi_with_device.py
test_time_date
assert
numeric_literal
24
import datetime import pytest from pymeasure.instruments.redpitaya import RedPitayaScpi def redpitaya_scpi(connected_device_address: str): """ to use the tests in this file invoke pytest as: pytest -k redpitaya_scpi --device-address TCPIP::x.y.z.k::port::SOCKET where you replace x.y.z.k byt the device IP ...
7
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
v2_extractor_at_anchor
pymeasure/pymeasure
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
train
train
tests/instruments/redpitaya/test_redpitaya_scpi_with_device.py
test_acquisition
assert
numeric_literal
49
import datetime import pytest from pymeasure.instruments.redpitaya import RedPitayaScpi def redpitaya_scpi(connected_device_address: str): """ to use the tests in this file invoke pytest as: pytest -k redpitaya_scpi --device-address TCPIP::x.y.z.k::port::SOCKET where you replace x.y.z.k byt the device IP ...
0
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
v2_extractor_at_anchor
pymeasure/pymeasure
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
train
train
tests/instruments/rohdeschwarz/test_hmp_with_device.py
test_channel_state
assert
numeric_literal
21
from time import sleep import pytest from pymeasure.instruments.rohdeschwarz.hmp import HMP4040 def hmp4040(connected_device_address): """Return a HMP4040 instrument.""" hmp4040 = HMP4040(connected_device_address) return hmp4040 def resetted_hmp4040(hmp4040): """Return a HMP4040 instrument with rese...
1
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
v2_extractor_at_anchor
pymeasure/pymeasure
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
train
train
tests/instruments/siglenttechnologies/test_siglent_spd1168x.py
test_set_current_trunc
assert
numeric_literal
12
from pymeasure.test import expected_protocol from pymeasure.instruments.siglenttechnologies.siglent_spd1168x import SPD1168X def test_set_current_trunc(): with expected_protocol( SPD1168X, [("CH1:CURR 8", None), ("CH1:CURR?", "8")] ) as inst: inst.ch_1.current_limit = 10 # too...
8
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
v2_extractor_at_anchor
pymeasure/pymeasure
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
train
train
tests/instruments/siglenttechnologies/test_siglent_spd1305x.py
test_set_current_trunc
assert
numeric_literal
12
from pymeasure.test import expected_protocol from pymeasure.instruments.siglenttechnologies.siglent_spd1305x import SPD1305X def test_set_current_trunc(): with expected_protocol( SPD1305X, [("CH1:CURR 5", None), ("CH1:CURR?", "5")] ) as inst: inst.ch_1.current_limit = 10 # too...
5
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
v2_extractor_at_anchor
pymeasure/pymeasure
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
train
train
tests/instruments/srs/test_sr830.py
test_snap
assert
numeric_literal
14
import pytest from pymeasure.test import expected_protocol from pymeasure.instruments.srs.sr830 import SR830 def test_snap(): """Verify the communication of the measurement values.""" with expected_protocol( SR830, [("SNAP? 1,2", "-4.17234e-007,-5.9605e-007"),], ) as inst: xy = ins...
2
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
v2_extractor_at_anchor
pymeasure/pymeasure
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
train
train
tests/instruments/teledyne/test_teledyneMAUI_with_device.py
test_ch_offset
assert
numeric_literal
39
import pytest from time import sleep from pymeasure.instruments.teledyne import TeledyneMAUI class TestTeledyneMAUI: BOOLEANS = [False, True] BANDWIDTH_LIMITS = ["OFF", "ON", "200MHZ"] CHANNEL_COUPLINGS = ["ac 1M", "dc 1M", "ground"] ACQUISITION_TYPES = ["normal", "average", "peak", "highres"] T...
1
c4274324feb6ab441ba0c1a6aadc13089b8ac4ec
192
v2_extractor_at_anchor