From 3797c61b0980f34c02457c2165198534eb4f35f3 Mon Sep 17 00:00:00 2001 From: Rahul R Date: Fri, 9 May 2025 23:04:02 +0530 Subject: [PATCH 01/33] Implementation of Complex Numbers --- build/defines.mak | 1 + build/helper/codegen_helper.py | 17 +- build/helper/helper.py | 41 +-- build/helper/metadata_add_all.py | 7 + build/templates/_complextype.py.mako | 21 ++ build/templates/_library.py.mako | 1 + build/templates/_library_interpreter.py.mako | 10 +- build/unit_tests/test_codegen_helper.py | 36 +++ build/unit_tests/test_metadata_add_all.py | 14 + docs/nirfsg/class.rst | 40 +++ generated/nidcpower/nidcpower/_complextype.py | 16 ++ generated/nidcpower/nidcpower/_library.py | 1 + .../nidcpower/_library_interpreter.py | 10 +- generated/nidigital/nidigital/_complextype.py | 16 ++ generated/nidigital/nidigital/_library.py | 1 + .../nidigital/_library_interpreter.py | 10 +- generated/nidmm/nidmm/_complextype.py | 16 ++ generated/nidmm/nidmm/_library.py | 1 + generated/nidmm/nidmm/_library_interpreter.py | 10 +- generated/nifake/nifake/_complextype.py | 16 ++ generated/nifake/nifake/_library.py | 1 + .../nifake/nifake/_library_interpreter.py | 10 +- .../unit_tests/test_library_interpreter.py | 17 ++ generated/nifgen/nifgen/_complextype.py | 16 ++ generated/nifgen/nifgen/_library.py | 1 + .../nifgen/nifgen/_library_interpreter.py | 10 +- generated/nimodinst/nimodinst/_complextype.py | 16 ++ generated/nimodinst/nimodinst/_library.py | 1 + .../nimodinst/_library_interpreter.py | 10 +- generated/nirfsg/nirfsg/_complextype.py | 16 ++ generated/nirfsg/nirfsg/_library.py | 28 ++ .../nirfsg/nirfsg/_library_interpreter.py | 40 ++- generated/nirfsg/nirfsg/session.py | 106 ++++++++ .../nirfsg/nirfsg/unit_tests/_mock_helper.py | 27 ++ generated/niscope/niscope/_complextype.py | 16 ++ generated/niscope/niscope/_library.py | 1 + .../niscope/niscope/_library_interpreter.py | 10 +- generated/nise/nise/_complextype.py | 16 ++ generated/nise/nise/_library.py | 1 + generated/nise/nise/_library_interpreter.py | 10 +- generated/niswitch/niswitch/_complextype.py | 16 ++ generated/niswitch/niswitch/_library.py | 1 + .../niswitch/niswitch/_library_interpreter.py | 10 +- generated/nitclk/nitclk/_complextype.py | 16 ++ generated/nitclk/nitclk/_library.py | 1 + .../nitclk/nitclk/_library_interpreter.py | 10 +- src/nirfsg/metadata/functions.py | 243 ++++++++++++++++++ .../session.py/write_arb_waveform.py.mako | 24 ++ tox-travis.ini | 1 + tox.ini | 1 + 50 files changed, 916 insertions(+), 45 deletions(-) create mode 100644 build/templates/_complextype.py.mako create mode 100644 generated/nidcpower/nidcpower/_complextype.py create mode 100644 generated/nidigital/nidigital/_complextype.py create mode 100644 generated/nidmm/nidmm/_complextype.py create mode 100644 generated/nifake/nifake/_complextype.py create mode 100644 generated/nifgen/nifgen/_complextype.py create mode 100644 generated/nimodinst/nimodinst/_complextype.py create mode 100644 generated/nirfsg/nirfsg/_complextype.py create mode 100644 generated/niscope/niscope/_complextype.py create mode 100644 generated/nise/nise/_complextype.py create mode 100644 generated/niswitch/niswitch/_complextype.py create mode 100644 generated/nitclk/nitclk/_complextype.py create mode 100644 src/nirfsg/templates/session.py/write_arb_waveform.py.mako diff --git a/build/defines.mak b/build/defines.mak index d3f05f999e..07018c79e2 100644 --- a/build/defines.mak +++ b/build/defines.mak @@ -59,6 +59,7 @@ DEFAULT_PY_FILES_TO_GENERATE := \ unit_tests/_matchers.py \ __init__.py \ _converters.py \ + _complextype.py \ VERSION \ $(if $(GRPC_SUPPORTED), \ _grpc_stub_interpreter.py \ diff --git a/build/helper/codegen_helper.py b/build/helper/codegen_helper.py index 94dd6f3f66..6121569ecf 100644 --- a/build/helper/codegen_helper.py +++ b/build/helper/codegen_helper.py @@ -256,6 +256,10 @@ def get_ctype_variable_declaration_snippet(parameter, parameters, ivi_dance_step else: module_name = '_visatype' + # Use _complextype.py file for complex parameter + if parameter['complex_type'] != 'none': + module_name = '_complextype' + if parameter['is_string'] is True: definitions = _get_ctype_variable_definition_snippet_for_string(parameter, parameters, ivi_dance_step, module_name) elif parameter['is_buffer'] is True: @@ -362,7 +366,12 @@ def _get_ctype_variable_definition_snippet_for_scalar(parameter, parameters, ivi definition = '{}.{}({}) # case S150'.format(module_name, parameter['ctypes_type'], parameter['python_name']) elif corresponding_buffer_parameters and corresponding_buffer_parameters[0]['direction'] == 'in': # We are only looking at the first one to see if it is 'in'. Assumes all are the same here, assert below if not # Parameter denotes the size of another (the "corresponding") parameter. - definitions.append(parameter['ctypes_variable_name'] + ' = {0}.{1}(0 if {2} is None else len({2})) # case S160'.format(module_name, parameter['ctypes_type'], corresponding_buffer_parameters[0]['python_name'])) + + # Interleaved array length is going to be double the length of number of samples + if 'interleaved' in corresponding_buffer_parameters[0]['complex_type']: + definitions.append(parameter['ctypes_variable_name'] + ' = {0}.{1}(0 if {2} is None else len({2}) // 2) # case S160'.format(module_name, parameter['ctypes_type'], corresponding_buffer_parameters[0]['python_name'])) + else: + definitions.append(parameter['ctypes_variable_name'] + ' = {0}.{1}(0 if {2} is None else len({2})) # case S160'.format(module_name, parameter['ctypes_type'], corresponding_buffer_parameters[0]['python_name'])) else: if corresponding_buffer_parameters[0]['size']['mechanism'] == 'ivi-dance': # We are only looking at the first one. Assumes all are the same here, assert below if not # Verify all corresponding_buffer_parameters are 'out' and 'ivi-dance' @@ -426,7 +435,10 @@ def _get_ctype_variable_definition_snippet_for_buffers(parameter, parameters, iv definition = None if parameter['numpy'] is True and use_numpy_array is True: - definition = '_get_ctypes_pointer_for_buffer(value={}) # case B510'.format(parameter['python_name']) + if parameter['complex_type'] == 'none': + definition = '_get_ctypes_pointer_for_buffer(value={}) # case B510'.format(parameter['python_name']) + else: + definition = '_get_ctypes_pointer_for_buffer(value={}, library_type={}.{}, complex_type=\'{}\') # case B510'.format(parameter['python_name'], module_name, parameter['ctypes_type'], parameter['complex_type']) elif parameter['direction'] == 'in': if custom_type is not None: definition = '_get_ctypes_pointer_for_buffer([{0}.{1}(c) for c in {2}], library_type={0}.{1}) # case B540'.format(module_name, parameter['ctypes_type'], parameter['python_name']) @@ -562,3 +574,4 @@ def get_enum_value_snippet(value): '''Returns value formatted into string, surrounding it with single quotes if it is of str type''' return ("'{}'" if type(value) is str else "{}").format(value) + diff --git a/build/helper/helper.py b/build/helper/helper.py index 83c3f005b6..4f79143a4b 100644 --- a/build/helper/helper.py +++ b/build/helper/helper.py @@ -7,25 +7,28 @@ # noqa statements because we want to format the table in a readable way _type_map = { - 'ViConstString': { 'array_type': None, 'python_type': 'str', 'numpy_type': None, }, # noqa: E201, E202, E241 - 'ViString': { 'array_type': None, 'python_type': 'str', 'numpy_type': None, }, # noqa: E201, E202, E241 - 'ViInt8': { 'array_type': 'b', 'python_type': 'int', 'numpy_type': 'int8', }, # noqa: E201, E202, E241 - 'ViUInt8': { 'array_type': 'B', 'python_type': 'int', 'numpy_type': 'uint8', }, # noqa: E201, E202, E241 - 'ViInt16': { 'array_type': 'h', 'python_type': 'int', 'numpy_type': 'int16', }, # noqa: E201, E202, E241 - 'ViUInt16': { 'array_type': 'H', 'python_type': 'int', 'numpy_type': 'uint16', }, # noqa: E201, E202, E241 - 'ViInt32': { 'array_type': 'l', 'python_type': 'int', 'numpy_type': 'int32', }, # noqa: E201, E202, E241 - 'ViUInt32': { 'array_type': 'L', 'python_type': 'int', 'numpy_type': 'uint32', }, # noqa: E201, E202, E241 - 'ViInt64': { 'array_type': 'q', 'python_type': 'int', 'numpy_type': 'int64', }, # noqa: E201, E202, E241 - 'ViUInt64': { 'array_type': 'Q', 'python_type': 'int', 'numpy_type': 'uint64', }, # noqa: E201, E202, E241 - 'ViReal32': { 'array_type': 'f', 'python_type': 'float', 'numpy_type': 'float32', }, # noqa: E201, E202, E241 - 'ViReal64': { 'array_type': 'd', 'python_type': 'float', 'numpy_type': 'float64', }, # noqa: E201, E202, E241 - 'ViStatus': { 'array_type': None, 'python_type': 'int', 'numpy_type': None, }, # noqa: E201, E202, E241 - 'ViSession': { 'array_type': None, 'python_type': 'int', 'numpy_type': None, }, # noqa: E201, E202, E241 - 'ViAttr': { 'array_type': None, 'python_type': 'int', 'numpy_type': None, }, # noqa: E201, E202, E241 - 'ViChar': { 'array_type': None, 'python_type': 'int', 'numpy_type': None, }, # noqa: E201, E202, E241 - 'ViChar[]': { 'array_type': None, 'python_type': 'str', 'numpy_type': None, }, # noqa: E201, E202, E241 - 'ViBoolean': { 'array_type': None, 'python_type': 'bool', 'numpy_type': None, }, # noqa: E201, E202, E241 - 'ViRsrc': { 'array_type': None, 'python_type': 'str', 'numpy_type': 'bool_', }, # noqa: E201, E202, E241 + 'ViConstString': { 'array_type': None, 'python_type': 'str', 'numpy_type': None, }, # noqa: E201, E202, E241 + 'ViString': { 'array_type': None, 'python_type': 'str', 'numpy_type': None, }, # noqa: E201, E202, E241 + 'ViInt8': { 'array_type': 'b', 'python_type': 'int', 'numpy_type': 'int8', }, # noqa: E201, E202, E241 + 'ViUInt8': { 'array_type': 'B', 'python_type': 'int', 'numpy_type': 'uint8', }, # noqa: E201, E202, E241 + 'ViInt16': { 'array_type': 'h', 'python_type': 'int', 'numpy_type': 'int16', }, # noqa: E201, E202, E241 + 'ViUInt16': { 'array_type': 'H', 'python_type': 'int', 'numpy_type': 'uint16', }, # noqa: E201, E202, E241 + 'ViInt32': { 'array_type': 'l', 'python_type': 'int', 'numpy_type': 'int32', }, # noqa: E201, E202, E241 + 'ViUInt32': { 'array_type': 'L', 'python_type': 'int', 'numpy_type': 'uint32', }, # noqa: E201, E202, E241 + 'ViInt64': { 'array_type': 'q', 'python_type': 'int', 'numpy_type': 'int64', }, # noqa: E201, E202, E241 + 'ViUInt64': { 'array_type': 'Q', 'python_type': 'int', 'numpy_type': 'uint64', }, # noqa: E201, E202, E241 + 'ViReal32': { 'array_type': 'f', 'python_type': 'float', 'numpy_type': 'float32', }, # noqa: E201, E202, E241 + 'ViReal64': { 'array_type': 'd', 'python_type': 'float', 'numpy_type': 'float64', }, # noqa: E201, E202, E241 + 'ViStatus': { 'array_type': None, 'python_type': 'int', 'numpy_type': None, }, # noqa: E201, E202, E241 + 'ViSession': { 'array_type': None, 'python_type': 'int', 'numpy_type': None, }, # noqa: E201, E202, E241 + 'ViAttr': { 'array_type': None, 'python_type': 'int', 'numpy_type': None, }, # noqa: E201, E202, E241 + 'ViChar': { 'array_type': None, 'python_type': 'int', 'numpy_type': None, }, # noqa: E201, E202, E241 + 'ViChar[]': { 'array_type': None, 'python_type': 'str', 'numpy_type': None, }, # noqa: E201, E202, E241 + 'ViBoolean': { 'array_type': None, 'python_type': 'bool', 'numpy_type': None, }, # noqa: E201, E202, E241 + 'ViRsrc': { 'array_type': None, 'python_type': 'str', 'numpy_type': 'bool_', }, # noqa: E201, E202, E241 + 'ComplexViReal64': { 'array_type': None, 'python_type': None, 'numpy_type': 'complex128', }, # noqa: E201, E202, E241 + 'ComplexViReal32': { 'array_type': None, 'python_type': None, 'numpy_type': 'complex64', }, # noqa: E201, E202, E241 + 'ComplexViInt16': { 'array_type': None, 'python_type': None, 'numpy_type': 'int16', }, # noqa: E201, E202, E241 } diff --git a/build/helper/metadata_add_all.py b/build/helper/metadata_add_all.py index ed9d836b68..929aafa912 100644 --- a/build/helper/metadata_add_all.py +++ b/build/helper/metadata_add_all.py @@ -126,6 +126,12 @@ def _add_ctypes_type(parameter, config): parameter['ctypes_type_library_call'] = module_name + parameter['ctypes_type'] +def _add_complex_type(parameter): + '''Adds a complex_type parameter to the metadata for complex numbers''' + if 'complex_type' not in parameter: + parameter['complex_type'] = 'none' + + def _add_numpy_info(parameter, parameters, config): '''Adds the following numpy-related information: @@ -450,6 +456,7 @@ def add_all_function_metadata(functions, config): _add_python_type(p, config) _add_ctypes_variable_name(p) _add_ctypes_type(p, config) + _add_complex_type(p) _add_numpy_info(p, functions[f]['parameters'], config) _add_default_value_name(p) _add_default_value_name_for_docs(p, config['module_name']) diff --git a/build/templates/_complextype.py.mako b/build/templates/_complextype.py.mako new file mode 100644 index 0000000000..a821597854 --- /dev/null +++ b/build/templates/_complextype.py.mako @@ -0,0 +1,21 @@ +${template_parameters['encoding_tag']} +# This file was generated +<% + import build.helper as helper + config = template_parameters['metadata'].config + module_name = config['module_name'] +%>\ +import ctypes +import ${module_name}._visatype as _visatype + + +class ComplexViReal64(ctypes.Structure): + _fields_ = [("real", _visatype.ViReal64), ("imag", _visatype.ViReal64)] + + +class ComplexViReal32(ctypes.Structure): + _fields_ = [("real", _visatype.ViReal32), ("imag", _visatype.ViReal32)] + + +class ComplexViInt16(ctypes.Structure): + _fields_ = [("real", _visatype.ViInt16), ("imag", _visatype.ViInt16)] diff --git a/build/templates/_library.py.mako b/build/templates/_library.py.mako index e77a7bb624..138cddc33e 100644 --- a/build/templates/_library.py.mako +++ b/build/templates/_library.py.mako @@ -18,6 +18,7 @@ import ctypes import ${module_name}.errors as errors import threading +from ${module_name}._complextype import * # noqa: F401,F403,H303 from ${module_name}._visatype import * # noqa: F403,H303 % for c in config['custom_types']: diff --git a/build/templates/_library_interpreter.py.mako b/build/templates/_library_interpreter.py.mako index cf1aea315a..9330fa0e61 100644 --- a/build/templates/_library_interpreter.py.mako +++ b/build/templates/_library_interpreter.py.mako @@ -21,6 +21,7 @@ import hightime # noqa: F401 import platform % endif +import ${module_name}._complextype as _complextype # noqa: F401 import ${module_name}._library_singleton as _library_singleton import ${module_name}._visatype as _visatype % if config['enums']: @@ -39,14 +40,19 @@ _was_runtime_environment_set = None % endif # Helper functions for creating ctypes needed for calling into the driver DLL -def _get_ctypes_pointer_for_buffer(value=None, library_type=None, size=None): +def _get_ctypes_pointer_for_buffer(value=None, library_type=None, size=None, complex_type='none'): if isinstance(value, array.array): assert library_type is not None, 'library_type is required for array.array' addr, _ = value.buffer_info() return ctypes.cast(addr, ctypes.POINTER(library_type)) elif str(type(value)).find("'numpy.ndarray'") != -1: import numpy - return numpy.ctypeslib.as_ctypes(value) + if complex_type == 'none': + return numpy.ctypeslib.as_ctypes(value) + else: + complex_dtype = numpy.dtype(library_type) + structured_array = value.view(complex_dtype) + return structured_array.ctypes.data_as(ctypes.POINTER(library_type)) elif isinstance(value, bytes): return ctypes.cast(value, ctypes.POINTER(library_type)) elif isinstance(value, list): diff --git a/build/unit_tests/test_codegen_helper.py b/build/unit_tests/test_codegen_helper.py index e6b28ff271..0079606079 100644 --- a/build/unit_tests/test_codegen_helper.py +++ b/build/unit_tests/test_codegen_helper.py @@ -41,6 +41,7 @@ 'size': {'mechanism': 'fixed', 'value': 1}, 'type': 'ViSession', 'numpy': False, + 'complex_type': 'none', 'use_in_python_api': True, }, { # 1 @@ -69,6 +70,7 @@ 'size': {'mechanism': 'fixed', 'value': 1}, 'type': 'ViInt64', 'numpy': False, + 'complex_type': 'none', 'use_in_python_api': True, }, { # 2 @@ -96,6 +98,7 @@ 'size': {'mechanism': 'fixed', 'value': 256}, 'type': 'ViString', 'numpy': False, + 'complex_type': 'none', 'use_in_python_api': True, }, { # 3 @@ -124,6 +127,7 @@ 'size': {'mechanism': 'python-code', 'value': 'self.get_array_size_for_python_code()'}, 'type': 'custom_struct', 'numpy': False, + 'complex_type': 'none', 'use_in_python_api': True, }, { # 4 @@ -149,6 +153,7 @@ 'size': {'mechanism': 'fixed', 'value': 1}, 'type': 'ViInt32', 'numpy': False, + 'complex_type': 'none', 'use_in_python_api': True, }, { # 5 @@ -176,6 +181,7 @@ 'size': {'mechanism': 'passed-in', 'value': 'numberOfElements'}, 'type': 'ViInt16', 'numpy': False, + 'complex_type': 'none', 'use_in_python_api': True, }, { # 6 @@ -204,6 +210,7 @@ 'size': {'mechanism': 'fixed', 'value': 1}, 'type': 'ViInt16', 'numpy': False, + 'complex_type': 'none', 'use_in_python_api': True, }, { # 7 @@ -231,6 +238,7 @@ 'size': {'mechanism': 'passed-in', 'value': 'numberOfElements'}, 'type': 'ViInt64', 'numpy': True, + 'complex_type': 'none', 'numpy_type': 'int64', 'numpy_type_library_call': 'numpy.int64', 'use_in_python_api': True, @@ -252,6 +260,7 @@ 'interpreter_method_call_snippet': 'number_of_elements_python_code', 'name': 'numberOfElementsPythonCode', 'numpy': False, + 'complex_type': 'none', 'python_name': 'number_of_elements_python_code', 'python_name_with_default': 'number_of_elements_python_code', 'python_name_with_doc_default': 'number_of_elements_python_code', @@ -277,6 +286,7 @@ 'interpreter_method_call_snippet': 'input', 'name': 'input', 'numpy': False, + 'complex_type': 'none', 'python_name': 'input', 'python_name_with_default': 'input', 'python_name_with_doc_default': 'input', @@ -305,6 +315,7 @@ 'interpreter_method_call_snippet': 'input_array', 'name': 'inputArray', 'numpy': False, + 'complex_type': 'none', 'python_name': 'input_array', 'python_name_with_default': 'input_array=None', 'python_name_with_doc_default': 'input_array=None', @@ -330,6 +341,7 @@ 'interpreter_method_call_snippet': 'input_array_size', 'name': 'inputArraySize', 'numpy': False, + 'complex_type': 'none', 'python_name': 'input_array_size', 'python_name_with_default': 'input_array_size', 'python_name_with_doc_default': 'input_array_size', @@ -355,6 +367,7 @@ 'interpreter_method_call_snippet': 'string_size', 'name': 'stringSize', 'numpy': False, + 'complex_type': 'none', 'python_name': 'string_size', 'python_name_with_default': 'string_size', 'python_name_with_doc_default': 'string_size', @@ -380,6 +393,7 @@ 'interpreter_method_call_snippet': 'a_string', 'name': 'aString', 'numpy': False, + 'complex_type': 'none', 'python_name': 'a_string', 'python_name_with_default': 'a_string', 'python_name_with_doc_default': 'a_string', @@ -406,6 +420,7 @@ 'interpreter_method_call_snippet': 'timeout', 'name': 'Timeout', 'numpy': False, + 'complex_type': 'none', 'python_name': 'timeout', 'python_name_with_default': 'timeout=1.0', 'python_name_with_doc_default': 'timeout=1.0', @@ -434,6 +449,7 @@ 'interpreter_method_call_snippet': 'self._repeated_capability', 'name': 'channelList', 'numpy': False, + 'complex_type': 'none', 'original_type': 'ViChar[]', 'python_name': 'channel_list', 'python_name_with_default': 'channel_list', @@ -460,6 +476,7 @@ 'interpreter_method_call_snippet': 'a_string', 'name': 'aString', 'numpy': False, + 'complex_type': 'none', 'python_name': 'a_string', 'python_name_with_default': 'a_string', 'python_name_with_doc_default': 'a_string', @@ -492,6 +509,7 @@ 'size': {'mechanism': 'len', 'value': 'array_in'}, 'type': 'custom_struct', 'numpy': False, + 'complex_type': 'none', 'use_in_python_api': True, }, { # 18 @@ -521,6 +539,7 @@ 'size': {'mechanism': 'fixed', 'value': 256}, 'type': 'ViInt16', 'numpy': False, + 'complex_type': 'none', 'use_in_python_api': True, }, { # 19 @@ -540,6 +559,7 @@ 'interpreter_method_call_snippet': 'a_string_2', 'name': 'aString2', 'numpy': False, + 'complex_type': 'none', 'python_name': 'a_string_2', 'python_name_with_default': 'a_string_2', 'python_name_with_doc_default': 'a_string_2', @@ -565,6 +585,7 @@ 'interpreter_method_call_snippet': 'a_string_3', 'name': 'aStrin3g', 'numpy': False, + 'complex_type': 'none', 'python_name': 'a_string_3', 'python_name_with_default': 'a_string_3', 'python_name_with_doc_default': 'a_string_3', @@ -590,6 +611,7 @@ 'interpreter_method_call_snippet': 'a_string_twist', 'name': 'aStringTwist', 'numpy': False, + 'complex_type': 'none', 'python_name': 'a_string_twist', 'python_name_with_default': 'a_string_twist', 'python_name_with_doc_default': 'a_string_twist', @@ -624,6 +646,7 @@ 'size': {'mechanism': 'fixed', 'value': 1}, 'type': 'ViInt64', 'numpy': False, + 'complex_type': 'none', 'use_in_python_api': True, }, { # 23 @@ -643,6 +666,7 @@ 'interpreter_method_call_snippet': 'string_size_twist', 'name': 'stringSizeTwist', 'numpy': False, + 'complex_type': 'none', 'python_name': 'string_size_twist', 'python_name_with_default': 'string_size_twist', 'python_name_with_doc_default': 'string_size_twist', @@ -668,6 +692,7 @@ 'interpreter_method_call_snippet': 'a_buffer', 'name': 'aBufferArray', 'numpy': False, + 'complex_type': 'none', 'python_name': 'a_buffer_array', 'python_name_with_default': 'a_buffer_array', 'python_name_with_doc_default': 'a_buffer_array', @@ -695,6 +720,7 @@ 'interpreter_method_call_snippet': 'a_buffer', 'name': 'aBufferList', 'numpy': False, + 'complex_type': 'none', 'python_name': 'a_buffer_list', 'python_name_with_default': 'a_buffer_list', 'python_name_with_doc_default': 'a_buffer_list', @@ -722,6 +748,7 @@ 'interpreter_method_call_snippet': 'a_buffer', 'name': 'aBufferTwistArray', 'numpy': False, + 'complex_type': 'none', 'python_name': 'a_buffer_twist_array', 'python_name_with_default': 'a_buffer_twist_array', 'python_name_with_doc_default': 'a_buffer_twist_array', @@ -749,6 +776,7 @@ 'interpreter_method_call_snippet': 'a_buffer', 'name': 'aBufferTwistList', 'numpy': False, + 'complex_type': 'none', 'python_name': 'a_buffer_twist_list', 'python_name_with_default': 'a_buffer_twist_list', 'python_name_with_doc_default': 'a_buffer_twist_list', @@ -779,6 +807,7 @@ 'interpreter_method_call_snippet': 'input_array_2', 'name': 'inputArray2', 'numpy': False, + 'complex_type': 'none', 'python_name': 'input_array_2', 'python_name_with_default': 'input_array_2=None', 'python_name_with_doc_default': 'input_array_2=None', @@ -807,6 +836,7 @@ 'interpreter_method_call_snippet': 'input_array_2', 'name': 'inputArray2', 'numpy': False, + 'complex_type': 'none', 'python_api_converter_name': 'convert_to_nitclk_session_num_list', 'python_name': 'input_array_2', 'python_name_with_default': 'input_array_2=None', @@ -836,6 +866,7 @@ 'interpreter_method_call_snippet': 'input_array_3', 'name': 'inputArray3', 'numpy': False, + 'complex_type': 'none', 'python_api_converter_name': 'convert_to_nitclk_session_num_list', 'python_name': 'input_array_3', 'python_name_with_default': 'input_array_3=None', @@ -865,6 +896,7 @@ 'interpreter_method_call_snippet': 'input_array_3', 'name': 'inputArray4', 'numpy': False, + 'complex_type': 'none', 'python_api_converter_name': 'convert_to_nitclk_session_num_list', 'python_name': 'input_array_4', 'python_name_with_default': 'input_array_4=None', @@ -894,6 +926,7 @@ 'interpreter_method_call_snippet': 'input_array_3', 'name': 'inputArray4', 'numpy': False, + 'complex_type': 'none', 'python_api_converter_name': 'convert_to_nitclk_session_num_list', 'python_name': 'input_array_4', 'python_name_with_default': 'input_array_4=None', @@ -920,6 +953,7 @@ 'interpreter_method_call_snippet': 'a_string_enum', 'name': 'aStringEnum', 'numpy': False, + 'complex_type': 'none', 'python_name': 'a_string_enum', 'python_name_with_default': 'a_string_enum', 'python_name_with_doc_default': 'a_string_enum', @@ -947,6 +981,7 @@ 'interpreter_method_call_snippet': 'indices', 'name': 'indices', 'numpy': False, + 'complex_type': 'none', 'original_type': 'ViChar[]', 'python_api_converter_name': 'convert_repeated_capabilities_without_prefix', 'python_name': 'indices', @@ -983,6 +1018,7 @@ 'size': {'mechanism': 'passed-in', 'value': 'numberOfElements'}, 'type': 'ViInt8', 'numpy': False, + 'complex_type': 'none', 'use_in_python_api': True, }, ] diff --git a/build/unit_tests/test_metadata_add_all.py b/build/unit_tests/test_metadata_add_all.py index 67a5750a49..ae0249a31c 100644 --- a/build/unit_tests/test_metadata_add_all.py +++ b/build/unit_tests/test_metadata_add_all.py @@ -259,6 +259,7 @@ def _compare_dicts(actual, expected): 'grpc_request_snippet': 'vi=self._vi', 'use_in_python_api': True, 'python_name_or_default_for_init': 'vi', + 'complex_type': 'none', }, { 'ctypes_method_call_snippet': 'name_ctype', @@ -292,6 +293,7 @@ def _compare_dicts(actual, expected): 'grpc_request_snippet': 'name=name', 'use_in_python_api': True, 'python_name_or_default_for_init': 'name', + 'complex_type': 'none', }, { 'ctypes_method_call_snippet': 'pin_data_buffer_size_ctype', @@ -328,6 +330,7 @@ def _compare_dicts(actual, expected): 'grpc_request_snippet': 'pin_data_buffer_size=pin_data_buffer_size', 'use_in_python_api': False, 'python_name_or_default_for_init': 'pin_data_buffer_size', + 'complex_type': 'none', }, { 'ctypes_method_call_snippet': 'python_code_input_ctype', @@ -364,6 +367,7 @@ def _compare_dicts(actual, expected): 'grpc_request_snippet': 'python_code_input=2 ** 14', 'use_in_python_api': True, 'python_name_or_default_for_init': 'python_code_input', + 'complex_type': 'none', }, { 'ctypes_method_call_snippet': 'None if actual_num_pin_data_ctype is None else (ctypes.pointer(actual_num_pin_data_ctype))', @@ -400,6 +404,7 @@ def _compare_dicts(actual, expected): 'grpc_request_snippet': 'actual_num_pin_data=actual_num_pin_data', 'use_in_python_api': False, 'python_name_or_default_for_init': 'actual_num_pin_data', + 'complex_type': 'none', }, { 'ctypes_method_call_snippet': 'expected_pin_states_ctype', @@ -438,6 +443,7 @@ def _compare_dicts(actual, expected): 'grpc_request_snippet': 'expected_pin_states=expected_pin_states', 'use_in_python_api': True, 'python_name_or_default_for_init': 'expected_pin_states', + 'complex_type': 'none', }, { 'ctypes_method_call_snippet': 'custom_type_input_ctype', @@ -474,6 +480,7 @@ def _compare_dicts(actual, expected): 'grpc_request_snippet': 'custom_type_input=custom_type_input._create_copy(grpc_types.CustomStruct)', 'use_in_python_api': True, 'python_name_or_default_for_init': 'custom_type_input', + 'complex_type': 'none', }, { 'ctypes_method_call_snippet': 'None if custom_type_output_ctype is None else (ctypes.pointer(custom_type_output_ctype))', @@ -510,6 +517,7 @@ def _compare_dicts(actual, expected): 'grpc_request_snippet': 'custom_type_output=custom_type_output._create_copy(grpc_types.CustomStruct)', 'use_in_python_api': True, 'python_name_or_default_for_init': 'custom_type_output', + 'complex_type': 'none', }, { 'ctypes_method_call_snippet': 'custom_type_without_struct_prefix_input_ctype', @@ -546,6 +554,7 @@ def _compare_dicts(actual, expected): 'grpc_request_snippet': 'custom_type_without_struct_prefix_input=custom_type_without_struct_prefix_input._create_copy(grpc_types.CustomStruct)', 'use_in_python_api': True, 'python_name_or_default_for_init': 'custom_type_without_struct_prefix_input', + 'complex_type': 'none', }, { 'ctypes_method_call_snippet': 'None if custom_type_without_struct_prefix_output_ctype is None else (ctypes.pointer(custom_type_without_struct_prefix_output_ctype))', @@ -582,6 +591,7 @@ def _compare_dicts(actual, expected): 'grpc_request_snippet': 'custom_type_without_struct_prefix_output=custom_type_without_struct_prefix_output._create_copy(grpc_types.CustomStruct)', 'use_in_python_api': True, 'python_name_or_default_for_init': 'custom_type_without_struct_prefix_output', + 'complex_type': 'none', }, ], 'python_name': 'make_a_foo', @@ -629,6 +639,7 @@ def _compare_dicts(actual, expected): 'grpc_request_snippet': 'vi=self._vi', 'use_in_python_api': True, 'python_name_or_default_for_init': 'vi', + 'complex_type': 'none', }, { 'ctypes_method_call_snippet': 'status_ctype', @@ -665,6 +676,7 @@ def _compare_dicts(actual, expected): 'grpc_request_snippet': 'status=status', 'use_in_python_api': True, 'python_name_or_default_for_init': 'status', + 'complex_type': 'none', }, { 'ctypes_method_call_snippet': 'data_buffer_size_ctype', @@ -701,6 +713,7 @@ def _compare_dicts(actual, expected): 'grpc_request_snippet': 'data_buffer_size=data_buffer_size', 'use_in_python_api': False, 'python_name_or_default_for_init': 'data_buffer_size', + 'complex_type': 'none', }, { 'ctypes_method_call_snippet': 'data_ctype', @@ -738,6 +751,7 @@ def _compare_dicts(actual, expected): 'grpc_request_snippet': 'data=data', 'use_in_python_api': True, 'python_name_or_default_for_init': 'data', + 'complex_type': 'none', }, ], 'documentation': { diff --git a/docs/nirfsg/class.rst b/docs/nirfsg/class.rst index c35091f21e..d45ab2c5a2 100644 --- a/docs/nirfsg/class.rst +++ b/docs/nirfsg/class.rst @@ -2690,6 +2690,46 @@ wait_until_settled :type max_time_milliseconds: int +write_arb_waveform +------------------ + + .. py:currentmodule:: nirfsg.Session + + .. py:method:: write_arb_waveform(waveform_name, waveform_data_array, more_data_pending) + + Writes data to the waveform in onboard memory. + + By default, subsequent calls to this method + continue writing data from the position of the last sample written. You + can set the write position and offset by calling the :py:meth:`nirfsg.Session.SetNamedWaveformNextWritePosition` + :py:meth:`nirfsg.Session.SetWaveformNextWritePosition` method. + + + + + + :param waveform_name: + + + + + + :type waveform_name: str + :param waveform_data_array: + + + + + + :type waveform_data_array: list of ComplexViReal64 + :param more_data_pending: + + + + + + :type more_data_pending: bool + write_p2_p_endpoint_i16 ----------------------- diff --git a/generated/nidcpower/nidcpower/_complextype.py b/generated/nidcpower/nidcpower/_complextype.py new file mode 100644 index 0000000000..18fa25bc9f --- /dev/null +++ b/generated/nidcpower/nidcpower/_complextype.py @@ -0,0 +1,16 @@ +# -*- coding: utf-8 -*- +# This file was generated +import ctypes +import nidcpower._visatype as _visatype + + +class ComplexViReal64(ctypes.Structure): + _fields_ = [("real", _visatype.ViReal64), ("imag", _visatype.ViReal64)] + + +class ComplexViReal32(ctypes.Structure): + _fields_ = [("real", _visatype.ViReal32), ("imag", _visatype.ViReal32)] + + +class ComplexViInt16(ctypes.Structure): + _fields_ = [("real", _visatype.ViInt16), ("imag", _visatype.ViInt16)] diff --git a/generated/nidcpower/nidcpower/_library.py b/generated/nidcpower/nidcpower/_library.py index 2db23ea441..bc147c8f6b 100644 --- a/generated/nidcpower/nidcpower/_library.py +++ b/generated/nidcpower/nidcpower/_library.py @@ -5,6 +5,7 @@ import nidcpower.errors as errors import threading +from nidcpower._complextype import * # noqa: F401,F403,H303 from nidcpower._visatype import * # noqa: F403,H303 import nidcpower.lcr_measurement as lcr_measurement # noqa: F401 diff --git a/generated/nidcpower/nidcpower/_library_interpreter.py b/generated/nidcpower/nidcpower/_library_interpreter.py index 473680f188..27312a0f2c 100644 --- a/generated/nidcpower/nidcpower/_library_interpreter.py +++ b/generated/nidcpower/nidcpower/_library_interpreter.py @@ -6,6 +6,7 @@ import hightime # noqa: F401 import platform +import nidcpower._complextype as _complextype # noqa: F401 import nidcpower._library_singleton as _library_singleton import nidcpower._visatype as _visatype import nidcpower.enums as enums # noqa: F401 @@ -20,14 +21,19 @@ # Helper functions for creating ctypes needed for calling into the driver DLL -def _get_ctypes_pointer_for_buffer(value=None, library_type=None, size=None): +def _get_ctypes_pointer_for_buffer(value=None, library_type=None, size=None, complex_type='none'): if isinstance(value, array.array): assert library_type is not None, 'library_type is required for array.array' addr, _ = value.buffer_info() return ctypes.cast(addr, ctypes.POINTER(library_type)) elif str(type(value)).find("'numpy.ndarray'") != -1: import numpy - return numpy.ctypeslib.as_ctypes(value) + if complex_type == 'none': + return numpy.ctypeslib.as_ctypes(value) + else: + complex_dtype = numpy.dtype(library_type) + structured_array = value.view(complex_dtype) + return structured_array.ctypes.data_as(ctypes.POINTER(library_type)) elif isinstance(value, bytes): return ctypes.cast(value, ctypes.POINTER(library_type)) elif isinstance(value, list): diff --git a/generated/nidigital/nidigital/_complextype.py b/generated/nidigital/nidigital/_complextype.py new file mode 100644 index 0000000000..f1bf040d0a --- /dev/null +++ b/generated/nidigital/nidigital/_complextype.py @@ -0,0 +1,16 @@ +# -*- coding: utf-8 -*- +# This file was generated +import ctypes +import nidigital._visatype as _visatype + + +class ComplexViReal64(ctypes.Structure): + _fields_ = [("real", _visatype.ViReal64), ("imag", _visatype.ViReal64)] + + +class ComplexViReal32(ctypes.Structure): + _fields_ = [("real", _visatype.ViReal32), ("imag", _visatype.ViReal32)] + + +class ComplexViInt16(ctypes.Structure): + _fields_ = [("real", _visatype.ViInt16), ("imag", _visatype.ViInt16)] diff --git a/generated/nidigital/nidigital/_library.py b/generated/nidigital/nidigital/_library.py index 1f1d78ed16..bdd440091c 100644 --- a/generated/nidigital/nidigital/_library.py +++ b/generated/nidigital/nidigital/_library.py @@ -5,6 +5,7 @@ import nidigital.errors as errors import threading +from nidigital._complextype import * # noqa: F401,F403,H303 from nidigital._visatype import * # noqa: F403,H303 import nidigital.history_ram_cycle_information as history_ram_cycle_information # noqa: F401 diff --git a/generated/nidigital/nidigital/_library_interpreter.py b/generated/nidigital/nidigital/_library_interpreter.py index e830756ab8..d58f0c2cd1 100644 --- a/generated/nidigital/nidigital/_library_interpreter.py +++ b/generated/nidigital/nidigital/_library_interpreter.py @@ -6,6 +6,7 @@ import hightime # noqa: F401 import platform +import nidigital._complextype as _complextype # noqa: F401 import nidigital._library_singleton as _library_singleton import nidigital._visatype as _visatype import nidigital.enums as enums # noqa: F401 @@ -18,14 +19,19 @@ # Helper functions for creating ctypes needed for calling into the driver DLL -def _get_ctypes_pointer_for_buffer(value=None, library_type=None, size=None): +def _get_ctypes_pointer_for_buffer(value=None, library_type=None, size=None, complex_type='none'): if isinstance(value, array.array): assert library_type is not None, 'library_type is required for array.array' addr, _ = value.buffer_info() return ctypes.cast(addr, ctypes.POINTER(library_type)) elif str(type(value)).find("'numpy.ndarray'") != -1: import numpy - return numpy.ctypeslib.as_ctypes(value) + if complex_type == 'none': + return numpy.ctypeslib.as_ctypes(value) + else: + complex_dtype = numpy.dtype(library_type) + structured_array = value.view(complex_dtype) + return structured_array.ctypes.data_as(ctypes.POINTER(library_type)) elif isinstance(value, bytes): return ctypes.cast(value, ctypes.POINTER(library_type)) elif isinstance(value, list): diff --git a/generated/nidmm/nidmm/_complextype.py b/generated/nidmm/nidmm/_complextype.py new file mode 100644 index 0000000000..cce49cf095 --- /dev/null +++ b/generated/nidmm/nidmm/_complextype.py @@ -0,0 +1,16 @@ +# -*- coding: utf-8 -*- +# This file was generated +import ctypes +import nidmm._visatype as _visatype + + +class ComplexViReal64(ctypes.Structure): + _fields_ = [("real", _visatype.ViReal64), ("imag", _visatype.ViReal64)] + + +class ComplexViReal32(ctypes.Structure): + _fields_ = [("real", _visatype.ViReal32), ("imag", _visatype.ViReal32)] + + +class ComplexViInt16(ctypes.Structure): + _fields_ = [("real", _visatype.ViInt16), ("imag", _visatype.ViInt16)] diff --git a/generated/nidmm/nidmm/_library.py b/generated/nidmm/nidmm/_library.py index 67dc31dffb..882fe10f33 100644 --- a/generated/nidmm/nidmm/_library.py +++ b/generated/nidmm/nidmm/_library.py @@ -5,6 +5,7 @@ import nidmm.errors as errors import threading +from nidmm._complextype import * # noqa: F401,F403,H303 from nidmm._visatype import * # noqa: F403,H303 diff --git a/generated/nidmm/nidmm/_library_interpreter.py b/generated/nidmm/nidmm/_library_interpreter.py index 4e87b4274b..c47328f958 100644 --- a/generated/nidmm/nidmm/_library_interpreter.py +++ b/generated/nidmm/nidmm/_library_interpreter.py @@ -6,6 +6,7 @@ import hightime # noqa: F401 import platform +import nidmm._complextype as _complextype # noqa: F401 import nidmm._library_singleton as _library_singleton import nidmm._visatype as _visatype import nidmm.enums as enums # noqa: F401 @@ -16,14 +17,19 @@ # Helper functions for creating ctypes needed for calling into the driver DLL -def _get_ctypes_pointer_for_buffer(value=None, library_type=None, size=None): +def _get_ctypes_pointer_for_buffer(value=None, library_type=None, size=None, complex_type='none'): if isinstance(value, array.array): assert library_type is not None, 'library_type is required for array.array' addr, _ = value.buffer_info() return ctypes.cast(addr, ctypes.POINTER(library_type)) elif str(type(value)).find("'numpy.ndarray'") != -1: import numpy - return numpy.ctypeslib.as_ctypes(value) + if complex_type == 'none': + return numpy.ctypeslib.as_ctypes(value) + else: + complex_dtype = numpy.dtype(library_type) + structured_array = value.view(complex_dtype) + return structured_array.ctypes.data_as(ctypes.POINTER(library_type)) elif isinstance(value, bytes): return ctypes.cast(value, ctypes.POINTER(library_type)) elif isinstance(value, list): diff --git a/generated/nifake/nifake/_complextype.py b/generated/nifake/nifake/_complextype.py new file mode 100644 index 0000000000..270ecac82a --- /dev/null +++ b/generated/nifake/nifake/_complextype.py @@ -0,0 +1,16 @@ +# -*- coding: utf-8 -*- +# This file was generated +import ctypes +import nifake._visatype as _visatype + + +class ComplexViReal64(ctypes.Structure): + _fields_ = [("real", _visatype.ViReal64), ("imag", _visatype.ViReal64)] + + +class ComplexViReal32(ctypes.Structure): + _fields_ = [("real", _visatype.ViReal32), ("imag", _visatype.ViReal32)] + + +class ComplexViInt16(ctypes.Structure): + _fields_ = [("real", _visatype.ViInt16), ("imag", _visatype.ViInt16)] diff --git a/generated/nifake/nifake/_library.py b/generated/nifake/nifake/_library.py index 5fef6060e2..b5cdf2dc5c 100644 --- a/generated/nifake/nifake/_library.py +++ b/generated/nifake/nifake/_library.py @@ -5,6 +5,7 @@ import nifake.errors as errors import threading +from nifake._complextype import * # noqa: F401,F403,H303 from nifake._visatype import * # noqa: F403,H303 import nifake.custom_struct as custom_struct # noqa: F401 diff --git a/generated/nifake/nifake/_library_interpreter.py b/generated/nifake/nifake/_library_interpreter.py index d2715505a5..f1c641e29c 100644 --- a/generated/nifake/nifake/_library_interpreter.py +++ b/generated/nifake/nifake/_library_interpreter.py @@ -6,6 +6,7 @@ import hightime # noqa: F401 import platform +import nifake._complextype as _complextype # noqa: F401 import nifake._library_singleton as _library_singleton import nifake._visatype as _visatype import nifake.enums as enums # noqa: F401 @@ -22,14 +23,19 @@ # Helper functions for creating ctypes needed for calling into the driver DLL -def _get_ctypes_pointer_for_buffer(value=None, library_type=None, size=None): +def _get_ctypes_pointer_for_buffer(value=None, library_type=None, size=None, complex_type='none'): if isinstance(value, array.array): assert library_type is not None, 'library_type is required for array.array' addr, _ = value.buffer_info() return ctypes.cast(addr, ctypes.POINTER(library_type)) elif str(type(value)).find("'numpy.ndarray'") != -1: import numpy - return numpy.ctypeslib.as_ctypes(value) + if complex_type == 'none': + return numpy.ctypeslib.as_ctypes(value) + else: + complex_dtype = numpy.dtype(library_type) + structured_array = value.view(complex_dtype) + return structured_array.ctypes.data_as(ctypes.POINTER(library_type)) elif isinstance(value, bytes): return ctypes.cast(value, ctypes.POINTER(library_type)) elif isinstance(value, list): diff --git a/generated/nifake/nifake/unit_tests/test_library_interpreter.py b/generated/nifake/nifake/unit_tests/test_library_interpreter.py index 4298bcb56d..6a1bfb6ba4 100644 --- a/generated/nifake/nifake/unit_tests/test_library_interpreter.py +++ b/generated/nifake/nifake/unit_tests/test_library_interpreter.py @@ -56,6 +56,23 @@ def get_ctypes_pointer_for_buffer_side_effect(self, value, library_type=None): self.get_ctypes_pointer_for_buffer_side_effect_count += 1 return ret_val + def test_write_numpy_complex128_valid_input(self): + waveform_data = numpy.array([1 + 2j, 3 + 4j], dtype=numpy.complex128) # NumPy array of complex128 + + with patch.object(self.patched_library, 'niFake_WriteArbWaveformComplexF64', wraps=self.patched_library.niFake_WriteArbWaveformComplexF64) as mock_write_waveform: + interpreter = self.get_initialized_library_interpreter() + + # Act + interpreter.write_arb_waveform_complex_f64( waveform_data) + + # Assert + self.patched_library.get_ctypes_pointer.assert_called_once_with( + value=waveform_data, + library_type=nifake._complextype.ComplexViReal64, + complex_type='numpy' + ) + mock_write_waveform.assert_called_once() + # Methods def test_simple_function(self): diff --git a/generated/nifgen/nifgen/_complextype.py b/generated/nifgen/nifgen/_complextype.py new file mode 100644 index 0000000000..54ea0a9d36 --- /dev/null +++ b/generated/nifgen/nifgen/_complextype.py @@ -0,0 +1,16 @@ +# -*- coding: utf-8 -*- +# This file was generated +import ctypes +import nifgen._visatype as _visatype + + +class ComplexViReal64(ctypes.Structure): + _fields_ = [("real", _visatype.ViReal64), ("imag", _visatype.ViReal64)] + + +class ComplexViReal32(ctypes.Structure): + _fields_ = [("real", _visatype.ViReal32), ("imag", _visatype.ViReal32)] + + +class ComplexViInt16(ctypes.Structure): + _fields_ = [("real", _visatype.ViInt16), ("imag", _visatype.ViInt16)] diff --git a/generated/nifgen/nifgen/_library.py b/generated/nifgen/nifgen/_library.py index 92a4ed764c..1aba8f7fd3 100644 --- a/generated/nifgen/nifgen/_library.py +++ b/generated/nifgen/nifgen/_library.py @@ -5,6 +5,7 @@ import nifgen.errors as errors import threading +from nifgen._complextype import * # noqa: F401,F403,H303 from nifgen._visatype import * # noqa: F403,H303 diff --git a/generated/nifgen/nifgen/_library_interpreter.py b/generated/nifgen/nifgen/_library_interpreter.py index 6370353a26..30ec6f76b4 100644 --- a/generated/nifgen/nifgen/_library_interpreter.py +++ b/generated/nifgen/nifgen/_library_interpreter.py @@ -6,6 +6,7 @@ import hightime # noqa: F401 import platform +import nifgen._complextype as _complextype # noqa: F401 import nifgen._library_singleton as _library_singleton import nifgen._visatype as _visatype import nifgen.enums as enums # noqa: F401 @@ -16,14 +17,19 @@ # Helper functions for creating ctypes needed for calling into the driver DLL -def _get_ctypes_pointer_for_buffer(value=None, library_type=None, size=None): +def _get_ctypes_pointer_for_buffer(value=None, library_type=None, size=None, complex_type='none'): if isinstance(value, array.array): assert library_type is not None, 'library_type is required for array.array' addr, _ = value.buffer_info() return ctypes.cast(addr, ctypes.POINTER(library_type)) elif str(type(value)).find("'numpy.ndarray'") != -1: import numpy - return numpy.ctypeslib.as_ctypes(value) + if complex_type == 'none': + return numpy.ctypeslib.as_ctypes(value) + else: + complex_dtype = numpy.dtype(library_type) + structured_array = value.view(complex_dtype) + return structured_array.ctypes.data_as(ctypes.POINTER(library_type)) elif isinstance(value, bytes): return ctypes.cast(value, ctypes.POINTER(library_type)) elif isinstance(value, list): diff --git a/generated/nimodinst/nimodinst/_complextype.py b/generated/nimodinst/nimodinst/_complextype.py new file mode 100644 index 0000000000..e41e3d86b6 --- /dev/null +++ b/generated/nimodinst/nimodinst/_complextype.py @@ -0,0 +1,16 @@ +# -*- coding: utf-8 -*- +# This file was generated +import ctypes +import nimodinst._visatype as _visatype + + +class ComplexViReal64(ctypes.Structure): + _fields_ = [("real", _visatype.ViReal64), ("imag", _visatype.ViReal64)] + + +class ComplexViReal32(ctypes.Structure): + _fields_ = [("real", _visatype.ViReal32), ("imag", _visatype.ViReal32)] + + +class ComplexViInt16(ctypes.Structure): + _fields_ = [("real", _visatype.ViInt16), ("imag", _visatype.ViInt16)] diff --git a/generated/nimodinst/nimodinst/_library.py b/generated/nimodinst/nimodinst/_library.py index 7f1f8f140c..ab88660dc3 100644 --- a/generated/nimodinst/nimodinst/_library.py +++ b/generated/nimodinst/nimodinst/_library.py @@ -5,6 +5,7 @@ import nimodinst.errors as errors import threading +from nimodinst._complextype import * # noqa: F401,F403,H303 from nimodinst._visatype import * # noqa: F403,H303 diff --git a/generated/nimodinst/nimodinst/_library_interpreter.py b/generated/nimodinst/nimodinst/_library_interpreter.py index b51ce157e1..f0164e79fc 100644 --- a/generated/nimodinst/nimodinst/_library_interpreter.py +++ b/generated/nimodinst/nimodinst/_library_interpreter.py @@ -4,20 +4,26 @@ import array import ctypes import hightime # noqa: F401 +import nimodinst._complextype as _complextype # noqa: F401 import nimodinst._library_singleton as _library_singleton import nimodinst._visatype as _visatype import nimodinst.errors as errors # Helper functions for creating ctypes needed for calling into the driver DLL -def _get_ctypes_pointer_for_buffer(value=None, library_type=None, size=None): +def _get_ctypes_pointer_for_buffer(value=None, library_type=None, size=None, complex_type='none'): if isinstance(value, array.array): assert library_type is not None, 'library_type is required for array.array' addr, _ = value.buffer_info() return ctypes.cast(addr, ctypes.POINTER(library_type)) elif str(type(value)).find("'numpy.ndarray'") != -1: import numpy - return numpy.ctypeslib.as_ctypes(value) + if complex_type == 'none': + return numpy.ctypeslib.as_ctypes(value) + else: + complex_dtype = numpy.dtype(library_type) + structured_array = value.view(complex_dtype) + return structured_array.ctypes.data_as(ctypes.POINTER(library_type)) elif isinstance(value, bytes): return ctypes.cast(value, ctypes.POINTER(library_type)) elif isinstance(value, list): diff --git a/generated/nirfsg/nirfsg/_complextype.py b/generated/nirfsg/nirfsg/_complextype.py new file mode 100644 index 0000000000..5592aec215 --- /dev/null +++ b/generated/nirfsg/nirfsg/_complextype.py @@ -0,0 +1,16 @@ +# -*- coding: utf-8 -*- +# This file was generated +import ctypes +import nirfsg._visatype as _visatype + + +class ComplexViReal64(ctypes.Structure): + _fields_ = [("real", _visatype.ViReal64), ("imag", _visatype.ViReal64)] + + +class ComplexViReal32(ctypes.Structure): + _fields_ = [("real", _visatype.ViReal32), ("imag", _visatype.ViReal32)] + + +class ComplexViInt16(ctypes.Structure): + _fields_ = [("real", _visatype.ViInt16), ("imag", _visatype.ViInt16)] diff --git a/generated/nirfsg/nirfsg/_library.py b/generated/nirfsg/nirfsg/_library.py index dc194ec708..b7f3160e36 100644 --- a/generated/nirfsg/nirfsg/_library.py +++ b/generated/nirfsg/nirfsg/_library.py @@ -5,6 +5,7 @@ import nirfsg.errors as errors import threading +from nirfsg._complextype import * # noqa: F401,F403,H303 from nirfsg._visatype import * # noqa: F403,H303 @@ -105,6 +106,9 @@ def __init__(self, ctypes_library): self.niRFSG_SetWaveformMarkerEventLocations_cfunc = None self.niRFSG_UnlockSession_cfunc = None self.niRFSG_WaitUntilSettled_cfunc = None + self.niRFSG_WriteArbWaveformComplexF32_cfunc = None + self.niRFSG_WriteArbWaveformComplexF64_cfunc = None + self.niRFSG_WriteArbWaveformComplexI16_cfunc = None self.niRFSG_WriteP2PEndpointI16_cfunc = None self.niRFSG_WriteScript_cfunc = None self.niRFSG_close_cfunc = None @@ -804,6 +808,30 @@ def niRFSG_WaitUntilSettled(self, vi, max_time_milliseconds): # noqa: N802 self.niRFSG_WaitUntilSettled_cfunc.restype = ViStatus # noqa: F405 return self.niRFSG_WaitUntilSettled_cfunc(vi, max_time_milliseconds) + def niRFSG_WriteArbWaveformComplexF32(self, vi, waveform_name, number_of_samples, waveform_data_array, more_data_pending): # noqa: N802 + with self._func_lock: + if self.niRFSG_WriteArbWaveformComplexF32_cfunc is None: + self.niRFSG_WriteArbWaveformComplexF32_cfunc = self._get_library_function('niRFSG_WriteArbWaveformComplexF32') + self.niRFSG_WriteArbWaveformComplexF32_cfunc.argtypes = [ViSession, ctypes.POINTER(ViChar), ViInt32, ctypes.POINTER(ComplexViReal32), ViBoolean] # noqa: F405 + self.niRFSG_WriteArbWaveformComplexF32_cfunc.restype = ViStatus # noqa: F405 + return self.niRFSG_WriteArbWaveformComplexF32_cfunc(vi, waveform_name, number_of_samples, waveform_data_array, more_data_pending) + + def niRFSG_WriteArbWaveformComplexF64(self, vi, waveform_name, number_of_samples, waveform_data_array, more_data_pending): # noqa: N802 + with self._func_lock: + if self.niRFSG_WriteArbWaveformComplexF64_cfunc is None: + self.niRFSG_WriteArbWaveformComplexF64_cfunc = self._get_library_function('niRFSG_WriteArbWaveformComplexF64') + self.niRFSG_WriteArbWaveformComplexF64_cfunc.argtypes = [ViSession, ctypes.POINTER(ViChar), ViInt32, ctypes.POINTER(ComplexViReal64), ViBoolean] # noqa: F405 + self.niRFSG_WriteArbWaveformComplexF64_cfunc.restype = ViStatus # noqa: F405 + return self.niRFSG_WriteArbWaveformComplexF64_cfunc(vi, waveform_name, number_of_samples, waveform_data_array, more_data_pending) + + def niRFSG_WriteArbWaveformComplexI16(self, vi, waveform_name, number_of_samples, waveform_data_array, more_data_pending): # noqa: N802 + with self._func_lock: + if self.niRFSG_WriteArbWaveformComplexI16_cfunc is None: + self.niRFSG_WriteArbWaveformComplexI16_cfunc = self._get_library_function('niRFSG_WriteArbWaveformComplexI16') + self.niRFSG_WriteArbWaveformComplexI16_cfunc.argtypes = [ViSession, ctypes.POINTER(ViChar), ViInt32, ctypes.POINTER(ComplexViInt16), ViBoolean] # noqa: F405 + self.niRFSG_WriteArbWaveformComplexI16_cfunc.restype = ViStatus # noqa: F405 + return self.niRFSG_WriteArbWaveformComplexI16_cfunc(vi, waveform_name, number_of_samples, waveform_data_array, more_data_pending) + def niRFSG_WriteP2PEndpointI16(self, vi, stream_endpoint, number_of_samples, endpoint_data): # noqa: N802 with self._func_lock: if self.niRFSG_WriteP2PEndpointI16_cfunc is None: diff --git a/generated/nirfsg/nirfsg/_library_interpreter.py b/generated/nirfsg/nirfsg/_library_interpreter.py index 0646b26fd7..e17bb08b15 100644 --- a/generated/nirfsg/nirfsg/_library_interpreter.py +++ b/generated/nirfsg/nirfsg/_library_interpreter.py @@ -4,6 +4,7 @@ import array import ctypes import hightime # noqa: F401 +import nirfsg._complextype as _complextype # noqa: F401 import nirfsg._library_singleton as _library_singleton import nirfsg._visatype as _visatype import nirfsg.enums as enums # noqa: F401 @@ -11,14 +12,19 @@ # Helper functions for creating ctypes needed for calling into the driver DLL -def _get_ctypes_pointer_for_buffer(value=None, library_type=None, size=None): +def _get_ctypes_pointer_for_buffer(value=None, library_type=None, size=None, complex_type='none'): if isinstance(value, array.array): assert library_type is not None, 'library_type is required for array.array' addr, _ = value.buffer_info() return ctypes.cast(addr, ctypes.POINTER(library_type)) elif str(type(value)).find("'numpy.ndarray'") != -1: import numpy - return numpy.ctypeslib.as_ctypes(value) + if complex_type == 'none': + return numpy.ctypeslib.as_ctypes(value) + else: + complex_dtype = numpy.dtype(library_type) + structured_array = value.view(complex_dtype) + return structured_array.ctypes.data_as(ctypes.POINTER(library_type)) elif isinstance(value, bytes): return ctypes.cast(value, ctypes.POINTER(library_type)) elif isinstance(value, list): @@ -780,6 +786,36 @@ def wait_until_settled(self, max_time_milliseconds): # noqa: N802 errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) return + def write_arb_waveform_complex_f32(self, waveform_name, waveform_data_array, more_data_pending): # noqa: N802 + vi_ctype = _visatype.ViSession(self._vi) # case S110 + waveform_name_ctype = ctypes.create_string_buffer(waveform_name.encode(self._encoding)) # case C020 + number_of_samples_ctype = _visatype.ViInt32(0 if waveform_data_array is None else len(waveform_data_array)) # case S160 + waveform_data_array_ctype = _get_ctypes_pointer_for_buffer(value=waveform_data_array, library_type=_complextype.ComplexViReal32, complex_type='numpy') # case B510 + more_data_pending_ctype = _visatype.ViBoolean(more_data_pending) # case S150 + error_code = self._library.niRFSG_WriteArbWaveformComplexF32(vi_ctype, waveform_name_ctype, number_of_samples_ctype, waveform_data_array_ctype, more_data_pending_ctype) + errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) + return + + def write_arb_waveform_complex_f64(self, waveform_name, waveform_data_array, more_data_pending): # noqa: N802 + vi_ctype = _visatype.ViSession(self._vi) # case S110 + waveform_name_ctype = ctypes.create_string_buffer(waveform_name.encode(self._encoding)) # case C020 + number_of_samples_ctype = _visatype.ViInt32(0 if waveform_data_array is None else len(waveform_data_array)) # case S160 + waveform_data_array_ctype = _get_ctypes_pointer_for_buffer(value=waveform_data_array, library_type=_complextype.ComplexViReal64, complex_type='numpy') # case B510 + more_data_pending_ctype = _visatype.ViBoolean(more_data_pending) # case S150 + error_code = self._library.niRFSG_WriteArbWaveformComplexF64(vi_ctype, waveform_name_ctype, number_of_samples_ctype, waveform_data_array_ctype, more_data_pending_ctype) + errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) + return + + def write_arb_waveform_complex_i16(self, waveform_name, waveform_data_array, more_data_pending): # noqa: N802 + vi_ctype = _visatype.ViSession(self._vi) # case S110 + waveform_name_ctype = ctypes.create_string_buffer(waveform_name.encode(self._encoding)) # case C020 + number_of_samples_ctype = _visatype.ViInt32(0 if waveform_data_array is None else len(waveform_data_array) // 2) # case S160 + waveform_data_array_ctype = _get_ctypes_pointer_for_buffer(value=waveform_data_array, library_type=_complextype.ComplexViInt16, complex_type='interleaved') # case B510 + more_data_pending_ctype = _visatype.ViBoolean(more_data_pending) # case S150 + error_code = self._library.niRFSG_WriteArbWaveformComplexI16(vi_ctype, waveform_name_ctype, number_of_samples_ctype, waveform_data_array_ctype, more_data_pending_ctype) + errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) + return + def write_p2_p_endpoint_i16(self, stream_endpoint, number_of_samples, endpoint_data): # noqa: N802 vi_ctype = _visatype.ViSession(self._vi) # case S110 stream_endpoint_ctype = ctypes.create_string_buffer(stream_endpoint.encode(self._encoding)) # case C020 diff --git a/generated/nirfsg/nirfsg/session.py b/generated/nirfsg/nirfsg/session.py index c81c41bad1..508c7e3f71 100644 --- a/generated/nirfsg/nirfsg/session.py +++ b/generated/nirfsg/nirfsg/session.py @@ -7990,6 +7990,112 @@ def wait_until_settled(self, max_time_milliseconds): ''' self._interpreter.wait_until_settled(max_time_milliseconds) + @ivi_synchronized + def _write_arb_waveform_complex_f32(self, waveform_name, waveform_data_array, more_data_pending): + r'''_write_arb_waveform_complex_f32 + + TBD + + Args: + waveform_name (str): + + waveform_data_array (numpy.array(dtype=numpy.complex64)): + + more_data_pending (bool): + + ''' + import numpy + + if type(waveform_data_array) is not numpy.ndarray: + raise TypeError('waveform_data_array must be {0}, is {1}'.format(numpy.ndarray, type(waveform_data_array))) + if numpy.isfortran(waveform_data_array) is True: + raise TypeError('waveform_data_array must be in C-order') + if waveform_data_array.dtype is not numpy.dtype('complex64'): + raise TypeError('waveform_data_array must be numpy.ndarray of dtype=complex64, is ' + str(waveform_data_array.dtype)) + self._interpreter.write_arb_waveform_complex_f32(waveform_name, waveform_data_array, more_data_pending) + + @ivi_synchronized + def _write_arb_waveform_complex_f64(self, waveform_name, waveform_data_array, more_data_pending): + r'''_write_arb_waveform_complex_f64 + + TBD + + Args: + waveform_name (str): + + waveform_data_array (numpy.array(dtype=numpy.complex128)): + + more_data_pending (bool): + + ''' + import numpy + + if type(waveform_data_array) is not numpy.ndarray: + raise TypeError('waveform_data_array must be {0}, is {1}'.format(numpy.ndarray, type(waveform_data_array))) + if numpy.isfortran(waveform_data_array) is True: + raise TypeError('waveform_data_array must be in C-order') + if waveform_data_array.dtype is not numpy.dtype('complex128'): + raise TypeError('waveform_data_array must be numpy.ndarray of dtype=complex128, is ' + str(waveform_data_array.dtype)) + self._interpreter.write_arb_waveform_complex_f64(waveform_name, waveform_data_array, more_data_pending) + + @ivi_synchronized + def _write_arb_waveform_complex_i16(self, waveform_name, waveform_data_array, more_data_pending): + r'''_write_arb_waveform_complex_i16 + + TBD + + Args: + waveform_name (str): + + waveform_data_array (numpy.array(dtype=numpy.int16)): + + more_data_pending (bool): + + ''' + import numpy + + if type(waveform_data_array) is not numpy.ndarray: + raise TypeError('waveform_data_array must be {0}, is {1}'.format(numpy.ndarray, type(waveform_data_array))) + if numpy.isfortran(waveform_data_array) is True: + raise TypeError('waveform_data_array must be in C-order') + if waveform_data_array.dtype is not numpy.dtype('int16'): + raise TypeError('waveform_data_array must be numpy.ndarray of dtype=int16, is ' + str(waveform_data_array.dtype)) + self._interpreter.write_arb_waveform_complex_i16(waveform_name, waveform_data_array, more_data_pending) + + @ivi_synchronized + def write_arb_waveform(self, waveform_name, waveform_data_array, more_data_pending): + '''write_arb_waveform + + Writes data to the waveform in onboard memory. + + By default, subsequent calls to this method + continue writing data from the position of the last sample written. You + can set the write position and offset by calling the SetNamedWaveformNextWritePosition + SetWaveformNextWritePosition method. + + Args: + waveform_name (str): + + waveform_data_array (list of ComplexViReal64): + + more_data_pending (bool): + + ''' + if str(type(waveform_data_array)).find("'numpy.ndarray'") != -1: + import numpy + if waveform_data_array.dtype == numpy.complex128: + return self._write_arb_waveform_complex_f64(waveform_name, waveform_data_array, more_data_pending) + elif waveform_data_array.dtype == numpy.complex64: + return self._write_arb_waveform_complex_f32(waveform_name, waveform_data_array, more_data_pending) + elif waveform_data_array.dtype == numpy.int16: + return self._write_arb_waveform_complex_i16(waveform_name, waveform_data_array, more_data_pending) + else: + raise TypeError("Unsupported dtype. Is {}, expected {} or {} or {}".format(waveform_data_array.dtype, numpy.complex128, numpy.complex64, numpy.int16)) + else: + raise TypeError("Unsupported dtype. Is {}, expected {} or {} or {}".format(waveform_data_array.dtype, numpy.complex128, numpy.complex64, numpy.int16)) + + return self._write_arb_waveform_complex_f64(waveform_name, waveform_data_array, more_data_pending) + def write_p2_p_endpoint_i16(self, stream_endpoint, number_of_samples, endpoint_data): r'''write_p2_p_endpoint_i16 diff --git a/generated/nirfsg/nirfsg/unit_tests/_mock_helper.py b/generated/nirfsg/nirfsg/unit_tests/_mock_helper.py index e7a01aadde..fbd7e43e51 100644 --- a/generated/nirfsg/nirfsg/unit_tests/_mock_helper.py +++ b/generated/nirfsg/nirfsg/unit_tests/_mock_helper.py @@ -231,6 +231,12 @@ def __init__(self): self._defaults['UnlockSession']['callerHasLock'] = None self._defaults['WaitUntilSettled'] = {} self._defaults['WaitUntilSettled']['return'] = 0 + self._defaults['WriteArbWaveformComplexF32'] = {} + self._defaults['WriteArbWaveformComplexF32']['return'] = 0 + self._defaults['WriteArbWaveformComplexF64'] = {} + self._defaults['WriteArbWaveformComplexF64']['return'] = 0 + self._defaults['WriteArbWaveformComplexI16'] = {} + self._defaults['WriteArbWaveformComplexI16']['return'] = 0 self._defaults['WriteP2PEndpointI16'] = {} self._defaults['WriteP2PEndpointI16']['return'] = 0 self._defaults['WriteScript'] = {} @@ -891,6 +897,21 @@ def niRFSG_WaitUntilSettled(self, vi, max_time_milliseconds): # noqa: N802 return self._defaults['WaitUntilSettled']['return'] return self._defaults['WaitUntilSettled']['return'] + def niRFSG_WriteArbWaveformComplexF32(self, vi, waveform_name, number_of_samples, waveform_data_array, more_data_pending): # noqa: N802 + if self._defaults['WriteArbWaveformComplexF32']['return'] != 0: + return self._defaults['WriteArbWaveformComplexF32']['return'] + return self._defaults['WriteArbWaveformComplexF32']['return'] + + def niRFSG_WriteArbWaveformComplexF64(self, vi, waveform_name, number_of_samples, waveform_data_array, more_data_pending): # noqa: N802 + if self._defaults['WriteArbWaveformComplexF64']['return'] != 0: + return self._defaults['WriteArbWaveformComplexF64']['return'] + return self._defaults['WriteArbWaveformComplexF64']['return'] + + def niRFSG_WriteArbWaveformComplexI16(self, vi, waveform_name, number_of_samples, waveform_data_array, more_data_pending): # noqa: N802 + if self._defaults['WriteArbWaveformComplexI16']['return'] != 0: + return self._defaults['WriteArbWaveformComplexI16']['return'] + return self._defaults['WriteArbWaveformComplexI16']['return'] + def niRFSG_WriteP2PEndpointI16(self, vi, stream_endpoint, number_of_samples, endpoint_data): # noqa: N802 if self._defaults['WriteP2PEndpointI16']['return'] != 0: return self._defaults['WriteP2PEndpointI16']['return'] @@ -1080,6 +1101,12 @@ def set_side_effects_and_return_values(self, mock_library): mock_library.niRFSG_UnlockSession.return_value = 0 mock_library.niRFSG_WaitUntilSettled.side_effect = MockFunctionCallError("niRFSG_WaitUntilSettled") mock_library.niRFSG_WaitUntilSettled.return_value = 0 + mock_library.niRFSG_WriteArbWaveformComplexF32.side_effect = MockFunctionCallError("niRFSG_WriteArbWaveformComplexF32") + mock_library.niRFSG_WriteArbWaveformComplexF32.return_value = 0 + mock_library.niRFSG_WriteArbWaveformComplexF64.side_effect = MockFunctionCallError("niRFSG_WriteArbWaveformComplexF64") + mock_library.niRFSG_WriteArbWaveformComplexF64.return_value = 0 + mock_library.niRFSG_WriteArbWaveformComplexI16.side_effect = MockFunctionCallError("niRFSG_WriteArbWaveformComplexI16") + mock_library.niRFSG_WriteArbWaveformComplexI16.return_value = 0 mock_library.niRFSG_WriteP2PEndpointI16.side_effect = MockFunctionCallError("niRFSG_WriteP2PEndpointI16") mock_library.niRFSG_WriteP2PEndpointI16.return_value = 0 mock_library.niRFSG_WriteScript.side_effect = MockFunctionCallError("niRFSG_WriteScript") diff --git a/generated/niscope/niscope/_complextype.py b/generated/niscope/niscope/_complextype.py new file mode 100644 index 0000000000..f4a7c682c7 --- /dev/null +++ b/generated/niscope/niscope/_complextype.py @@ -0,0 +1,16 @@ +# -*- coding: utf-8 -*- +# This file was generated +import ctypes +import niscope._visatype as _visatype + + +class ComplexViReal64(ctypes.Structure): + _fields_ = [("real", _visatype.ViReal64), ("imag", _visatype.ViReal64)] + + +class ComplexViReal32(ctypes.Structure): + _fields_ = [("real", _visatype.ViReal32), ("imag", _visatype.ViReal32)] + + +class ComplexViInt16(ctypes.Structure): + _fields_ = [("real", _visatype.ViInt16), ("imag", _visatype.ViInt16)] diff --git a/generated/niscope/niscope/_library.py b/generated/niscope/niscope/_library.py index da85e7765a..c0cc59caa0 100644 --- a/generated/niscope/niscope/_library.py +++ b/generated/niscope/niscope/_library.py @@ -5,6 +5,7 @@ import niscope.errors as errors import threading +from niscope._complextype import * # noqa: F401,F403,H303 from niscope._visatype import * # noqa: F403,H303 import niscope.waveform_info as waveform_info # noqa: F401 diff --git a/generated/niscope/niscope/_library_interpreter.py b/generated/niscope/niscope/_library_interpreter.py index 1cb9a7d26a..00c0315aa8 100644 --- a/generated/niscope/niscope/_library_interpreter.py +++ b/generated/niscope/niscope/_library_interpreter.py @@ -6,6 +6,7 @@ import hightime # noqa: F401 import platform +import niscope._complextype as _complextype # noqa: F401 import niscope._library_singleton as _library_singleton import niscope._visatype as _visatype import niscope.enums as enums # noqa: F401 @@ -20,14 +21,19 @@ # Helper functions for creating ctypes needed for calling into the driver DLL -def _get_ctypes_pointer_for_buffer(value=None, library_type=None, size=None): +def _get_ctypes_pointer_for_buffer(value=None, library_type=None, size=None, complex_type='none'): if isinstance(value, array.array): assert library_type is not None, 'library_type is required for array.array' addr, _ = value.buffer_info() return ctypes.cast(addr, ctypes.POINTER(library_type)) elif str(type(value)).find("'numpy.ndarray'") != -1: import numpy - return numpy.ctypeslib.as_ctypes(value) + if complex_type == 'none': + return numpy.ctypeslib.as_ctypes(value) + else: + complex_dtype = numpy.dtype(library_type) + structured_array = value.view(complex_dtype) + return structured_array.ctypes.data_as(ctypes.POINTER(library_type)) elif isinstance(value, bytes): return ctypes.cast(value, ctypes.POINTER(library_type)) elif isinstance(value, list): diff --git a/generated/nise/nise/_complextype.py b/generated/nise/nise/_complextype.py new file mode 100644 index 0000000000..f10c1c6954 --- /dev/null +++ b/generated/nise/nise/_complextype.py @@ -0,0 +1,16 @@ +# -*- coding: utf-8 -*- +# This file was generated +import ctypes +import nise._visatype as _visatype + + +class ComplexViReal64(ctypes.Structure): + _fields_ = [("real", _visatype.ViReal64), ("imag", _visatype.ViReal64)] + + +class ComplexViReal32(ctypes.Structure): + _fields_ = [("real", _visatype.ViReal32), ("imag", _visatype.ViReal32)] + + +class ComplexViInt16(ctypes.Structure): + _fields_ = [("real", _visatype.ViInt16), ("imag", _visatype.ViInt16)] diff --git a/generated/nise/nise/_library.py b/generated/nise/nise/_library.py index 05af687c9c..b0e66f1136 100644 --- a/generated/nise/nise/_library.py +++ b/generated/nise/nise/_library.py @@ -5,6 +5,7 @@ import nise.errors as errors import threading +from nise._complextype import * # noqa: F401,F403,H303 from nise._visatype import * # noqa: F403,H303 diff --git a/generated/nise/nise/_library_interpreter.py b/generated/nise/nise/_library_interpreter.py index ad3f07dd8d..08470eb20b 100644 --- a/generated/nise/nise/_library_interpreter.py +++ b/generated/nise/nise/_library_interpreter.py @@ -4,6 +4,7 @@ import array import ctypes import hightime # noqa: F401 +import nise._complextype as _complextype # noqa: F401 import nise._library_singleton as _library_singleton import nise._visatype as _visatype import nise.enums as enums # noqa: F401 @@ -11,14 +12,19 @@ # Helper functions for creating ctypes needed for calling into the driver DLL -def _get_ctypes_pointer_for_buffer(value=None, library_type=None, size=None): +def _get_ctypes_pointer_for_buffer(value=None, library_type=None, size=None, complex_type='none'): if isinstance(value, array.array): assert library_type is not None, 'library_type is required for array.array' addr, _ = value.buffer_info() return ctypes.cast(addr, ctypes.POINTER(library_type)) elif str(type(value)).find("'numpy.ndarray'") != -1: import numpy - return numpy.ctypeslib.as_ctypes(value) + if complex_type == 'none': + return numpy.ctypeslib.as_ctypes(value) + else: + complex_dtype = numpy.dtype(library_type) + structured_array = value.view(complex_dtype) + return structured_array.ctypes.data_as(ctypes.POINTER(library_type)) elif isinstance(value, bytes): return ctypes.cast(value, ctypes.POINTER(library_type)) elif isinstance(value, list): diff --git a/generated/niswitch/niswitch/_complextype.py b/generated/niswitch/niswitch/_complextype.py new file mode 100644 index 0000000000..85f96c6856 --- /dev/null +++ b/generated/niswitch/niswitch/_complextype.py @@ -0,0 +1,16 @@ +# -*- coding: utf-8 -*- +# This file was generated +import ctypes +import niswitch._visatype as _visatype + + +class ComplexViReal64(ctypes.Structure): + _fields_ = [("real", _visatype.ViReal64), ("imag", _visatype.ViReal64)] + + +class ComplexViReal32(ctypes.Structure): + _fields_ = [("real", _visatype.ViReal32), ("imag", _visatype.ViReal32)] + + +class ComplexViInt16(ctypes.Structure): + _fields_ = [("real", _visatype.ViInt16), ("imag", _visatype.ViInt16)] diff --git a/generated/niswitch/niswitch/_library.py b/generated/niswitch/niswitch/_library.py index a91d25167b..3b9a9d4238 100644 --- a/generated/niswitch/niswitch/_library.py +++ b/generated/niswitch/niswitch/_library.py @@ -5,6 +5,7 @@ import niswitch.errors as errors import threading +from niswitch._complextype import * # noqa: F401,F403,H303 from niswitch._visatype import * # noqa: F403,H303 diff --git a/generated/niswitch/niswitch/_library_interpreter.py b/generated/niswitch/niswitch/_library_interpreter.py index 4d7dc8ea7c..9f0ec3c683 100644 --- a/generated/niswitch/niswitch/_library_interpreter.py +++ b/generated/niswitch/niswitch/_library_interpreter.py @@ -6,6 +6,7 @@ import hightime # noqa: F401 import platform +import niswitch._complextype as _complextype # noqa: F401 import niswitch._library_singleton as _library_singleton import niswitch._visatype as _visatype import niswitch.enums as enums # noqa: F401 @@ -16,14 +17,19 @@ # Helper functions for creating ctypes needed for calling into the driver DLL -def _get_ctypes_pointer_for_buffer(value=None, library_type=None, size=None): +def _get_ctypes_pointer_for_buffer(value=None, library_type=None, size=None, complex_type='none'): if isinstance(value, array.array): assert library_type is not None, 'library_type is required for array.array' addr, _ = value.buffer_info() return ctypes.cast(addr, ctypes.POINTER(library_type)) elif str(type(value)).find("'numpy.ndarray'") != -1: import numpy - return numpy.ctypeslib.as_ctypes(value) + if complex_type == 'none': + return numpy.ctypeslib.as_ctypes(value) + else: + complex_dtype = numpy.dtype(library_type) + structured_array = value.view(complex_dtype) + return structured_array.ctypes.data_as(ctypes.POINTER(library_type)) elif isinstance(value, bytes): return ctypes.cast(value, ctypes.POINTER(library_type)) elif isinstance(value, list): diff --git a/generated/nitclk/nitclk/_complextype.py b/generated/nitclk/nitclk/_complextype.py new file mode 100644 index 0000000000..af2db0026c --- /dev/null +++ b/generated/nitclk/nitclk/_complextype.py @@ -0,0 +1,16 @@ +# -*- coding: utf-8 -*- +# This file was generated +import ctypes +import nitclk._visatype as _visatype + + +class ComplexViReal64(ctypes.Structure): + _fields_ = [("real", _visatype.ViReal64), ("imag", _visatype.ViReal64)] + + +class ComplexViReal32(ctypes.Structure): + _fields_ = [("real", _visatype.ViReal32), ("imag", _visatype.ViReal32)] + + +class ComplexViInt16(ctypes.Structure): + _fields_ = [("real", _visatype.ViInt16), ("imag", _visatype.ViInt16)] diff --git a/generated/nitclk/nitclk/_library.py b/generated/nitclk/nitclk/_library.py index f8e44eae65..232168e79f 100644 --- a/generated/nitclk/nitclk/_library.py +++ b/generated/nitclk/nitclk/_library.py @@ -5,6 +5,7 @@ import nitclk.errors as errors import threading +from nitclk._complextype import * # noqa: F401,F403,H303 from nitclk._visatype import * # noqa: F403,H303 diff --git a/generated/nitclk/nitclk/_library_interpreter.py b/generated/nitclk/nitclk/_library_interpreter.py index 8a23273dd6..9a434a6f7f 100644 --- a/generated/nitclk/nitclk/_library_interpreter.py +++ b/generated/nitclk/nitclk/_library_interpreter.py @@ -4,20 +4,26 @@ import array import ctypes import hightime # noqa: F401 +import nitclk._complextype as _complextype # noqa: F401 import nitclk._library_singleton as _library_singleton import nitclk._visatype as _visatype import nitclk.errors as errors # Helper functions for creating ctypes needed for calling into the driver DLL -def _get_ctypes_pointer_for_buffer(value=None, library_type=None, size=None): +def _get_ctypes_pointer_for_buffer(value=None, library_type=None, size=None, complex_type='none'): if isinstance(value, array.array): assert library_type is not None, 'library_type is required for array.array' addr, _ = value.buffer_info() return ctypes.cast(addr, ctypes.POINTER(library_type)) elif str(type(value)).find("'numpy.ndarray'") != -1: import numpy - return numpy.ctypeslib.as_ctypes(value) + if complex_type == 'none': + return numpy.ctypeslib.as_ctypes(value) + else: + complex_dtype = numpy.dtype(library_type) + structured_array = value.view(complex_dtype) + return structured_array.ctypes.data_as(ctypes.POINTER(library_type)) elif isinstance(value, bytes): return ctypes.cast(value, ctypes.POINTER(library_type)) elif isinstance(value, list): diff --git a/src/nirfsg/metadata/functions.py b/src/nirfsg/metadata/functions.py index b3dd8ba68c..91b130ac15 100644 --- a/src/nirfsg/metadata/functions.py +++ b/src/nirfsg/metadata/functions.py @@ -4944,6 +4944,249 @@ 'returns': 'ViStatus', 'use_session_lock': False }, + 'WriteArbWaveformDispatcher': { + 'codegen_method': 'python-only', + 'documentation': { + 'description': 'Writes data to the waveform in onboard memory.\n\nBy default, subsequent calls to this function\ncontinue writing data from the position of the last sample written. You\ncan set the write position and offset by calling the nirfsg_SetNamedWaveformNextWritePosition\nnirfsg_SetWaveformNextWritePosition function.' + }, + 'included_in_proto': True, + 'method_templates': [ + { + 'documentation_filename': 'default_method', + 'library_interpreter_filename': 'none', + 'method_python_name_suffix': '', + 'session_filename': 'write_arb_waveform' + } + ], + 'parameters': [ + { + 'direction': 'in', + 'name': 'vi', + 'type': 'ViSession', + 'use_array': False, + 'use_in_python_api': True + }, + { + 'direction': 'in', + 'name': 'waveformName', + 'type': 'ViConstString', + 'use_array': False, + 'use_in_python_api': True + }, + { + 'direction': 'in', + 'name': 'numberOfSamples', + 'type': 'ViInt32', + 'use_array': False, + 'use_in_python_api': False + }, + { + 'direction': 'in', + 'name': 'waveformDataArray', + 'size': { + 'mechanism': 'len', + 'value': 'numberOfSamples' + }, + 'type': 'ComplexViReal64[]', + 'use_in_python_api': True + }, + { + 'direction': 'in', + 'name': 'moreDataPending', + 'type': 'ViBoolean', + 'use_array': False, + 'use_in_python_api': True + } + ], + 'python_name': 'write_arb_waveform', + 'returns': 'ViStatus' + }, + 'WriteArbWaveformComplexF64': { + 'codegen_method': 'private', + 'documentation': { + 'description': 'TBD' + }, + 'included_in_proto': True, + 'is_error_handling': False, + 'method_templates': [ + { + 'documentation_filename': 'numpy_method', + 'library_interpreter_filename': 'numpy_write_method', + 'method_python_name_suffix': '', + 'session_filename': 'numpy_write_method' + } + ], + 'method_name_for_documentation': 'write_arb_waveform', + 'parameters': [ + { + 'direction': 'in', + 'name': 'vi', + 'type': 'ViSession', + 'use_array': False, + 'use_in_python_api': True + }, + { + 'direction': 'in', + 'name': 'waveformName', + 'type': 'ViConstString', + 'use_array': False, + 'use_in_python_api': True + }, + { + 'direction': 'in', + 'name': 'numberOfSamples', + 'type': 'ViInt32', + 'use_array': False, + 'use_in_python_api': False + }, + { + 'direction': 'in', + 'name': 'waveformDataArray', + 'numpy': True, + 'size': { + 'mechanism': 'len', + 'value': 'numberOfSamples' + }, + 'type': 'ComplexViReal64[]', + 'complex_type': 'numpy', + 'use_numpy_array': True, + 'use_in_python_api': True + }, + { + 'direction': 'in', + 'name': 'moreDataPending', + 'type': 'ViBoolean', + 'use_array': False, + 'use_in_python_api': True + } + ], + 'returns': 'ViStatus', + 'use_session_lock': True + }, + 'WriteArbWaveformComplexI16': { + 'codegen_method': 'private', + 'documentation': { + 'description': 'TBD' + }, + 'included_in_proto': True, + 'is_error_handling': False, + 'method_templates': [ + { + 'documentation_filename': 'numpy_method', + 'library_interpreter_filename': 'numpy_write_method', + 'method_python_name_suffix': '', + 'session_filename': 'numpy_write_method' + } + ], + 'method_name_for_documentation': 'write_arb_waveform', + 'parameters': [ + { + 'direction': 'in', + 'name': 'vi', + 'type': 'ViSession', + 'use_array': False, + 'use_in_python_api': True + }, + { + 'direction': 'in', + 'name': 'waveformName', + 'type': 'ViConstString', + 'use_array': False, + 'use_in_python_api': True + }, + { + 'direction': 'in', + 'name': 'numberOfSamples', + 'type': 'ViInt32', + 'use_array': False, + 'use_in_python_api': False + }, + { + 'direction': 'in', + 'name': 'waveformDataArray', + 'numpy': True, + 'size': { + 'mechanism': 'len', + 'value': 'numberOfSamples' + }, + 'type': 'ComplexViInt16[]', + 'use_numpy_array': True, + 'complex_type': 'interleaved', + 'use_in_python_api': True + }, + { + 'direction': 'in', + 'name': 'moreDataPending', + 'type': 'ViBoolean', + 'use_array': False, + 'use_in_python_api': True + } + ], + 'returns': 'ViStatus', + 'use_session_lock': True + }, + 'WriteArbWaveformComplexF32': { + 'codegen_method': 'private', + 'documentation': { + 'description': 'TBD' + }, + 'included_in_proto': True, + 'is_error_handling': False, + 'method_templates': [ + { + 'documentation_filename': 'numpy_method', + 'library_interpreter_filename': 'numpy_write_method', + 'method_python_name_suffix': '', + 'session_filename': 'numpy_write_method' + } + ], + 'method_name_for_documentation': 'write_arb_waveform', + 'parameters': [ + { + 'direction': 'in', + 'name': 'vi', + 'type': 'ViSession', + 'use_array': False, + 'use_in_python_api': True + }, + { + 'direction': 'in', + 'name': 'waveformName', + 'type': 'ViConstString', + 'use_array': False, + 'use_in_python_api': True + }, + { + 'direction': 'in', + 'name': 'numberOfSamples', + 'type': 'ViInt32', + 'use_array': False, + 'use_in_python_api': False + }, + { + 'direction': 'in', + 'name': 'waveformDataArray', + 'numpy': True, + 'size': { + 'mechanism': 'len', + 'value': 'numberOfSamples' + }, + 'type': 'ComplexViReal32[]', + 'complex_type': 'numpy', + 'use_numpy_array': True, + 'use_in_python_api': True + }, + { + 'direction': 'in', + 'name': 'moreDataPending', + 'type': 'ViBoolean', + 'use_array': False, + 'use_in_python_api': True + } + ], + 'returns': 'ViStatus', + 'use_session_lock': True + }, 'WriteP2PEndpointI16': { 'codegen_method': 'public', 'documentation': { diff --git a/src/nirfsg/templates/session.py/write_arb_waveform.py.mako b/src/nirfsg/templates/session.py/write_arb_waveform.py.mako new file mode 100644 index 0000000000..e4097d8472 --- /dev/null +++ b/src/nirfsg/templates/session.py/write_arb_waveform.py.mako @@ -0,0 +1,24 @@ +<%page args="f, config, method_template"/>\ +<% + '''Dispatches to the appropriate "write arb waveform" method based on the waveform type.''' + import build.helper as helper +%>\ + def ${f['python_name']}(${helper.get_params_snippet(f, helper.ParameterUsageOptions.SESSION_METHOD_DECLARATION)}): + '''${f['python_name']} + + ${helper.get_function_docstring(f, False, config, indent=8)} + ''' + if str(type(waveform_data_array)).find("'numpy.ndarray'") != -1: + import numpy + if waveform_data_array.dtype == numpy.complex128: + return self._write_arb_waveform_complex_f64(waveform_name, waveform_data_array, more_data_pending) + elif waveform_data_array.dtype == numpy.complex64: + return self._write_arb_waveform_complex_f32(waveform_name, waveform_data_array, more_data_pending) + elif waveform_data_array.dtype == numpy.int16: + return self._write_arb_waveform_complex_i16(waveform_name, waveform_data_array, more_data_pending) + else: + raise TypeError("Unsupported dtype. Is {}, expected {} or {} or {}".format(waveform_data_array.dtype, numpy.complex128, numpy.complex64, numpy.int16)) + else: + raise TypeError("Unsupported dtype. Is {}, expected {} or {} or {}".format(waveform_data_array.dtype, numpy.complex128, numpy.complex64, numpy.int16)) + + return self._write_arb_waveform_complex_f64(waveform_name, waveform_data_array, more_data_pending) diff --git a/tox-travis.ini b/tox-travis.ini index c7b847edd8..9a7a62ada6 100644 --- a/tox-travis.ini +++ b/tox-travis.ini @@ -156,6 +156,7 @@ deps = installers: build flake8: hacking flake8: pep8-naming + docs: snowballstemmer == 2.2.0 docs: sphinx docs: sphinx-rtd-theme pkg: check-manifest diff --git a/tox.ini b/tox.ini index 517c919d94..1ae593ac9f 100644 --- a/tox.ini +++ b/tox.ini @@ -156,6 +156,7 @@ deps = installers: build flake8: hacking flake8: pep8-naming + docs: snowballstemmer == 2.2.0 docs: sphinx docs: sphinx-rtd-theme pkg: check-manifest From d9fba59249193009fc01afe00af3a678458e4de2 Mon Sep 17 00:00:00 2001 From: Rahul R Date: Tue, 13 May 2025 18:18:58 +0530 Subject: [PATCH 02/33] Inclusion of test case for WriteWaveformComplexF64 --- build/templates/_matchers.py.mako | 20 +++ .../nidcpower/unit_tests/_matchers.py | 20 +++ .../nidigital/unit_tests/_matchers.py | 20 +++ generated/nidmm/nidmm/unit_tests/_matchers.py | 20 +++ .../nifake/nifake/_grpc_stub_interpreter.py | 3 + generated/nifake/nifake/_library.py | 9 ++ .../nifake/nifake/_library_interpreter.py | 8 ++ generated/nifake/nifake/session.py | 20 +++ .../nifake/nifake/unit_tests/_matchers.py | 20 +++ .../nifake/nifake/unit_tests/_mock_helper.py | 9 ++ .../unit_tests/test_library_interpreter.py | 42 ++++--- .../nifgen/nifgen/unit_tests/_matchers.py | 20 +++ .../nimodinst/unit_tests/_matchers.py | 20 +++ generated/nirfsg/nirfsg/_library.py | 18 +-- .../nirfsg/nirfsg/_library_interpreter.py | 20 +-- generated/nirfsg/nirfsg/session.py | 116 +++++++++--------- .../nirfsg/nirfsg/unit_tests/_matchers.py | 20 +++ .../nirfsg/nirfsg/unit_tests/_mock_helper.py | 18 +-- .../niscope/niscope/unit_tests/_matchers.py | 20 +++ generated/nise/nise/unit_tests/_matchers.py | 20 +++ .../niswitch/niswitch/unit_tests/_matchers.py | 20 +++ .../nitclk/nitclk/unit_tests/_matchers.py | 20 +++ src/nifake/metadata/functions.py | 46 +++++++ .../unit_tests/test_library_interpreter.py | 25 +++- src/nirfsg/metadata/functions.py | 4 +- 25 files changed, 471 insertions(+), 107 deletions(-) diff --git a/build/templates/_matchers.py.mako b/build/templates/_matchers.py.mako index 341685d847..5743c0b28a 100644 --- a/build/templates/_matchers.py.mako +++ b/build/templates/_matchers.py.mako @@ -5,6 +5,7 @@ These work well with our visatype definitions. ''' import ctypes +import ${template_parameters['metadata'].config['module_name']}._complextype as _complextype import ${template_parameters['metadata'].config['module_name']}._visatype as _visatype import pprint @@ -271,6 +272,25 @@ class ViReal64PointerMatcher(_PointerMatcher): _PointerMatcher.__init__(self, _visatype.ViReal64) +class ComplexViReal64PointerMatcher(_PointerMatcher): + def __init__(self, expected_data, expected_size): + _PointerMatcher.__init__(self, _complextype.ComplexViReal64) + self.expected_data = expected_data + self.expected_size = expected_size + + def __eq__(self, other): + _PointerMatcher.__eq__(self, other) + + for i in range(self.expected_size): + expected_value = self.expected_data[i] + actual_value = other[i] + if expected_value.real != actual_value.real or expected_value.imag != actual_value.imag: + return False + return True + + def __repr__(self): + return f"ComplexViReal64PointerMatcher({self.expected_data})" + # Buffers diff --git a/generated/nidcpower/nidcpower/unit_tests/_matchers.py b/generated/nidcpower/nidcpower/unit_tests/_matchers.py index 6e8e651bf0..df1352b3f2 100644 --- a/generated/nidcpower/nidcpower/unit_tests/_matchers.py +++ b/generated/nidcpower/nidcpower/unit_tests/_matchers.py @@ -5,6 +5,7 @@ ''' import ctypes +import nidcpower._complextype as _complextype import nidcpower._visatype as _visatype import pprint @@ -271,6 +272,25 @@ def __init__(self): _PointerMatcher.__init__(self, _visatype.ViReal64) +class ComplexViReal64PointerMatcher(_PointerMatcher): + def __init__(self, expected_data, expected_size): + _PointerMatcher.__init__(self, _complextype.ComplexViReal64) + self.expected_data = expected_data + self.expected_size = expected_size + + def __eq__(self, other): + _PointerMatcher.__eq__(self, other) + + for i in range(self.expected_size): + expected_value = self.expected_data[i] + actual_value = other[i] + if expected_value.real != actual_value.real or expected_value.imag != actual_value.imag: + return False + return True + + def __repr__(self): + return f"ComplexViReal64PointerMatcher({self.expected_data})" + # Buffers diff --git a/generated/nidigital/nidigital/unit_tests/_matchers.py b/generated/nidigital/nidigital/unit_tests/_matchers.py index 2832a0b8f3..fe06d6228a 100644 --- a/generated/nidigital/nidigital/unit_tests/_matchers.py +++ b/generated/nidigital/nidigital/unit_tests/_matchers.py @@ -5,6 +5,7 @@ ''' import ctypes +import nidigital._complextype as _complextype import nidigital._visatype as _visatype import pprint @@ -271,6 +272,25 @@ def __init__(self): _PointerMatcher.__init__(self, _visatype.ViReal64) +class ComplexViReal64PointerMatcher(_PointerMatcher): + def __init__(self, expected_data, expected_size): + _PointerMatcher.__init__(self, _complextype.ComplexViReal64) + self.expected_data = expected_data + self.expected_size = expected_size + + def __eq__(self, other): + _PointerMatcher.__eq__(self, other) + + for i in range(self.expected_size): + expected_value = self.expected_data[i] + actual_value = other[i] + if expected_value.real != actual_value.real or expected_value.imag != actual_value.imag: + return False + return True + + def __repr__(self): + return f"ComplexViReal64PointerMatcher({self.expected_data})" + # Buffers diff --git a/generated/nidmm/nidmm/unit_tests/_matchers.py b/generated/nidmm/nidmm/unit_tests/_matchers.py index fa56c4cc55..34b84e075f 100644 --- a/generated/nidmm/nidmm/unit_tests/_matchers.py +++ b/generated/nidmm/nidmm/unit_tests/_matchers.py @@ -5,6 +5,7 @@ ''' import ctypes +import nidmm._complextype as _complextype import nidmm._visatype as _visatype import pprint @@ -271,6 +272,25 @@ def __init__(self): _PointerMatcher.__init__(self, _visatype.ViReal64) +class ComplexViReal64PointerMatcher(_PointerMatcher): + def __init__(self, expected_data, expected_size): + _PointerMatcher.__init__(self, _complextype.ComplexViReal64) + self.expected_data = expected_data + self.expected_size = expected_size + + def __eq__(self, other): + _PointerMatcher.__eq__(self, other) + + for i in range(self.expected_size): + expected_value = self.expected_data[i] + actual_value = other[i] + if expected_value.real != actual_value.real or expected_value.imag != actual_value.imag: + return False + return True + + def __repr__(self): + return f"ComplexViReal64PointerMatcher({self.expected_data})" + # Buffers diff --git a/generated/nifake/nifake/_grpc_stub_interpreter.py b/generated/nifake/nifake/_grpc_stub_interpreter.py index ee8d29c047..9837998ff2 100644 --- a/generated/nifake/nifake/_grpc_stub_interpreter.py +++ b/generated/nifake/nifake/_grpc_stub_interpreter.py @@ -489,6 +489,9 @@ def write_waveform(self, waveform): # noqa: N802 def write_waveform_numpy(self, waveform): # noqa: N802 raise NotImplementedError('numpy-specific methods are not supported over gRPC') + def write_waveform_complex_f64(self, waveform_data_array): # noqa: N802 + raise NotImplementedError('numpy-specific methods are not supported over gRPC') + def close(self): # noqa: N802 self._invoke( self._client.Close, diff --git a/generated/nifake/nifake/_library.py b/generated/nifake/nifake/_library.py index b5cdf2dc5c..0884dca32d 100644 --- a/generated/nifake/nifake/_library.py +++ b/generated/nifake/nifake/_library.py @@ -93,6 +93,7 @@ def __init__(self, ctypes_library): self.niFake_UnlockSession_cfunc = None self.niFake_Use64BitNumber_cfunc = None self.niFake_WriteWaveform_cfunc = None + self.niFake_WriteWaveformComplexF64_cfunc = None self.niFake_close_cfunc = None self.niFake_error_message_cfunc = None self.niFake_self_test_cfunc = None @@ -640,6 +641,14 @@ def niFake_WriteWaveform(self, vi, number_of_samples, waveform): # noqa: N802 self.niFake_WriteWaveform_cfunc.restype = ViStatus # noqa: F405 return self.niFake_WriteWaveform_cfunc(vi, number_of_samples, waveform) + def niFake_WriteWaveformComplexF64(self, vi, number_of_samples, waveform_data_array): # noqa: N802 + with self._func_lock: + if self.niFake_WriteWaveformComplexF64_cfunc is None: + self.niFake_WriteWaveformComplexF64_cfunc = self._get_library_function('niFake_WriteWaveformComplexF64') + self.niFake_WriteWaveformComplexF64_cfunc.argtypes = [ViSession, ViInt32, ctypes.POINTER(ComplexViReal64)] # noqa: F405 + self.niFake_WriteWaveformComplexF64_cfunc.restype = ViStatus # noqa: F405 + return self.niFake_WriteWaveformComplexF64_cfunc(vi, number_of_samples, waveform_data_array) + def niFake_close(self, vi): # noqa: N802 with self._func_lock: if self.niFake_close_cfunc is None: diff --git a/generated/nifake/nifake/_library_interpreter.py b/generated/nifake/nifake/_library_interpreter.py index f1c641e29c..f4c51b5066 100644 --- a/generated/nifake/nifake/_library_interpreter.py +++ b/generated/nifake/nifake/_library_interpreter.py @@ -738,6 +738,14 @@ def write_waveform_numpy(self, waveform): # noqa: N802 errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) return + def write_waveform_complex_f64(self, waveform_data_array): # noqa: N802 + vi_ctype = _visatype.ViSession(self._vi) # case S110 + number_of_samples_ctype = _visatype.ViInt32(0 if waveform_data_array is None else len(waveform_data_array)) # case S160 + waveform_data_array_ctype = _get_ctypes_pointer_for_buffer(value=waveform_data_array, library_type=_complextype.ComplexViReal64, complex_type='numpy') # case B510 + error_code = self._library.niFake_WriteWaveformComplexF64(vi_ctype, number_of_samples_ctype, waveform_data_array_ctype) + errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) + return + def close(self): # noqa: N802 vi_ctype = _visatype.ViSession(self._vi) # case S110 error_code = self._library.niFake_close(vi_ctype) diff --git a/generated/nifake/nifake/session.py b/generated/nifake/nifake/session.py index 6f80d48585..2f43e9bc22 100644 --- a/generated/nifake/nifake/session.py +++ b/generated/nifake/nifake/session.py @@ -1670,6 +1670,26 @@ def write_waveform_numpy(self, waveform): raise TypeError('waveform must be numpy.ndarray of dtype=float64, is ' + str(waveform.dtype)) self._interpreter.write_waveform_numpy(waveform) + @ivi_synchronized + def write_waveform_complex_f64(self, waveform_data_array): + r'''write_waveform_complex_f64 + + TBD + + Args: + waveform_data_array (numpy.array(dtype=numpy.complex128)): + + ''' + import numpy + + if type(waveform_data_array) is not numpy.ndarray: + raise TypeError('waveform_data_array must be {0}, is {1}'.format(numpy.ndarray, type(waveform_data_array))) + if numpy.isfortran(waveform_data_array) is True: + raise TypeError('waveform_data_array must be in C-order') + if waveform_data_array.dtype is not numpy.dtype('complex128'): + raise TypeError('waveform_data_array must be numpy.ndarray of dtype=complex128, is ' + str(waveform_data_array.dtype)) + self._interpreter.write_waveform_complex_f64(waveform_data_array) + def _close(self): r'''_close diff --git a/generated/nifake/nifake/unit_tests/_matchers.py b/generated/nifake/nifake/unit_tests/_matchers.py index 6843dd5ec5..2c05c3b078 100644 --- a/generated/nifake/nifake/unit_tests/_matchers.py +++ b/generated/nifake/nifake/unit_tests/_matchers.py @@ -5,6 +5,7 @@ ''' import ctypes +import nifake._complextype as _complextype import nifake._visatype as _visatype import pprint @@ -271,6 +272,25 @@ def __init__(self): _PointerMatcher.__init__(self, _visatype.ViReal64) +class ComplexViReal64PointerMatcher(_PointerMatcher): + def __init__(self, expected_data, expected_size): + _PointerMatcher.__init__(self, _complextype.ComplexViReal64) + self.expected_data = expected_data + self.expected_size = expected_size + + def __eq__(self, other): + _PointerMatcher.__eq__(self, other) + + for i in range(self.expected_size): + expected_value = self.expected_data[i] + actual_value = other[i] + if expected_value.real != actual_value.real or expected_value.imag != actual_value.imag: + return False + return True + + def __repr__(self): + return f"ComplexViReal64PointerMatcher({self.expected_data})" + # Buffers diff --git a/generated/nifake/nifake/unit_tests/_mock_helper.py b/generated/nifake/nifake/unit_tests/_mock_helper.py index fe2a606694..599cc462a9 100644 --- a/generated/nifake/nifake/unit_tests/_mock_helper.py +++ b/generated/nifake/nifake/unit_tests/_mock_helper.py @@ -210,6 +210,8 @@ def __init__(self): self._defaults['Use64BitNumber']['output'] = None self._defaults['WriteWaveform'] = {} self._defaults['WriteWaveform']['return'] = 0 + self._defaults['WriteWaveformComplexF64'] = {} + self._defaults['WriteWaveformComplexF64']['return'] = 0 self._defaults['close'] = {} self._defaults['close']['return'] = 0 self._defaults['error_message'] = {} @@ -955,6 +957,11 @@ def niFake_WriteWaveform(self, vi, number_of_samples, waveform): # noqa: N802 return self._defaults['WriteWaveform']['return'] return self._defaults['WriteWaveform']['return'] + def niFake_WriteWaveformComplexF64(self, vi, number_of_samples, waveform_data_array): # noqa: N802 + if self._defaults['WriteWaveformComplexF64']['return'] != 0: + return self._defaults['WriteWaveformComplexF64']['return'] + return self._defaults['WriteWaveformComplexF64']['return'] + def niFake_close(self, vi): # noqa: N802 if self._defaults['close']['return'] != 0: return self._defaults['close']['return'] @@ -1129,6 +1136,8 @@ def set_side_effects_and_return_values(self, mock_library): mock_library.niFake_Use64BitNumber.return_value = 0 mock_library.niFake_WriteWaveform.side_effect = MockFunctionCallError("niFake_WriteWaveform") mock_library.niFake_WriteWaveform.return_value = 0 + mock_library.niFake_WriteWaveformComplexF64.side_effect = MockFunctionCallError("niFake_WriteWaveformComplexF64") + mock_library.niFake_WriteWaveformComplexF64.return_value = 0 mock_library.niFake_close.side_effect = MockFunctionCallError("niFake_close") mock_library.niFake_close.return_value = 0 mock_library.niFake_error_message.side_effect = MockFunctionCallError("niFake_error_message") diff --git a/generated/nifake/nifake/unit_tests/test_library_interpreter.py b/generated/nifake/nifake/unit_tests/test_library_interpreter.py index 6a1bfb6ba4..52feea74a4 100644 --- a/generated/nifake/nifake/unit_tests/test_library_interpreter.py +++ b/generated/nifake/nifake/unit_tests/test_library_interpreter.py @@ -36,6 +36,8 @@ def setup_method(self, method): self.side_effects_helper.set_side_effects_and_return_values(self.patched_library) self.patched_library.niFake_SetRuntimeEnvironment.side_effect = self.side_effects_helper.niFake_SetRuntimeEnvironment + self.patched_library.niFake_WriteWaveformComplexF64.side_effect = self.side_effects_helper.niFake_WriteWaveformComplexF64 + self.get_ctypes_pointer_for_buffer_side_effect_count = 0 self.get_ctypes_pointer_for_buffer_side_effect_items = [] @@ -51,28 +53,11 @@ def niFake_read_warning(self, vi, maximum_time, reading): # noqa: N802 reading.contents.value = self.reading return self.error_code_return - def get_ctypes_pointer_for_buffer_side_effect(self, value, library_type=None): + def get_ctypes_pointer_for_buffer_side_effect(self, value, library_type=None, complex_type=None): ret_val = self.get_ctypes_pointer_for_buffer_side_effect_items[self.get_ctypes_pointer_for_buffer_side_effect_count] self.get_ctypes_pointer_for_buffer_side_effect_count += 1 return ret_val - def test_write_numpy_complex128_valid_input(self): - waveform_data = numpy.array([1 + 2j, 3 + 4j], dtype=numpy.complex128) # NumPy array of complex128 - - with patch.object(self.patched_library, 'niFake_WriteArbWaveformComplexF64', wraps=self.patched_library.niFake_WriteArbWaveformComplexF64) as mock_write_waveform: - interpreter = self.get_initialized_library_interpreter() - - # Act - interpreter.write_arb_waveform_complex_f64( waveform_data) - - # Assert - self.patched_library.get_ctypes_pointer.assert_called_once_with( - value=waveform_data, - library_type=nifake._complextype.ComplexViReal64, - complex_type='numpy' - ) - mock_write_waveform.assert_called_once() - # Methods def test_simple_function(self): @@ -860,6 +845,27 @@ def test_import_attribute_configuration_buffer_str(self): interpreter.import_attribute_configuration_buffer(configuration) self.patched_library.niFake_ImportAttributeConfigurationBuffer.assert_called_once_with(_matchers.ViSessionMatcher(SESSION_NUM_FOR_TEST), _matchers.ViInt32Matcher(len(configuration)), _matchers.ViInt8BufferMatcher(expected_list)) + def test_write_numpy_complex128_valid_input(self): + import ctypes + import numpy as np + + from nifake._complextype import ComplexViReal64 + + waveform_data = np.full(1000, 0.707 + 0.707j, dtype=np.complex128) + number_of_samples = len(waveform_data) + + complex_dtype = numpy.dtype(ComplexViReal64) + structured_array = waveform_data.view(complex_dtype) + waveform_data_pointer = structured_array.ctypes.data_as(ctypes.POINTER(ComplexViReal64)) + self.patched_library.niFake_WriteWaveformComplexF64.side_effect = self.side_effects_helper.niFake_WriteWaveformComplexF64 + interpreter = self.get_initialized_library_interpreter() + interpreter.write_waveform_complex_f64(waveform_data) + self.patched_library.niFake_WriteWaveformComplexF64.assert_called_once_with( + _matchers.ViSessionMatcher(SESSION_NUM_FOR_TEST), + _matchers.ViInt32Matcher(number_of_samples), + _matchers.ComplexViReal64PointerMatcher(waveform_data_pointer, number_of_samples) + ) + def test_matcher_prints(self): assert _matchers.ViSessionMatcher(SESSION_NUM_FOR_TEST).__repr__() == "ViSessionMatcher(" + str(nifake._visatype.ViSession) + ", 42)" assert _matchers.ViAttrMatcher(SESSION_NUM_FOR_TEST).__repr__() == "ViAttrMatcher(" + str(nifake._visatype.ViAttr) + ", 42)" diff --git a/generated/nifgen/nifgen/unit_tests/_matchers.py b/generated/nifgen/nifgen/unit_tests/_matchers.py index d2bcbe40dc..aeeaa1ddb1 100644 --- a/generated/nifgen/nifgen/unit_tests/_matchers.py +++ b/generated/nifgen/nifgen/unit_tests/_matchers.py @@ -5,6 +5,7 @@ ''' import ctypes +import nifgen._complextype as _complextype import nifgen._visatype as _visatype import pprint @@ -271,6 +272,25 @@ def __init__(self): _PointerMatcher.__init__(self, _visatype.ViReal64) +class ComplexViReal64PointerMatcher(_PointerMatcher): + def __init__(self, expected_data, expected_size): + _PointerMatcher.__init__(self, _complextype.ComplexViReal64) + self.expected_data = expected_data + self.expected_size = expected_size + + def __eq__(self, other): + _PointerMatcher.__eq__(self, other) + + for i in range(self.expected_size): + expected_value = self.expected_data[i] + actual_value = other[i] + if expected_value.real != actual_value.real or expected_value.imag != actual_value.imag: + return False + return True + + def __repr__(self): + return f"ComplexViReal64PointerMatcher({self.expected_data})" + # Buffers diff --git a/generated/nimodinst/nimodinst/unit_tests/_matchers.py b/generated/nimodinst/nimodinst/unit_tests/_matchers.py index 4e0efc7343..2e3cbcc10c 100644 --- a/generated/nimodinst/nimodinst/unit_tests/_matchers.py +++ b/generated/nimodinst/nimodinst/unit_tests/_matchers.py @@ -5,6 +5,7 @@ ''' import ctypes +import nimodinst._complextype as _complextype import nimodinst._visatype as _visatype import pprint @@ -271,6 +272,25 @@ def __init__(self): _PointerMatcher.__init__(self, _visatype.ViReal64) +class ComplexViReal64PointerMatcher(_PointerMatcher): + def __init__(self, expected_data, expected_size): + _PointerMatcher.__init__(self, _complextype.ComplexViReal64) + self.expected_data = expected_data + self.expected_size = expected_size + + def __eq__(self, other): + _PointerMatcher.__eq__(self, other) + + for i in range(self.expected_size): + expected_value = self.expected_data[i] + actual_value = other[i] + if expected_value.real != actual_value.real or expected_value.imag != actual_value.imag: + return False + return True + + def __repr__(self): + return f"ComplexViReal64PointerMatcher({self.expected_data})" + # Buffers diff --git a/generated/nirfsg/nirfsg/_library.py b/generated/nirfsg/nirfsg/_library.py index b7f3160e36..c86181de37 100644 --- a/generated/nirfsg/nirfsg/_library.py +++ b/generated/nirfsg/nirfsg/_library.py @@ -107,10 +107,10 @@ def __init__(self, ctypes_library): self.niRFSG_UnlockSession_cfunc = None self.niRFSG_WaitUntilSettled_cfunc = None self.niRFSG_WriteArbWaveformComplexF32_cfunc = None - self.niRFSG_WriteArbWaveformComplexF64_cfunc = None self.niRFSG_WriteArbWaveformComplexI16_cfunc = None self.niRFSG_WriteP2PEndpointI16_cfunc = None self.niRFSG_WriteScript_cfunc = None + self.niRFSG_WriteWaveformComplexF64_cfunc = None self.niRFSG_close_cfunc = None def _get_library_function(self, name): @@ -816,14 +816,6 @@ def niRFSG_WriteArbWaveformComplexF32(self, vi, waveform_name, number_of_samples self.niRFSG_WriteArbWaveformComplexF32_cfunc.restype = ViStatus # noqa: F405 return self.niRFSG_WriteArbWaveformComplexF32_cfunc(vi, waveform_name, number_of_samples, waveform_data_array, more_data_pending) - def niRFSG_WriteArbWaveformComplexF64(self, vi, waveform_name, number_of_samples, waveform_data_array, more_data_pending): # noqa: N802 - with self._func_lock: - if self.niRFSG_WriteArbWaveformComplexF64_cfunc is None: - self.niRFSG_WriteArbWaveformComplexF64_cfunc = self._get_library_function('niRFSG_WriteArbWaveformComplexF64') - self.niRFSG_WriteArbWaveformComplexF64_cfunc.argtypes = [ViSession, ctypes.POINTER(ViChar), ViInt32, ctypes.POINTER(ComplexViReal64), ViBoolean] # noqa: F405 - self.niRFSG_WriteArbWaveformComplexF64_cfunc.restype = ViStatus # noqa: F405 - return self.niRFSG_WriteArbWaveformComplexF64_cfunc(vi, waveform_name, number_of_samples, waveform_data_array, more_data_pending) - def niRFSG_WriteArbWaveformComplexI16(self, vi, waveform_name, number_of_samples, waveform_data_array, more_data_pending): # noqa: N802 with self._func_lock: if self.niRFSG_WriteArbWaveformComplexI16_cfunc is None: @@ -848,6 +840,14 @@ def niRFSG_WriteScript(self, vi, script): # noqa: N802 self.niRFSG_WriteScript_cfunc.restype = ViStatus # noqa: F405 return self.niRFSG_WriteScript_cfunc(vi, script) + def niRFSG_WriteWaveformComplexF64(self, vi, waveform_name, number_of_samples, waveform_data_array, more_data_pending): # noqa: N802 + with self._func_lock: + if self.niRFSG_WriteWaveformComplexF64_cfunc is None: + self.niRFSG_WriteWaveformComplexF64_cfunc = self._get_library_function('niRFSG_WriteWaveformComplexF64') + self.niRFSG_WriteWaveformComplexF64_cfunc.argtypes = [ViSession, ctypes.POINTER(ViChar), ViInt32, ctypes.POINTER(ComplexViReal64), ViBoolean] # noqa: F405 + self.niRFSG_WriteWaveformComplexF64_cfunc.restype = ViStatus # noqa: F405 + return self.niRFSG_WriteWaveformComplexF64_cfunc(vi, waveform_name, number_of_samples, waveform_data_array, more_data_pending) + def niRFSG_close(self, vi): # noqa: N802 with self._func_lock: if self.niRFSG_close_cfunc is None: diff --git a/generated/nirfsg/nirfsg/_library_interpreter.py b/generated/nirfsg/nirfsg/_library_interpreter.py index e17bb08b15..bd02f2fb68 100644 --- a/generated/nirfsg/nirfsg/_library_interpreter.py +++ b/generated/nirfsg/nirfsg/_library_interpreter.py @@ -796,16 +796,6 @@ def write_arb_waveform_complex_f32(self, waveform_name, waveform_data_array, mor errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) return - def write_arb_waveform_complex_f64(self, waveform_name, waveform_data_array, more_data_pending): # noqa: N802 - vi_ctype = _visatype.ViSession(self._vi) # case S110 - waveform_name_ctype = ctypes.create_string_buffer(waveform_name.encode(self._encoding)) # case C020 - number_of_samples_ctype = _visatype.ViInt32(0 if waveform_data_array is None else len(waveform_data_array)) # case S160 - waveform_data_array_ctype = _get_ctypes_pointer_for_buffer(value=waveform_data_array, library_type=_complextype.ComplexViReal64, complex_type='numpy') # case B510 - more_data_pending_ctype = _visatype.ViBoolean(more_data_pending) # case S150 - error_code = self._library.niRFSG_WriteArbWaveformComplexF64(vi_ctype, waveform_name_ctype, number_of_samples_ctype, waveform_data_array_ctype, more_data_pending_ctype) - errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) - return - def write_arb_waveform_complex_i16(self, waveform_name, waveform_data_array, more_data_pending): # noqa: N802 vi_ctype = _visatype.ViSession(self._vi) # case S110 waveform_name_ctype = ctypes.create_string_buffer(waveform_name.encode(self._encoding)) # case C020 @@ -832,6 +822,16 @@ def write_script(self, script): # noqa: N802 errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) return + def write_waveform_complex_f64(self, waveform_name, waveform_data_array, more_data_pending): # noqa: N802 + vi_ctype = _visatype.ViSession(self._vi) # case S110 + waveform_name_ctype = ctypes.create_string_buffer(waveform_name.encode(self._encoding)) # case C020 + number_of_samples_ctype = _visatype.ViInt32(0 if waveform_data_array is None else len(waveform_data_array)) # case S160 + waveform_data_array_ctype = _get_ctypes_pointer_for_buffer(value=waveform_data_array, library_type=_complextype.ComplexViReal64, complex_type='numpy') # case B510 + more_data_pending_ctype = _visatype.ViBoolean(more_data_pending) # case S150 + error_code = self._library.niRFSG_WriteWaveformComplexF64(vi_ctype, waveform_name_ctype, number_of_samples_ctype, waveform_data_array_ctype, more_data_pending_ctype) + errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) + return + def close(self): # noqa: N802 vi_ctype = _visatype.ViSession(self._vi) # case S110 error_code = self._library.niRFSG_close(vi_ctype) diff --git a/generated/nirfsg/nirfsg/session.py b/generated/nirfsg/nirfsg/session.py index 508c7e3f71..b2e3f4c0b7 100644 --- a/generated/nirfsg/nirfsg/session.py +++ b/generated/nirfsg/nirfsg/session.py @@ -8014,30 +8014,6 @@ def _write_arb_waveform_complex_f32(self, waveform_name, waveform_data_array, mo raise TypeError('waveform_data_array must be numpy.ndarray of dtype=complex64, is ' + str(waveform_data_array.dtype)) self._interpreter.write_arb_waveform_complex_f32(waveform_name, waveform_data_array, more_data_pending) - @ivi_synchronized - def _write_arb_waveform_complex_f64(self, waveform_name, waveform_data_array, more_data_pending): - r'''_write_arb_waveform_complex_f64 - - TBD - - Args: - waveform_name (str): - - waveform_data_array (numpy.array(dtype=numpy.complex128)): - - more_data_pending (bool): - - ''' - import numpy - - if type(waveform_data_array) is not numpy.ndarray: - raise TypeError('waveform_data_array must be {0}, is {1}'.format(numpy.ndarray, type(waveform_data_array))) - if numpy.isfortran(waveform_data_array) is True: - raise TypeError('waveform_data_array must be in C-order') - if waveform_data_array.dtype is not numpy.dtype('complex128'): - raise TypeError('waveform_data_array must be numpy.ndarray of dtype=complex128, is ' + str(waveform_data_array.dtype)) - self._interpreter.write_arb_waveform_complex_f64(waveform_name, waveform_data_array, more_data_pending) - @ivi_synchronized def _write_arb_waveform_complex_i16(self, waveform_name, waveform_data_array, more_data_pending): r'''_write_arb_waveform_complex_i16 @@ -8062,40 +8038,6 @@ def _write_arb_waveform_complex_i16(self, waveform_name, waveform_data_array, mo raise TypeError('waveform_data_array must be numpy.ndarray of dtype=int16, is ' + str(waveform_data_array.dtype)) self._interpreter.write_arb_waveform_complex_i16(waveform_name, waveform_data_array, more_data_pending) - @ivi_synchronized - def write_arb_waveform(self, waveform_name, waveform_data_array, more_data_pending): - '''write_arb_waveform - - Writes data to the waveform in onboard memory. - - By default, subsequent calls to this method - continue writing data from the position of the last sample written. You - can set the write position and offset by calling the SetNamedWaveformNextWritePosition - SetWaveformNextWritePosition method. - - Args: - waveform_name (str): - - waveform_data_array (list of ComplexViReal64): - - more_data_pending (bool): - - ''' - if str(type(waveform_data_array)).find("'numpy.ndarray'") != -1: - import numpy - if waveform_data_array.dtype == numpy.complex128: - return self._write_arb_waveform_complex_f64(waveform_name, waveform_data_array, more_data_pending) - elif waveform_data_array.dtype == numpy.complex64: - return self._write_arb_waveform_complex_f32(waveform_name, waveform_data_array, more_data_pending) - elif waveform_data_array.dtype == numpy.int16: - return self._write_arb_waveform_complex_i16(waveform_name, waveform_data_array, more_data_pending) - else: - raise TypeError("Unsupported dtype. Is {}, expected {} or {} or {}".format(waveform_data_array.dtype, numpy.complex128, numpy.complex64, numpy.int16)) - else: - raise TypeError("Unsupported dtype. Is {}, expected {} or {} or {}".format(waveform_data_array.dtype, numpy.complex128, numpy.complex64, numpy.int16)) - - return self._write_arb_waveform_complex_f64(waveform_name, waveform_data_array, more_data_pending) - def write_p2_p_endpoint_i16(self, stream_endpoint, number_of_samples, endpoint_data): r'''write_p2_p_endpoint_i16 @@ -8148,6 +8090,64 @@ def write_script(self, script): ''' self._interpreter.write_script(script) + @ivi_synchronized + def _write_waveform_complex_f64(self, waveform_name, waveform_data_array, more_data_pending): + r'''_write_waveform_complex_f64 + + TBD + + Args: + waveform_name (str): + + waveform_data_array (numpy.array(dtype=numpy.complex128)): + + more_data_pending (bool): + + ''' + import numpy + + if type(waveform_data_array) is not numpy.ndarray: + raise TypeError('waveform_data_array must be {0}, is {1}'.format(numpy.ndarray, type(waveform_data_array))) + if numpy.isfortran(waveform_data_array) is True: + raise TypeError('waveform_data_array must be in C-order') + if waveform_data_array.dtype is not numpy.dtype('complex128'): + raise TypeError('waveform_data_array must be numpy.ndarray of dtype=complex128, is ' + str(waveform_data_array.dtype)) + self._interpreter.write_waveform_complex_f64(waveform_name, waveform_data_array, more_data_pending) + + @ivi_synchronized + def write_arb_waveform(self, waveform_name, waveform_data_array, more_data_pending): + '''write_arb_waveform + + Writes data to the waveform in onboard memory. + + By default, subsequent calls to this method + continue writing data from the position of the last sample written. You + can set the write position and offset by calling the SetNamedWaveformNextWritePosition + SetWaveformNextWritePosition method. + + Args: + waveform_name (str): + + waveform_data_array (list of ComplexViReal64): + + more_data_pending (bool): + + ''' + if str(type(waveform_data_array)).find("'numpy.ndarray'") != -1: + import numpy + if waveform_data_array.dtype == numpy.complex128: + return self._write_arb_waveform_complex_f64(waveform_name, waveform_data_array, more_data_pending) + elif waveform_data_array.dtype == numpy.complex64: + return self._write_arb_waveform_complex_f32(waveform_name, waveform_data_array, more_data_pending) + elif waveform_data_array.dtype == numpy.int16: + return self._write_arb_waveform_complex_i16(waveform_name, waveform_data_array, more_data_pending) + else: + raise TypeError("Unsupported dtype. Is {}, expected {} or {} or {}".format(waveform_data_array.dtype, numpy.complex128, numpy.complex64, numpy.int16)) + else: + raise TypeError("Unsupported dtype. Is {}, expected {} or {} or {}".format(waveform_data_array.dtype, numpy.complex128, numpy.complex64, numpy.int16)) + + return self._write_arb_waveform_complex_f64(waveform_name, waveform_data_array, more_data_pending) + def _close(self): r'''_close diff --git a/generated/nirfsg/nirfsg/unit_tests/_matchers.py b/generated/nirfsg/nirfsg/unit_tests/_matchers.py index 4a8ac9681e..7c25b56af8 100644 --- a/generated/nirfsg/nirfsg/unit_tests/_matchers.py +++ b/generated/nirfsg/nirfsg/unit_tests/_matchers.py @@ -5,6 +5,7 @@ ''' import ctypes +import nirfsg._complextype as _complextype import nirfsg._visatype as _visatype import pprint @@ -271,6 +272,25 @@ def __init__(self): _PointerMatcher.__init__(self, _visatype.ViReal64) +class ComplexViReal64PointerMatcher(_PointerMatcher): + def __init__(self, expected_data, expected_size): + _PointerMatcher.__init__(self, _complextype.ComplexViReal64) + self.expected_data = expected_data + self.expected_size = expected_size + + def __eq__(self, other): + _PointerMatcher.__eq__(self, other) + + for i in range(self.expected_size): + expected_value = self.expected_data[i] + actual_value = other[i] + if expected_value.real != actual_value.real or expected_value.imag != actual_value.imag: + return False + return True + + def __repr__(self): + return f"ComplexViReal64PointerMatcher({self.expected_data})" + # Buffers diff --git a/generated/nirfsg/nirfsg/unit_tests/_mock_helper.py b/generated/nirfsg/nirfsg/unit_tests/_mock_helper.py index fbd7e43e51..7291969680 100644 --- a/generated/nirfsg/nirfsg/unit_tests/_mock_helper.py +++ b/generated/nirfsg/nirfsg/unit_tests/_mock_helper.py @@ -233,14 +233,14 @@ def __init__(self): self._defaults['WaitUntilSettled']['return'] = 0 self._defaults['WriteArbWaveformComplexF32'] = {} self._defaults['WriteArbWaveformComplexF32']['return'] = 0 - self._defaults['WriteArbWaveformComplexF64'] = {} - self._defaults['WriteArbWaveformComplexF64']['return'] = 0 self._defaults['WriteArbWaveformComplexI16'] = {} self._defaults['WriteArbWaveformComplexI16']['return'] = 0 self._defaults['WriteP2PEndpointI16'] = {} self._defaults['WriteP2PEndpointI16']['return'] = 0 self._defaults['WriteScript'] = {} self._defaults['WriteScript']['return'] = 0 + self._defaults['WriteWaveformComplexF64'] = {} + self._defaults['WriteWaveformComplexF64']['return'] = 0 self._defaults['close'] = {} self._defaults['close']['return'] = 0 @@ -902,11 +902,6 @@ def niRFSG_WriteArbWaveformComplexF32(self, vi, waveform_name, number_of_samples return self._defaults['WriteArbWaveformComplexF32']['return'] return self._defaults['WriteArbWaveformComplexF32']['return'] - def niRFSG_WriteArbWaveformComplexF64(self, vi, waveform_name, number_of_samples, waveform_data_array, more_data_pending): # noqa: N802 - if self._defaults['WriteArbWaveformComplexF64']['return'] != 0: - return self._defaults['WriteArbWaveformComplexF64']['return'] - return self._defaults['WriteArbWaveformComplexF64']['return'] - def niRFSG_WriteArbWaveformComplexI16(self, vi, waveform_name, number_of_samples, waveform_data_array, more_data_pending): # noqa: N802 if self._defaults['WriteArbWaveformComplexI16']['return'] != 0: return self._defaults['WriteArbWaveformComplexI16']['return'] @@ -922,6 +917,11 @@ def niRFSG_WriteScript(self, vi, script): # noqa: N802 return self._defaults['WriteScript']['return'] return self._defaults['WriteScript']['return'] + def niRFSG_WriteWaveformComplexF64(self, vi, waveform_name, number_of_samples, waveform_data_array, more_data_pending): # noqa: N802 + if self._defaults['WriteWaveformComplexF64']['return'] != 0: + return self._defaults['WriteWaveformComplexF64']['return'] + return self._defaults['WriteWaveformComplexF64']['return'] + def niRFSG_close(self, vi): # noqa: N802 if self._defaults['close']['return'] != 0: return self._defaults['close']['return'] @@ -1103,13 +1103,13 @@ def set_side_effects_and_return_values(self, mock_library): mock_library.niRFSG_WaitUntilSettled.return_value = 0 mock_library.niRFSG_WriteArbWaveformComplexF32.side_effect = MockFunctionCallError("niRFSG_WriteArbWaveformComplexF32") mock_library.niRFSG_WriteArbWaveformComplexF32.return_value = 0 - mock_library.niRFSG_WriteArbWaveformComplexF64.side_effect = MockFunctionCallError("niRFSG_WriteArbWaveformComplexF64") - mock_library.niRFSG_WriteArbWaveformComplexF64.return_value = 0 mock_library.niRFSG_WriteArbWaveformComplexI16.side_effect = MockFunctionCallError("niRFSG_WriteArbWaveformComplexI16") mock_library.niRFSG_WriteArbWaveformComplexI16.return_value = 0 mock_library.niRFSG_WriteP2PEndpointI16.side_effect = MockFunctionCallError("niRFSG_WriteP2PEndpointI16") mock_library.niRFSG_WriteP2PEndpointI16.return_value = 0 mock_library.niRFSG_WriteScript.side_effect = MockFunctionCallError("niRFSG_WriteScript") mock_library.niRFSG_WriteScript.return_value = 0 + mock_library.niRFSG_WriteWaveformComplexF64.side_effect = MockFunctionCallError("niRFSG_WriteWaveformComplexF64") + mock_library.niRFSG_WriteWaveformComplexF64.return_value = 0 mock_library.niRFSG_close.side_effect = MockFunctionCallError("niRFSG_close") mock_library.niRFSG_close.return_value = 0 diff --git a/generated/niscope/niscope/unit_tests/_matchers.py b/generated/niscope/niscope/unit_tests/_matchers.py index 9f46f7d6a4..326c736cec 100644 --- a/generated/niscope/niscope/unit_tests/_matchers.py +++ b/generated/niscope/niscope/unit_tests/_matchers.py @@ -5,6 +5,7 @@ ''' import ctypes +import niscope._complextype as _complextype import niscope._visatype as _visatype import pprint @@ -271,6 +272,25 @@ def __init__(self): _PointerMatcher.__init__(self, _visatype.ViReal64) +class ComplexViReal64PointerMatcher(_PointerMatcher): + def __init__(self, expected_data, expected_size): + _PointerMatcher.__init__(self, _complextype.ComplexViReal64) + self.expected_data = expected_data + self.expected_size = expected_size + + def __eq__(self, other): + _PointerMatcher.__eq__(self, other) + + for i in range(self.expected_size): + expected_value = self.expected_data[i] + actual_value = other[i] + if expected_value.real != actual_value.real or expected_value.imag != actual_value.imag: + return False + return True + + def __repr__(self): + return f"ComplexViReal64PointerMatcher({self.expected_data})" + # Buffers diff --git a/generated/nise/nise/unit_tests/_matchers.py b/generated/nise/nise/unit_tests/_matchers.py index 696c4cb342..c59575d30e 100644 --- a/generated/nise/nise/unit_tests/_matchers.py +++ b/generated/nise/nise/unit_tests/_matchers.py @@ -5,6 +5,7 @@ ''' import ctypes +import nise._complextype as _complextype import nise._visatype as _visatype import pprint @@ -271,6 +272,25 @@ def __init__(self): _PointerMatcher.__init__(self, _visatype.ViReal64) +class ComplexViReal64PointerMatcher(_PointerMatcher): + def __init__(self, expected_data, expected_size): + _PointerMatcher.__init__(self, _complextype.ComplexViReal64) + self.expected_data = expected_data + self.expected_size = expected_size + + def __eq__(self, other): + _PointerMatcher.__eq__(self, other) + + for i in range(self.expected_size): + expected_value = self.expected_data[i] + actual_value = other[i] + if expected_value.real != actual_value.real or expected_value.imag != actual_value.imag: + return False + return True + + def __repr__(self): + return f"ComplexViReal64PointerMatcher({self.expected_data})" + # Buffers diff --git a/generated/niswitch/niswitch/unit_tests/_matchers.py b/generated/niswitch/niswitch/unit_tests/_matchers.py index 87ccdfae68..de360f8021 100644 --- a/generated/niswitch/niswitch/unit_tests/_matchers.py +++ b/generated/niswitch/niswitch/unit_tests/_matchers.py @@ -5,6 +5,7 @@ ''' import ctypes +import niswitch._complextype as _complextype import niswitch._visatype as _visatype import pprint @@ -271,6 +272,25 @@ def __init__(self): _PointerMatcher.__init__(self, _visatype.ViReal64) +class ComplexViReal64PointerMatcher(_PointerMatcher): + def __init__(self, expected_data, expected_size): + _PointerMatcher.__init__(self, _complextype.ComplexViReal64) + self.expected_data = expected_data + self.expected_size = expected_size + + def __eq__(self, other): + _PointerMatcher.__eq__(self, other) + + for i in range(self.expected_size): + expected_value = self.expected_data[i] + actual_value = other[i] + if expected_value.real != actual_value.real or expected_value.imag != actual_value.imag: + return False + return True + + def __repr__(self): + return f"ComplexViReal64PointerMatcher({self.expected_data})" + # Buffers diff --git a/generated/nitclk/nitclk/unit_tests/_matchers.py b/generated/nitclk/nitclk/unit_tests/_matchers.py index a8740388d6..3b4f49d9dd 100644 --- a/generated/nitclk/nitclk/unit_tests/_matchers.py +++ b/generated/nitclk/nitclk/unit_tests/_matchers.py @@ -5,6 +5,7 @@ ''' import ctypes +import nitclk._complextype as _complextype import nitclk._visatype as _visatype import pprint @@ -271,6 +272,25 @@ def __init__(self): _PointerMatcher.__init__(self, _visatype.ViReal64) +class ComplexViReal64PointerMatcher(_PointerMatcher): + def __init__(self, expected_data, expected_size): + _PointerMatcher.__init__(self, _complextype.ComplexViReal64) + self.expected_data = expected_data + self.expected_size = expected_size + + def __eq__(self, other): + _PointerMatcher.__eq__(self, other) + + for i in range(self.expected_size): + expected_value = self.expected_data[i] + actual_value = other[i] + if expected_value.real != actual_value.real or expected_value.imag != actual_value.imag: + return False + return True + + def __repr__(self): + return f"ComplexViReal64PointerMatcher({self.expected_data})" + # Buffers diff --git a/src/nifake/metadata/functions.py b/src/nifake/metadata/functions.py index 24d8ebd8c5..17e9924abb 100644 --- a/src/nifake/metadata/functions.py +++ b/src/nifake/metadata/functions.py @@ -377,6 +377,52 @@ 'repeated_capability_type': 'sites', 'returns': 'ViStatus' }, + 'WriteWaveformComplexF64': { + 'documentation': { + 'description': 'TBD' + }, + 'included_in_proto': False, + 'is_error_handling': False, + 'method_templates': [ + { + 'documentation_filename': 'numpy_method', + 'library_interpreter_filename': 'numpy_write_method', + 'method_python_name_suffix': '', + 'session_filename': 'numpy_write_method' + } + ], + 'parameters': [ + { + 'direction': 'in', + 'documentation': { + 'description': 'Identifies a particular instrument session.' + }, + 'name': 'vi', + 'type': 'ViSession' + }, + { + 'direction': 'in', + 'name': 'numberOfSamples', + 'type': 'ViInt32', + 'use_array': False, + 'use_in_python_api': False + }, + { + 'direction': 'in', + 'name': 'waveformDataArray', + 'numpy': True, + 'size': { + 'mechanism': 'len', + 'value': 'numberOfSamples' + }, + 'type': 'ComplexViReal64[]', + 'complex_type': 'numpy', + 'use_numpy_array': True, + 'use_in_python_api': True + }, + ], + 'returns': 'ViStatus' + }, 'GetABoolean': { 'codegen_method': 'public', 'documentation': { diff --git a/src/nifake/unit_tests/test_library_interpreter.py b/src/nifake/unit_tests/test_library_interpreter.py index 4298bcb56d..52feea74a4 100644 --- a/src/nifake/unit_tests/test_library_interpreter.py +++ b/src/nifake/unit_tests/test_library_interpreter.py @@ -36,6 +36,8 @@ def setup_method(self, method): self.side_effects_helper.set_side_effects_and_return_values(self.patched_library) self.patched_library.niFake_SetRuntimeEnvironment.side_effect = self.side_effects_helper.niFake_SetRuntimeEnvironment + self.patched_library.niFake_WriteWaveformComplexF64.side_effect = self.side_effects_helper.niFake_WriteWaveformComplexF64 + self.get_ctypes_pointer_for_buffer_side_effect_count = 0 self.get_ctypes_pointer_for_buffer_side_effect_items = [] @@ -51,7 +53,7 @@ def niFake_read_warning(self, vi, maximum_time, reading): # noqa: N802 reading.contents.value = self.reading return self.error_code_return - def get_ctypes_pointer_for_buffer_side_effect(self, value, library_type=None): + def get_ctypes_pointer_for_buffer_side_effect(self, value, library_type=None, complex_type=None): ret_val = self.get_ctypes_pointer_for_buffer_side_effect_items[self.get_ctypes_pointer_for_buffer_side_effect_count] self.get_ctypes_pointer_for_buffer_side_effect_count += 1 return ret_val @@ -843,6 +845,27 @@ def test_import_attribute_configuration_buffer_str(self): interpreter.import_attribute_configuration_buffer(configuration) self.patched_library.niFake_ImportAttributeConfigurationBuffer.assert_called_once_with(_matchers.ViSessionMatcher(SESSION_NUM_FOR_TEST), _matchers.ViInt32Matcher(len(configuration)), _matchers.ViInt8BufferMatcher(expected_list)) + def test_write_numpy_complex128_valid_input(self): + import ctypes + import numpy as np + + from nifake._complextype import ComplexViReal64 + + waveform_data = np.full(1000, 0.707 + 0.707j, dtype=np.complex128) + number_of_samples = len(waveform_data) + + complex_dtype = numpy.dtype(ComplexViReal64) + structured_array = waveform_data.view(complex_dtype) + waveform_data_pointer = structured_array.ctypes.data_as(ctypes.POINTER(ComplexViReal64)) + self.patched_library.niFake_WriteWaveformComplexF64.side_effect = self.side_effects_helper.niFake_WriteWaveformComplexF64 + interpreter = self.get_initialized_library_interpreter() + interpreter.write_waveform_complex_f64(waveform_data) + self.patched_library.niFake_WriteWaveformComplexF64.assert_called_once_with( + _matchers.ViSessionMatcher(SESSION_NUM_FOR_TEST), + _matchers.ViInt32Matcher(number_of_samples), + _matchers.ComplexViReal64PointerMatcher(waveform_data_pointer, number_of_samples) + ) + def test_matcher_prints(self): assert _matchers.ViSessionMatcher(SESSION_NUM_FOR_TEST).__repr__() == "ViSessionMatcher(" + str(nifake._visatype.ViSession) + ", 42)" assert _matchers.ViAttrMatcher(SESSION_NUM_FOR_TEST).__repr__() == "ViAttrMatcher(" + str(nifake._visatype.ViAttr) + ", 42)" diff --git a/src/nirfsg/metadata/functions.py b/src/nirfsg/metadata/functions.py index 91b130ac15..6dc53e8013 100644 --- a/src/nirfsg/metadata/functions.py +++ b/src/nirfsg/metadata/functions.py @@ -4944,7 +4944,7 @@ 'returns': 'ViStatus', 'use_session_lock': False }, - 'WriteArbWaveformDispatcher': { + 'WriteWaveformDispatcher': { 'codegen_method': 'python-only', 'documentation': { 'description': 'Writes data to the waveform in onboard memory.\n\nBy default, subsequent calls to this function\ncontinue writing data from the position of the last sample written. You\ncan set the write position and offset by calling the nirfsg_SetNamedWaveformNextWritePosition\nnirfsg_SetWaveformNextWritePosition function.' @@ -5001,7 +5001,7 @@ 'python_name': 'write_arb_waveform', 'returns': 'ViStatus' }, - 'WriteArbWaveformComplexF64': { + 'WriteWaveformComplexF64': { 'codegen_method': 'private', 'documentation': { 'description': 'TBD' From c8f4dfe7ec7877e6652b4602c30b5bce4ad2773a Mon Sep 17 00:00:00 2001 From: Rahul R Date: Wed, 14 May 2025 10:59:23 +0530 Subject: [PATCH 03/33] Implementation of f32 and i16 and respective test cases --- build/templates/_matchers.py.mako | 40 ++++++++ .../nidcpower/unit_tests/_matchers.py | 40 ++++++++ .../nidigital/unit_tests/_matchers.py | 40 ++++++++ generated/nidmm/nidmm/unit_tests/_matchers.py | 40 ++++++++ .../nifake/nifake/_grpc_stub_interpreter.py | 6 ++ generated/nifake/nifake/_library.py | 18 ++++ .../nifake/nifake/_library_interpreter.py | 16 ++++ generated/nifake/nifake/session.py | 44 ++++++++- .../nifake/nifake/unit_tests/_matchers.py | 40 ++++++++ .../nifake/nifake/unit_tests/_mock_helper.py | 18 ++++ .../unit_tests/test_library_interpreter.py | 47 ++++++++- .../nifgen/nifgen/unit_tests/_matchers.py | 40 ++++++++ .../nimodinst/unit_tests/_matchers.py | 40 ++++++++ generated/nirfsg/nirfsg/_library.py | 36 +++---- .../nirfsg/nirfsg/_library_interpreter.py | 40 ++++---- generated/nirfsg/nirfsg/session.py | 96 +++++++++---------- .../nirfsg/nirfsg/unit_tests/_matchers.py | 40 ++++++++ .../nirfsg/nirfsg/unit_tests/_mock_helper.py | 36 +++---- .../niscope/niscope/unit_tests/_matchers.py | 40 ++++++++ generated/nise/nise/unit_tests/_matchers.py | 40 ++++++++ .../niswitch/niswitch/unit_tests/_matchers.py | 40 ++++++++ .../nitclk/nitclk/unit_tests/_matchers.py | 40 ++++++++ src/nifake/metadata/functions.py | 91 ++++++++++++++++++ .../unit_tests/test_library_interpreter.py | 47 ++++++++- src/nirfsg/metadata/functions.py | 4 +- 25 files changed, 865 insertions(+), 114 deletions(-) diff --git a/build/templates/_matchers.py.mako b/build/templates/_matchers.py.mako index 5743c0b28a..da587f9379 100644 --- a/build/templates/_matchers.py.mako +++ b/build/templates/_matchers.py.mako @@ -291,6 +291,46 @@ class ComplexViReal64PointerMatcher(_PointerMatcher): def __repr__(self): return f"ComplexViReal64PointerMatcher({self.expected_data})" + +class ComplexViReal32PointerMatcher(_PointerMatcher): + def __init__(self, expected_data, expected_size): + _PointerMatcher.__init__(self, _complextype.ComplexViReal32) + self.expected_data = expected_data + self.expected_size = expected_size + + def __eq__(self, other): + _PointerMatcher.__eq__(self, other) + + for i in range(self.expected_size): + expected_value = self.expected_data[i] + actual_value = other[i] + if expected_value.real != actual_value.real or expected_value.imag != actual_value.imag: + return False + return True + + def __repr__(self): + return f"ComplexViReal32PointerMatcher({self.expected_data})" + + +class ComplexViInt16PointerMatcher(_PointerMatcher): + def __init__(self, expected_data, expected_size): + _PointerMatcher.__init__(self, _complextype.ComplexViInt16) + self.expected_data = expected_data + self.expected_size = expected_size + + def __eq__(self, other): + _PointerMatcher.__eq__(self, other) + + for i in range(self.expected_size): + expected_value = self.expected_data[i] + actual_value = other[i] + if expected_value.real != actual_value.real or expected_value.imag != actual_value.imag: + return False + return True + + def __repr__(self): + return f"ComplexViInt16PointerMatcher({self.expected_data})" + # Buffers diff --git a/generated/nidcpower/nidcpower/unit_tests/_matchers.py b/generated/nidcpower/nidcpower/unit_tests/_matchers.py index df1352b3f2..0ed854fd83 100644 --- a/generated/nidcpower/nidcpower/unit_tests/_matchers.py +++ b/generated/nidcpower/nidcpower/unit_tests/_matchers.py @@ -291,6 +291,46 @@ def __eq__(self, other): def __repr__(self): return f"ComplexViReal64PointerMatcher({self.expected_data})" + +class ComplexViReal32PointerMatcher(_PointerMatcher): + def __init__(self, expected_data, expected_size): + _PointerMatcher.__init__(self, _complextype.ComplexViReal32) + self.expected_data = expected_data + self.expected_size = expected_size + + def __eq__(self, other): + _PointerMatcher.__eq__(self, other) + + for i in range(self.expected_size): + expected_value = self.expected_data[i] + actual_value = other[i] + if expected_value.real != actual_value.real or expected_value.imag != actual_value.imag: + return False + return True + + def __repr__(self): + return f"ComplexViReal32PointerMatcher({self.expected_data})" + + +class ComplexViInt16PointerMatcher(_PointerMatcher): + def __init__(self, expected_data, expected_size): + _PointerMatcher.__init__(self, _complextype.ComplexViInt16) + self.expected_data = expected_data + self.expected_size = expected_size + + def __eq__(self, other): + _PointerMatcher.__eq__(self, other) + + for i in range(self.expected_size): + expected_value = self.expected_data[i] + actual_value = other[i] + if expected_value.real != actual_value.real or expected_value.imag != actual_value.imag: + return False + return True + + def __repr__(self): + return f"ComplexViInt16PointerMatcher({self.expected_data})" + # Buffers diff --git a/generated/nidigital/nidigital/unit_tests/_matchers.py b/generated/nidigital/nidigital/unit_tests/_matchers.py index fe06d6228a..0db630f6cb 100644 --- a/generated/nidigital/nidigital/unit_tests/_matchers.py +++ b/generated/nidigital/nidigital/unit_tests/_matchers.py @@ -291,6 +291,46 @@ def __eq__(self, other): def __repr__(self): return f"ComplexViReal64PointerMatcher({self.expected_data})" + +class ComplexViReal32PointerMatcher(_PointerMatcher): + def __init__(self, expected_data, expected_size): + _PointerMatcher.__init__(self, _complextype.ComplexViReal32) + self.expected_data = expected_data + self.expected_size = expected_size + + def __eq__(self, other): + _PointerMatcher.__eq__(self, other) + + for i in range(self.expected_size): + expected_value = self.expected_data[i] + actual_value = other[i] + if expected_value.real != actual_value.real or expected_value.imag != actual_value.imag: + return False + return True + + def __repr__(self): + return f"ComplexViReal32PointerMatcher({self.expected_data})" + + +class ComplexViInt16PointerMatcher(_PointerMatcher): + def __init__(self, expected_data, expected_size): + _PointerMatcher.__init__(self, _complextype.ComplexViInt16) + self.expected_data = expected_data + self.expected_size = expected_size + + def __eq__(self, other): + _PointerMatcher.__eq__(self, other) + + for i in range(self.expected_size): + expected_value = self.expected_data[i] + actual_value = other[i] + if expected_value.real != actual_value.real or expected_value.imag != actual_value.imag: + return False + return True + + def __repr__(self): + return f"ComplexViInt16PointerMatcher({self.expected_data})" + # Buffers diff --git a/generated/nidmm/nidmm/unit_tests/_matchers.py b/generated/nidmm/nidmm/unit_tests/_matchers.py index 34b84e075f..82d1e5f4be 100644 --- a/generated/nidmm/nidmm/unit_tests/_matchers.py +++ b/generated/nidmm/nidmm/unit_tests/_matchers.py @@ -291,6 +291,46 @@ def __eq__(self, other): def __repr__(self): return f"ComplexViReal64PointerMatcher({self.expected_data})" + +class ComplexViReal32PointerMatcher(_PointerMatcher): + def __init__(self, expected_data, expected_size): + _PointerMatcher.__init__(self, _complextype.ComplexViReal32) + self.expected_data = expected_data + self.expected_size = expected_size + + def __eq__(self, other): + _PointerMatcher.__eq__(self, other) + + for i in range(self.expected_size): + expected_value = self.expected_data[i] + actual_value = other[i] + if expected_value.real != actual_value.real or expected_value.imag != actual_value.imag: + return False + return True + + def __repr__(self): + return f"ComplexViReal32PointerMatcher({self.expected_data})" + + +class ComplexViInt16PointerMatcher(_PointerMatcher): + def __init__(self, expected_data, expected_size): + _PointerMatcher.__init__(self, _complextype.ComplexViInt16) + self.expected_data = expected_data + self.expected_size = expected_size + + def __eq__(self, other): + _PointerMatcher.__eq__(self, other) + + for i in range(self.expected_size): + expected_value = self.expected_data[i] + actual_value = other[i] + if expected_value.real != actual_value.real or expected_value.imag != actual_value.imag: + return False + return True + + def __repr__(self): + return f"ComplexViInt16PointerMatcher({self.expected_data})" + # Buffers diff --git a/generated/nifake/nifake/_grpc_stub_interpreter.py b/generated/nifake/nifake/_grpc_stub_interpreter.py index 9837998ff2..58728ea0ee 100644 --- a/generated/nifake/nifake/_grpc_stub_interpreter.py +++ b/generated/nifake/nifake/_grpc_stub_interpreter.py @@ -489,9 +489,15 @@ def write_waveform(self, waveform): # noqa: N802 def write_waveform_numpy(self, waveform): # noqa: N802 raise NotImplementedError('numpy-specific methods are not supported over gRPC') + def write_waveform_complex_f32(self, waveform_data_array): # noqa: N802 + raise NotImplementedError('numpy-specific methods are not supported over gRPC') + def write_waveform_complex_f64(self, waveform_data_array): # noqa: N802 raise NotImplementedError('numpy-specific methods are not supported over gRPC') + def write_waveform_complex_i16(self, waveform_data_array): # noqa: N802 + raise NotImplementedError('numpy-specific methods are not supported over gRPC') + def close(self): # noqa: N802 self._invoke( self._client.Close, diff --git a/generated/nifake/nifake/_library.py b/generated/nifake/nifake/_library.py index 0884dca32d..ce7ed08730 100644 --- a/generated/nifake/nifake/_library.py +++ b/generated/nifake/nifake/_library.py @@ -93,7 +93,9 @@ def __init__(self, ctypes_library): self.niFake_UnlockSession_cfunc = None self.niFake_Use64BitNumber_cfunc = None self.niFake_WriteWaveform_cfunc = None + self.niFake_WriteWaveformComplexF32_cfunc = None self.niFake_WriteWaveformComplexF64_cfunc = None + self.niFake_WriteWaveformComplexI16_cfunc = None self.niFake_close_cfunc = None self.niFake_error_message_cfunc = None self.niFake_self_test_cfunc = None @@ -641,6 +643,14 @@ def niFake_WriteWaveform(self, vi, number_of_samples, waveform): # noqa: N802 self.niFake_WriteWaveform_cfunc.restype = ViStatus # noqa: F405 return self.niFake_WriteWaveform_cfunc(vi, number_of_samples, waveform) + def niFake_WriteWaveformComplexF32(self, vi, number_of_samples, waveform_data_array): # noqa: N802 + with self._func_lock: + if self.niFake_WriteWaveformComplexF32_cfunc is None: + self.niFake_WriteWaveformComplexF32_cfunc = self._get_library_function('niFake_WriteWaveformComplexF32') + self.niFake_WriteWaveformComplexF32_cfunc.argtypes = [ViSession, ViInt32, ctypes.POINTER(ComplexViReal32)] # noqa: F405 + self.niFake_WriteWaveformComplexF32_cfunc.restype = ViStatus # noqa: F405 + return self.niFake_WriteWaveformComplexF32_cfunc(vi, number_of_samples, waveform_data_array) + def niFake_WriteWaveformComplexF64(self, vi, number_of_samples, waveform_data_array): # noqa: N802 with self._func_lock: if self.niFake_WriteWaveformComplexF64_cfunc is None: @@ -649,6 +659,14 @@ def niFake_WriteWaveformComplexF64(self, vi, number_of_samples, waveform_data_ar self.niFake_WriteWaveformComplexF64_cfunc.restype = ViStatus # noqa: F405 return self.niFake_WriteWaveformComplexF64_cfunc(vi, number_of_samples, waveform_data_array) + def niFake_WriteWaveformComplexI16(self, vi, number_of_samples, waveform_data_array): # noqa: N802 + with self._func_lock: + if self.niFake_WriteWaveformComplexI16_cfunc is None: + self.niFake_WriteWaveformComplexI16_cfunc = self._get_library_function('niFake_WriteWaveformComplexI16') + self.niFake_WriteWaveformComplexI16_cfunc.argtypes = [ViSession, ViInt32, ctypes.POINTER(ComplexViInt16)] # noqa: F405 + self.niFake_WriteWaveformComplexI16_cfunc.restype = ViStatus # noqa: F405 + return self.niFake_WriteWaveformComplexI16_cfunc(vi, number_of_samples, waveform_data_array) + def niFake_close(self, vi): # noqa: N802 with self._func_lock: if self.niFake_close_cfunc is None: diff --git a/generated/nifake/nifake/_library_interpreter.py b/generated/nifake/nifake/_library_interpreter.py index f4c51b5066..e6c9eca77d 100644 --- a/generated/nifake/nifake/_library_interpreter.py +++ b/generated/nifake/nifake/_library_interpreter.py @@ -738,6 +738,14 @@ def write_waveform_numpy(self, waveform): # noqa: N802 errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) return + def write_waveform_complex_f32(self, waveform_data_array): # noqa: N802 + vi_ctype = _visatype.ViSession(self._vi) # case S110 + number_of_samples_ctype = _visatype.ViInt32(0 if waveform_data_array is None else len(waveform_data_array)) # case S160 + waveform_data_array_ctype = _get_ctypes_pointer_for_buffer(value=waveform_data_array, library_type=_complextype.ComplexViReal32, complex_type='numpy') # case B510 + error_code = self._library.niFake_WriteWaveformComplexF32(vi_ctype, number_of_samples_ctype, waveform_data_array_ctype) + errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) + return + def write_waveform_complex_f64(self, waveform_data_array): # noqa: N802 vi_ctype = _visatype.ViSession(self._vi) # case S110 number_of_samples_ctype = _visatype.ViInt32(0 if waveform_data_array is None else len(waveform_data_array)) # case S160 @@ -746,6 +754,14 @@ def write_waveform_complex_f64(self, waveform_data_array): # noqa: N802 errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) return + def write_waveform_complex_i16(self, waveform_data_array): # noqa: N802 + vi_ctype = _visatype.ViSession(self._vi) # case S110 + number_of_samples_ctype = _visatype.ViInt32(0 if waveform_data_array is None else len(waveform_data_array) // 2) # case S160 + waveform_data_array_ctype = _get_ctypes_pointer_for_buffer(value=waveform_data_array, library_type=_complextype.ComplexViInt16, complex_type='interleaved') # case B510 + error_code = self._library.niFake_WriteWaveformComplexI16(vi_ctype, number_of_samples_ctype, waveform_data_array_ctype) + errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) + return + def close(self): # noqa: N802 vi_ctype = _visatype.ViSession(self._vi) # case S110 error_code = self._library.niFake_close(vi_ctype) diff --git a/generated/nifake/nifake/session.py b/generated/nifake/nifake/session.py index 2f43e9bc22..e2da0bc05c 100644 --- a/generated/nifake/nifake/session.py +++ b/generated/nifake/nifake/session.py @@ -1671,8 +1671,28 @@ def write_waveform_numpy(self, waveform): self._interpreter.write_waveform_numpy(waveform) @ivi_synchronized - def write_waveform_complex_f64(self, waveform_data_array): - r'''write_waveform_complex_f64 + def _write_waveform_complex_f32(self, waveform_data_array): + r'''_write_waveform_complex_f32 + + TBD + + Args: + waveform_data_array (numpy.array(dtype=numpy.complex64)): + + ''' + import numpy + + if type(waveform_data_array) is not numpy.ndarray: + raise TypeError('waveform_data_array must be {0}, is {1}'.format(numpy.ndarray, type(waveform_data_array))) + if numpy.isfortran(waveform_data_array) is True: + raise TypeError('waveform_data_array must be in C-order') + if waveform_data_array.dtype is not numpy.dtype('complex64'): + raise TypeError('waveform_data_array must be numpy.ndarray of dtype=complex64, is ' + str(waveform_data_array.dtype)) + self._interpreter.write_waveform_complex_f32(waveform_data_array) + + @ivi_synchronized + def _write_waveform_complex_f64(self, waveform_data_array): + r'''_write_waveform_complex_f64 TBD @@ -1690,6 +1710,26 @@ def write_waveform_complex_f64(self, waveform_data_array): raise TypeError('waveform_data_array must be numpy.ndarray of dtype=complex128, is ' + str(waveform_data_array.dtype)) self._interpreter.write_waveform_complex_f64(waveform_data_array) + @ivi_synchronized + def _write_waveform_complex_i16(self, waveform_data_array): + r'''_write_waveform_complex_i16 + + TBD + + Args: + waveform_data_array (numpy.array(dtype=numpy.int16)): + + ''' + import numpy + + if type(waveform_data_array) is not numpy.ndarray: + raise TypeError('waveform_data_array must be {0}, is {1}'.format(numpy.ndarray, type(waveform_data_array))) + if numpy.isfortran(waveform_data_array) is True: + raise TypeError('waveform_data_array must be in C-order') + if waveform_data_array.dtype is not numpy.dtype('int16'): + raise TypeError('waveform_data_array must be numpy.ndarray of dtype=int16, is ' + str(waveform_data_array.dtype)) + self._interpreter.write_waveform_complex_i16(waveform_data_array) + def _close(self): r'''_close diff --git a/generated/nifake/nifake/unit_tests/_matchers.py b/generated/nifake/nifake/unit_tests/_matchers.py index 2c05c3b078..751a463e93 100644 --- a/generated/nifake/nifake/unit_tests/_matchers.py +++ b/generated/nifake/nifake/unit_tests/_matchers.py @@ -291,6 +291,46 @@ def __eq__(self, other): def __repr__(self): return f"ComplexViReal64PointerMatcher({self.expected_data})" + +class ComplexViReal32PointerMatcher(_PointerMatcher): + def __init__(self, expected_data, expected_size): + _PointerMatcher.__init__(self, _complextype.ComplexViReal32) + self.expected_data = expected_data + self.expected_size = expected_size + + def __eq__(self, other): + _PointerMatcher.__eq__(self, other) + + for i in range(self.expected_size): + expected_value = self.expected_data[i] + actual_value = other[i] + if expected_value.real != actual_value.real or expected_value.imag != actual_value.imag: + return False + return True + + def __repr__(self): + return f"ComplexViReal32PointerMatcher({self.expected_data})" + + +class ComplexViInt16PointerMatcher(_PointerMatcher): + def __init__(self, expected_data, expected_size): + _PointerMatcher.__init__(self, _complextype.ComplexViInt16) + self.expected_data = expected_data + self.expected_size = expected_size + + def __eq__(self, other): + _PointerMatcher.__eq__(self, other) + + for i in range(self.expected_size): + expected_value = self.expected_data[i] + actual_value = other[i] + if expected_value.real != actual_value.real or expected_value.imag != actual_value.imag: + return False + return True + + def __repr__(self): + return f"ComplexViInt16PointerMatcher({self.expected_data})" + # Buffers diff --git a/generated/nifake/nifake/unit_tests/_mock_helper.py b/generated/nifake/nifake/unit_tests/_mock_helper.py index 599cc462a9..21dc9cd715 100644 --- a/generated/nifake/nifake/unit_tests/_mock_helper.py +++ b/generated/nifake/nifake/unit_tests/_mock_helper.py @@ -210,8 +210,12 @@ def __init__(self): self._defaults['Use64BitNumber']['output'] = None self._defaults['WriteWaveform'] = {} self._defaults['WriteWaveform']['return'] = 0 + self._defaults['WriteWaveformComplexF32'] = {} + self._defaults['WriteWaveformComplexF32']['return'] = 0 self._defaults['WriteWaveformComplexF64'] = {} self._defaults['WriteWaveformComplexF64']['return'] = 0 + self._defaults['WriteWaveformComplexI16'] = {} + self._defaults['WriteWaveformComplexI16']['return'] = 0 self._defaults['close'] = {} self._defaults['close']['return'] = 0 self._defaults['error_message'] = {} @@ -957,11 +961,21 @@ def niFake_WriteWaveform(self, vi, number_of_samples, waveform): # noqa: N802 return self._defaults['WriteWaveform']['return'] return self._defaults['WriteWaveform']['return'] + def niFake_WriteWaveformComplexF32(self, vi, number_of_samples, waveform_data_array): # noqa: N802 + if self._defaults['WriteWaveformComplexF32']['return'] != 0: + return self._defaults['WriteWaveformComplexF32']['return'] + return self._defaults['WriteWaveformComplexF32']['return'] + def niFake_WriteWaveformComplexF64(self, vi, number_of_samples, waveform_data_array): # noqa: N802 if self._defaults['WriteWaveformComplexF64']['return'] != 0: return self._defaults['WriteWaveformComplexF64']['return'] return self._defaults['WriteWaveformComplexF64']['return'] + def niFake_WriteWaveformComplexI16(self, vi, number_of_samples, waveform_data_array): # noqa: N802 + if self._defaults['WriteWaveformComplexI16']['return'] != 0: + return self._defaults['WriteWaveformComplexI16']['return'] + return self._defaults['WriteWaveformComplexI16']['return'] + def niFake_close(self, vi): # noqa: N802 if self._defaults['close']['return'] != 0: return self._defaults['close']['return'] @@ -1136,8 +1150,12 @@ def set_side_effects_and_return_values(self, mock_library): mock_library.niFake_Use64BitNumber.return_value = 0 mock_library.niFake_WriteWaveform.side_effect = MockFunctionCallError("niFake_WriteWaveform") mock_library.niFake_WriteWaveform.return_value = 0 + mock_library.niFake_WriteWaveformComplexF32.side_effect = MockFunctionCallError("niFake_WriteWaveformComplexF32") + mock_library.niFake_WriteWaveformComplexF32.return_value = 0 mock_library.niFake_WriteWaveformComplexF64.side_effect = MockFunctionCallError("niFake_WriteWaveformComplexF64") mock_library.niFake_WriteWaveformComplexF64.return_value = 0 + mock_library.niFake_WriteWaveformComplexI16.side_effect = MockFunctionCallError("niFake_WriteWaveformComplexI16") + mock_library.niFake_WriteWaveformComplexI16.return_value = 0 mock_library.niFake_close.side_effect = MockFunctionCallError("niFake_close") mock_library.niFake_close.return_value = 0 mock_library.niFake_error_message.side_effect = MockFunctionCallError("niFake_error_message") diff --git a/generated/nifake/nifake/unit_tests/test_library_interpreter.py b/generated/nifake/nifake/unit_tests/test_library_interpreter.py index 52feea74a4..adaef20efb 100644 --- a/generated/nifake/nifake/unit_tests/test_library_interpreter.py +++ b/generated/nifake/nifake/unit_tests/test_library_interpreter.py @@ -35,9 +35,6 @@ def setup_method(self, method): self.side_effects_helper = _mock_helper.SideEffectsHelper() self.side_effects_helper.set_side_effects_and_return_values(self.patched_library) self.patched_library.niFake_SetRuntimeEnvironment.side_effect = self.side_effects_helper.niFake_SetRuntimeEnvironment - - self.patched_library.niFake_WriteWaveformComplexF64.side_effect = self.side_effects_helper.niFake_WriteWaveformComplexF64 - self.get_ctypes_pointer_for_buffer_side_effect_count = 0 self.get_ctypes_pointer_for_buffer_side_effect_items = [] @@ -866,6 +863,50 @@ def test_write_numpy_complex128_valid_input(self): _matchers.ComplexViReal64PointerMatcher(waveform_data_pointer, number_of_samples) ) + def test_write_waveform_complex_f64_invalid_input(self): + import numpy as np + + invalid_waveform_data = np.full(1000, 0.707 + 0.707j, dtype=np.complex128) + expected_error_message = "Invalid waveform data provided. Expected a non-empty array of complex64." + interpreter = self.get_initialized_library_interpreter() + self.patched_library.niFake_WriteWaveformComplexF32.side_effect = ValueError("Invalid waveform data provided. Expected a non-empty array of complex64.") + with pytest.raises(ValueError) as exc_info: + interpreter.write_waveform_complex_f32(invalid_waveform_data) + + assert str(exc_info.value) == expected_error_message + + def test_write_interleaved_complexi16_invalid_input(self): + import numpy as np + + invalid_waveform_data = np.array([], dtype=np.complex64) + expected_error_message = "Invalid waveform data provided. Expected a non-empty array of Int16." + + interpreter = self.get_initialized_library_interpreter() + self.patched_library.niFake_WriteWaveformComplexI16.side_effect = ValueError("Invalid waveform data provided. Expected a non-empty array of Int16.") + with pytest.raises(ValueError) as exc_info: + interpreter.write_waveform_complex_i16(invalid_waveform_data) + assert str(exc_info.value) == expected_error_message + + def test_write_interleaved_complexi16_valid_input(self): + import ctypes + import numpy as np + + from nifake._complextype import ComplexViInt16 + + waveform_data = np.array([32767, 0] * 1000, dtype=np.int16) + number_of_samples = len(waveform_data) // 2 + complex_dtype = numpy.dtype(ComplexViInt16) + structured_array = waveform_data.view(complex_dtype) + waveform_data_pointer = structured_array.ctypes.data_as(ctypes.POINTER(ComplexViInt16)) + self.patched_library.niFake_WriteWaveformComplexI16.side_effect = self.side_effects_helper.niFake_WriteWaveformComplexI16 + interpreter = self.get_initialized_library_interpreter() + interpreter.write_waveform_complex_i16(waveform_data) + self.patched_library.niFake_WriteWaveformComplexI16.assert_called_once_with( + _matchers.ViSessionMatcher(SESSION_NUM_FOR_TEST), + _matchers.ViInt32Matcher(number_of_samples), + _matchers.ComplexViInt16PointerMatcher(waveform_data_pointer, number_of_samples) + ) + def test_matcher_prints(self): assert _matchers.ViSessionMatcher(SESSION_NUM_FOR_TEST).__repr__() == "ViSessionMatcher(" + str(nifake._visatype.ViSession) + ", 42)" assert _matchers.ViAttrMatcher(SESSION_NUM_FOR_TEST).__repr__() == "ViAttrMatcher(" + str(nifake._visatype.ViAttr) + ", 42)" diff --git a/generated/nifgen/nifgen/unit_tests/_matchers.py b/generated/nifgen/nifgen/unit_tests/_matchers.py index aeeaa1ddb1..44444cbecd 100644 --- a/generated/nifgen/nifgen/unit_tests/_matchers.py +++ b/generated/nifgen/nifgen/unit_tests/_matchers.py @@ -291,6 +291,46 @@ def __eq__(self, other): def __repr__(self): return f"ComplexViReal64PointerMatcher({self.expected_data})" + +class ComplexViReal32PointerMatcher(_PointerMatcher): + def __init__(self, expected_data, expected_size): + _PointerMatcher.__init__(self, _complextype.ComplexViReal32) + self.expected_data = expected_data + self.expected_size = expected_size + + def __eq__(self, other): + _PointerMatcher.__eq__(self, other) + + for i in range(self.expected_size): + expected_value = self.expected_data[i] + actual_value = other[i] + if expected_value.real != actual_value.real or expected_value.imag != actual_value.imag: + return False + return True + + def __repr__(self): + return f"ComplexViReal32PointerMatcher({self.expected_data})" + + +class ComplexViInt16PointerMatcher(_PointerMatcher): + def __init__(self, expected_data, expected_size): + _PointerMatcher.__init__(self, _complextype.ComplexViInt16) + self.expected_data = expected_data + self.expected_size = expected_size + + def __eq__(self, other): + _PointerMatcher.__eq__(self, other) + + for i in range(self.expected_size): + expected_value = self.expected_data[i] + actual_value = other[i] + if expected_value.real != actual_value.real or expected_value.imag != actual_value.imag: + return False + return True + + def __repr__(self): + return f"ComplexViInt16PointerMatcher({self.expected_data})" + # Buffers diff --git a/generated/nimodinst/nimodinst/unit_tests/_matchers.py b/generated/nimodinst/nimodinst/unit_tests/_matchers.py index 2e3cbcc10c..41958c8b62 100644 --- a/generated/nimodinst/nimodinst/unit_tests/_matchers.py +++ b/generated/nimodinst/nimodinst/unit_tests/_matchers.py @@ -291,6 +291,46 @@ def __eq__(self, other): def __repr__(self): return f"ComplexViReal64PointerMatcher({self.expected_data})" + +class ComplexViReal32PointerMatcher(_PointerMatcher): + def __init__(self, expected_data, expected_size): + _PointerMatcher.__init__(self, _complextype.ComplexViReal32) + self.expected_data = expected_data + self.expected_size = expected_size + + def __eq__(self, other): + _PointerMatcher.__eq__(self, other) + + for i in range(self.expected_size): + expected_value = self.expected_data[i] + actual_value = other[i] + if expected_value.real != actual_value.real or expected_value.imag != actual_value.imag: + return False + return True + + def __repr__(self): + return f"ComplexViReal32PointerMatcher({self.expected_data})" + + +class ComplexViInt16PointerMatcher(_PointerMatcher): + def __init__(self, expected_data, expected_size): + _PointerMatcher.__init__(self, _complextype.ComplexViInt16) + self.expected_data = expected_data + self.expected_size = expected_size + + def __eq__(self, other): + _PointerMatcher.__eq__(self, other) + + for i in range(self.expected_size): + expected_value = self.expected_data[i] + actual_value = other[i] + if expected_value.real != actual_value.real or expected_value.imag != actual_value.imag: + return False + return True + + def __repr__(self): + return f"ComplexViInt16PointerMatcher({self.expected_data})" + # Buffers diff --git a/generated/nirfsg/nirfsg/_library.py b/generated/nirfsg/nirfsg/_library.py index c86181de37..f40a365ffc 100644 --- a/generated/nirfsg/nirfsg/_library.py +++ b/generated/nirfsg/nirfsg/_library.py @@ -106,11 +106,11 @@ def __init__(self, ctypes_library): self.niRFSG_SetWaveformMarkerEventLocations_cfunc = None self.niRFSG_UnlockSession_cfunc = None self.niRFSG_WaitUntilSettled_cfunc = None - self.niRFSG_WriteArbWaveformComplexF32_cfunc = None - self.niRFSG_WriteArbWaveformComplexI16_cfunc = None self.niRFSG_WriteP2PEndpointI16_cfunc = None self.niRFSG_WriteScript_cfunc = None + self.niRFSG_WriteWaveformComplexF32_cfunc = None self.niRFSG_WriteWaveformComplexF64_cfunc = None + self.niRFSG_WriteWaveformComplexI16_cfunc = None self.niRFSG_close_cfunc = None def _get_library_function(self, name): @@ -808,22 +808,6 @@ def niRFSG_WaitUntilSettled(self, vi, max_time_milliseconds): # noqa: N802 self.niRFSG_WaitUntilSettled_cfunc.restype = ViStatus # noqa: F405 return self.niRFSG_WaitUntilSettled_cfunc(vi, max_time_milliseconds) - def niRFSG_WriteArbWaveformComplexF32(self, vi, waveform_name, number_of_samples, waveform_data_array, more_data_pending): # noqa: N802 - with self._func_lock: - if self.niRFSG_WriteArbWaveformComplexF32_cfunc is None: - self.niRFSG_WriteArbWaveformComplexF32_cfunc = self._get_library_function('niRFSG_WriteArbWaveformComplexF32') - self.niRFSG_WriteArbWaveformComplexF32_cfunc.argtypes = [ViSession, ctypes.POINTER(ViChar), ViInt32, ctypes.POINTER(ComplexViReal32), ViBoolean] # noqa: F405 - self.niRFSG_WriteArbWaveformComplexF32_cfunc.restype = ViStatus # noqa: F405 - return self.niRFSG_WriteArbWaveformComplexF32_cfunc(vi, waveform_name, number_of_samples, waveform_data_array, more_data_pending) - - def niRFSG_WriteArbWaveformComplexI16(self, vi, waveform_name, number_of_samples, waveform_data_array, more_data_pending): # noqa: N802 - with self._func_lock: - if self.niRFSG_WriteArbWaveformComplexI16_cfunc is None: - self.niRFSG_WriteArbWaveformComplexI16_cfunc = self._get_library_function('niRFSG_WriteArbWaveformComplexI16') - self.niRFSG_WriteArbWaveformComplexI16_cfunc.argtypes = [ViSession, ctypes.POINTER(ViChar), ViInt32, ctypes.POINTER(ComplexViInt16), ViBoolean] # noqa: F405 - self.niRFSG_WriteArbWaveformComplexI16_cfunc.restype = ViStatus # noqa: F405 - return self.niRFSG_WriteArbWaveformComplexI16_cfunc(vi, waveform_name, number_of_samples, waveform_data_array, more_data_pending) - def niRFSG_WriteP2PEndpointI16(self, vi, stream_endpoint, number_of_samples, endpoint_data): # noqa: N802 with self._func_lock: if self.niRFSG_WriteP2PEndpointI16_cfunc is None: @@ -840,6 +824,14 @@ def niRFSG_WriteScript(self, vi, script): # noqa: N802 self.niRFSG_WriteScript_cfunc.restype = ViStatus # noqa: F405 return self.niRFSG_WriteScript_cfunc(vi, script) + def niRFSG_WriteWaveformComplexF32(self, vi, waveform_name, number_of_samples, waveform_data_array, more_data_pending): # noqa: N802 + with self._func_lock: + if self.niRFSG_WriteWaveformComplexF32_cfunc is None: + self.niRFSG_WriteWaveformComplexF32_cfunc = self._get_library_function('niRFSG_WriteWaveformComplexF32') + self.niRFSG_WriteWaveformComplexF32_cfunc.argtypes = [ViSession, ctypes.POINTER(ViChar), ViInt32, ctypes.POINTER(ComplexViReal32), ViBoolean] # noqa: F405 + self.niRFSG_WriteWaveformComplexF32_cfunc.restype = ViStatus # noqa: F405 + return self.niRFSG_WriteWaveformComplexF32_cfunc(vi, waveform_name, number_of_samples, waveform_data_array, more_data_pending) + def niRFSG_WriteWaveformComplexF64(self, vi, waveform_name, number_of_samples, waveform_data_array, more_data_pending): # noqa: N802 with self._func_lock: if self.niRFSG_WriteWaveformComplexF64_cfunc is None: @@ -848,6 +840,14 @@ def niRFSG_WriteWaveformComplexF64(self, vi, waveform_name, number_of_samples, w self.niRFSG_WriteWaveformComplexF64_cfunc.restype = ViStatus # noqa: F405 return self.niRFSG_WriteWaveformComplexF64_cfunc(vi, waveform_name, number_of_samples, waveform_data_array, more_data_pending) + def niRFSG_WriteWaveformComplexI16(self, vi, waveform_name, number_of_samples, waveform_data_array, more_data_pending): # noqa: N802 + with self._func_lock: + if self.niRFSG_WriteWaveformComplexI16_cfunc is None: + self.niRFSG_WriteWaveformComplexI16_cfunc = self._get_library_function('niRFSG_WriteWaveformComplexI16') + self.niRFSG_WriteWaveformComplexI16_cfunc.argtypes = [ViSession, ctypes.POINTER(ViChar), ViInt32, ctypes.POINTER(ComplexViInt16), ViBoolean] # noqa: F405 + self.niRFSG_WriteWaveformComplexI16_cfunc.restype = ViStatus # noqa: F405 + return self.niRFSG_WriteWaveformComplexI16_cfunc(vi, waveform_name, number_of_samples, waveform_data_array, more_data_pending) + def niRFSG_close(self, vi): # noqa: N802 with self._func_lock: if self.niRFSG_close_cfunc is None: diff --git a/generated/nirfsg/nirfsg/_library_interpreter.py b/generated/nirfsg/nirfsg/_library_interpreter.py index bd02f2fb68..bc952fb416 100644 --- a/generated/nirfsg/nirfsg/_library_interpreter.py +++ b/generated/nirfsg/nirfsg/_library_interpreter.py @@ -786,26 +786,6 @@ def wait_until_settled(self, max_time_milliseconds): # noqa: N802 errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) return - def write_arb_waveform_complex_f32(self, waveform_name, waveform_data_array, more_data_pending): # noqa: N802 - vi_ctype = _visatype.ViSession(self._vi) # case S110 - waveform_name_ctype = ctypes.create_string_buffer(waveform_name.encode(self._encoding)) # case C020 - number_of_samples_ctype = _visatype.ViInt32(0 if waveform_data_array is None else len(waveform_data_array)) # case S160 - waveform_data_array_ctype = _get_ctypes_pointer_for_buffer(value=waveform_data_array, library_type=_complextype.ComplexViReal32, complex_type='numpy') # case B510 - more_data_pending_ctype = _visatype.ViBoolean(more_data_pending) # case S150 - error_code = self._library.niRFSG_WriteArbWaveformComplexF32(vi_ctype, waveform_name_ctype, number_of_samples_ctype, waveform_data_array_ctype, more_data_pending_ctype) - errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) - return - - def write_arb_waveform_complex_i16(self, waveform_name, waveform_data_array, more_data_pending): # noqa: N802 - vi_ctype = _visatype.ViSession(self._vi) # case S110 - waveform_name_ctype = ctypes.create_string_buffer(waveform_name.encode(self._encoding)) # case C020 - number_of_samples_ctype = _visatype.ViInt32(0 if waveform_data_array is None else len(waveform_data_array) // 2) # case S160 - waveform_data_array_ctype = _get_ctypes_pointer_for_buffer(value=waveform_data_array, library_type=_complextype.ComplexViInt16, complex_type='interleaved') # case B510 - more_data_pending_ctype = _visatype.ViBoolean(more_data_pending) # case S150 - error_code = self._library.niRFSG_WriteArbWaveformComplexI16(vi_ctype, waveform_name_ctype, number_of_samples_ctype, waveform_data_array_ctype, more_data_pending_ctype) - errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) - return - def write_p2_p_endpoint_i16(self, stream_endpoint, number_of_samples, endpoint_data): # noqa: N802 vi_ctype = _visatype.ViSession(self._vi) # case S110 stream_endpoint_ctype = ctypes.create_string_buffer(stream_endpoint.encode(self._encoding)) # case C020 @@ -822,6 +802,16 @@ def write_script(self, script): # noqa: N802 errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) return + def write_waveform_complex_f32(self, waveform_name, waveform_data_array, more_data_pending): # noqa: N802 + vi_ctype = _visatype.ViSession(self._vi) # case S110 + waveform_name_ctype = ctypes.create_string_buffer(waveform_name.encode(self._encoding)) # case C020 + number_of_samples_ctype = _visatype.ViInt32(0 if waveform_data_array is None else len(waveform_data_array)) # case S160 + waveform_data_array_ctype = _get_ctypes_pointer_for_buffer(value=waveform_data_array, library_type=_complextype.ComplexViReal32, complex_type='numpy') # case B510 + more_data_pending_ctype = _visatype.ViBoolean(more_data_pending) # case S150 + error_code = self._library.niRFSG_WriteWaveformComplexF32(vi_ctype, waveform_name_ctype, number_of_samples_ctype, waveform_data_array_ctype, more_data_pending_ctype) + errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) + return + def write_waveform_complex_f64(self, waveform_name, waveform_data_array, more_data_pending): # noqa: N802 vi_ctype = _visatype.ViSession(self._vi) # case S110 waveform_name_ctype = ctypes.create_string_buffer(waveform_name.encode(self._encoding)) # case C020 @@ -832,6 +822,16 @@ def write_waveform_complex_f64(self, waveform_name, waveform_data_array, more_da errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) return + def write_waveform_complex_i16(self, waveform_name, waveform_data_array, more_data_pending): # noqa: N802 + vi_ctype = _visatype.ViSession(self._vi) # case S110 + waveform_name_ctype = ctypes.create_string_buffer(waveform_name.encode(self._encoding)) # case C020 + number_of_samples_ctype = _visatype.ViInt32(0 if waveform_data_array is None else len(waveform_data_array) // 2) # case S160 + waveform_data_array_ctype = _get_ctypes_pointer_for_buffer(value=waveform_data_array, library_type=_complextype.ComplexViInt16, complex_type='interleaved') # case B510 + more_data_pending_ctype = _visatype.ViBoolean(more_data_pending) # case S150 + error_code = self._library.niRFSG_WriteWaveformComplexI16(vi_ctype, waveform_name_ctype, number_of_samples_ctype, waveform_data_array_ctype, more_data_pending_ctype) + errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) + return + def close(self): # noqa: N802 vi_ctype = _visatype.ViSession(self._vi) # case S110 error_code = self._library.niRFSG_close(vi_ctype) diff --git a/generated/nirfsg/nirfsg/session.py b/generated/nirfsg/nirfsg/session.py index b2e3f4c0b7..aa097a0ab6 100644 --- a/generated/nirfsg/nirfsg/session.py +++ b/generated/nirfsg/nirfsg/session.py @@ -7990,54 +7990,6 @@ def wait_until_settled(self, max_time_milliseconds): ''' self._interpreter.wait_until_settled(max_time_milliseconds) - @ivi_synchronized - def _write_arb_waveform_complex_f32(self, waveform_name, waveform_data_array, more_data_pending): - r'''_write_arb_waveform_complex_f32 - - TBD - - Args: - waveform_name (str): - - waveform_data_array (numpy.array(dtype=numpy.complex64)): - - more_data_pending (bool): - - ''' - import numpy - - if type(waveform_data_array) is not numpy.ndarray: - raise TypeError('waveform_data_array must be {0}, is {1}'.format(numpy.ndarray, type(waveform_data_array))) - if numpy.isfortran(waveform_data_array) is True: - raise TypeError('waveform_data_array must be in C-order') - if waveform_data_array.dtype is not numpy.dtype('complex64'): - raise TypeError('waveform_data_array must be numpy.ndarray of dtype=complex64, is ' + str(waveform_data_array.dtype)) - self._interpreter.write_arb_waveform_complex_f32(waveform_name, waveform_data_array, more_data_pending) - - @ivi_synchronized - def _write_arb_waveform_complex_i16(self, waveform_name, waveform_data_array, more_data_pending): - r'''_write_arb_waveform_complex_i16 - - TBD - - Args: - waveform_name (str): - - waveform_data_array (numpy.array(dtype=numpy.int16)): - - more_data_pending (bool): - - ''' - import numpy - - if type(waveform_data_array) is not numpy.ndarray: - raise TypeError('waveform_data_array must be {0}, is {1}'.format(numpy.ndarray, type(waveform_data_array))) - if numpy.isfortran(waveform_data_array) is True: - raise TypeError('waveform_data_array must be in C-order') - if waveform_data_array.dtype is not numpy.dtype('int16'): - raise TypeError('waveform_data_array must be numpy.ndarray of dtype=int16, is ' + str(waveform_data_array.dtype)) - self._interpreter.write_arb_waveform_complex_i16(waveform_name, waveform_data_array, more_data_pending) - def write_p2_p_endpoint_i16(self, stream_endpoint, number_of_samples, endpoint_data): r'''write_p2_p_endpoint_i16 @@ -8090,6 +8042,30 @@ def write_script(self, script): ''' self._interpreter.write_script(script) + @ivi_synchronized + def _write_waveform_complex_f32(self, waveform_name, waveform_data_array, more_data_pending): + r'''_write_waveform_complex_f32 + + TBD + + Args: + waveform_name (str): + + waveform_data_array (numpy.array(dtype=numpy.complex64)): + + more_data_pending (bool): + + ''' + import numpy + + if type(waveform_data_array) is not numpy.ndarray: + raise TypeError('waveform_data_array must be {0}, is {1}'.format(numpy.ndarray, type(waveform_data_array))) + if numpy.isfortran(waveform_data_array) is True: + raise TypeError('waveform_data_array must be in C-order') + if waveform_data_array.dtype is not numpy.dtype('complex64'): + raise TypeError('waveform_data_array must be numpy.ndarray of dtype=complex64, is ' + str(waveform_data_array.dtype)) + self._interpreter.write_waveform_complex_f32(waveform_name, waveform_data_array, more_data_pending) + @ivi_synchronized def _write_waveform_complex_f64(self, waveform_name, waveform_data_array, more_data_pending): r'''_write_waveform_complex_f64 @@ -8114,6 +8090,30 @@ def _write_waveform_complex_f64(self, waveform_name, waveform_data_array, more_d raise TypeError('waveform_data_array must be numpy.ndarray of dtype=complex128, is ' + str(waveform_data_array.dtype)) self._interpreter.write_waveform_complex_f64(waveform_name, waveform_data_array, more_data_pending) + @ivi_synchronized + def _write_waveform_complex_i16(self, waveform_name, waveform_data_array, more_data_pending): + r'''_write_waveform_complex_i16 + + TBD + + Args: + waveform_name (str): + + waveform_data_array (numpy.array(dtype=numpy.int16)): + + more_data_pending (bool): + + ''' + import numpy + + if type(waveform_data_array) is not numpy.ndarray: + raise TypeError('waveform_data_array must be {0}, is {1}'.format(numpy.ndarray, type(waveform_data_array))) + if numpy.isfortran(waveform_data_array) is True: + raise TypeError('waveform_data_array must be in C-order') + if waveform_data_array.dtype is not numpy.dtype('int16'): + raise TypeError('waveform_data_array must be numpy.ndarray of dtype=int16, is ' + str(waveform_data_array.dtype)) + self._interpreter.write_waveform_complex_i16(waveform_name, waveform_data_array, more_data_pending) + @ivi_synchronized def write_arb_waveform(self, waveform_name, waveform_data_array, more_data_pending): '''write_arb_waveform diff --git a/generated/nirfsg/nirfsg/unit_tests/_matchers.py b/generated/nirfsg/nirfsg/unit_tests/_matchers.py index 7c25b56af8..73aa445f06 100644 --- a/generated/nirfsg/nirfsg/unit_tests/_matchers.py +++ b/generated/nirfsg/nirfsg/unit_tests/_matchers.py @@ -291,6 +291,46 @@ def __eq__(self, other): def __repr__(self): return f"ComplexViReal64PointerMatcher({self.expected_data})" + +class ComplexViReal32PointerMatcher(_PointerMatcher): + def __init__(self, expected_data, expected_size): + _PointerMatcher.__init__(self, _complextype.ComplexViReal32) + self.expected_data = expected_data + self.expected_size = expected_size + + def __eq__(self, other): + _PointerMatcher.__eq__(self, other) + + for i in range(self.expected_size): + expected_value = self.expected_data[i] + actual_value = other[i] + if expected_value.real != actual_value.real or expected_value.imag != actual_value.imag: + return False + return True + + def __repr__(self): + return f"ComplexViReal32PointerMatcher({self.expected_data})" + + +class ComplexViInt16PointerMatcher(_PointerMatcher): + def __init__(self, expected_data, expected_size): + _PointerMatcher.__init__(self, _complextype.ComplexViInt16) + self.expected_data = expected_data + self.expected_size = expected_size + + def __eq__(self, other): + _PointerMatcher.__eq__(self, other) + + for i in range(self.expected_size): + expected_value = self.expected_data[i] + actual_value = other[i] + if expected_value.real != actual_value.real or expected_value.imag != actual_value.imag: + return False + return True + + def __repr__(self): + return f"ComplexViInt16PointerMatcher({self.expected_data})" + # Buffers diff --git a/generated/nirfsg/nirfsg/unit_tests/_mock_helper.py b/generated/nirfsg/nirfsg/unit_tests/_mock_helper.py index 7291969680..465a9b7295 100644 --- a/generated/nirfsg/nirfsg/unit_tests/_mock_helper.py +++ b/generated/nirfsg/nirfsg/unit_tests/_mock_helper.py @@ -231,16 +231,16 @@ def __init__(self): self._defaults['UnlockSession']['callerHasLock'] = None self._defaults['WaitUntilSettled'] = {} self._defaults['WaitUntilSettled']['return'] = 0 - self._defaults['WriteArbWaveformComplexF32'] = {} - self._defaults['WriteArbWaveformComplexF32']['return'] = 0 - self._defaults['WriteArbWaveformComplexI16'] = {} - self._defaults['WriteArbWaveformComplexI16']['return'] = 0 self._defaults['WriteP2PEndpointI16'] = {} self._defaults['WriteP2PEndpointI16']['return'] = 0 self._defaults['WriteScript'] = {} self._defaults['WriteScript']['return'] = 0 + self._defaults['WriteWaveformComplexF32'] = {} + self._defaults['WriteWaveformComplexF32']['return'] = 0 self._defaults['WriteWaveformComplexF64'] = {} self._defaults['WriteWaveformComplexF64']['return'] = 0 + self._defaults['WriteWaveformComplexI16'] = {} + self._defaults['WriteWaveformComplexI16']['return'] = 0 self._defaults['close'] = {} self._defaults['close']['return'] = 0 @@ -897,16 +897,6 @@ def niRFSG_WaitUntilSettled(self, vi, max_time_milliseconds): # noqa: N802 return self._defaults['WaitUntilSettled']['return'] return self._defaults['WaitUntilSettled']['return'] - def niRFSG_WriteArbWaveformComplexF32(self, vi, waveform_name, number_of_samples, waveform_data_array, more_data_pending): # noqa: N802 - if self._defaults['WriteArbWaveformComplexF32']['return'] != 0: - return self._defaults['WriteArbWaveformComplexF32']['return'] - return self._defaults['WriteArbWaveformComplexF32']['return'] - - def niRFSG_WriteArbWaveformComplexI16(self, vi, waveform_name, number_of_samples, waveform_data_array, more_data_pending): # noqa: N802 - if self._defaults['WriteArbWaveformComplexI16']['return'] != 0: - return self._defaults['WriteArbWaveformComplexI16']['return'] - return self._defaults['WriteArbWaveformComplexI16']['return'] - def niRFSG_WriteP2PEndpointI16(self, vi, stream_endpoint, number_of_samples, endpoint_data): # noqa: N802 if self._defaults['WriteP2PEndpointI16']['return'] != 0: return self._defaults['WriteP2PEndpointI16']['return'] @@ -917,11 +907,21 @@ def niRFSG_WriteScript(self, vi, script): # noqa: N802 return self._defaults['WriteScript']['return'] return self._defaults['WriteScript']['return'] + def niRFSG_WriteWaveformComplexF32(self, vi, waveform_name, number_of_samples, waveform_data_array, more_data_pending): # noqa: N802 + if self._defaults['WriteWaveformComplexF32']['return'] != 0: + return self._defaults['WriteWaveformComplexF32']['return'] + return self._defaults['WriteWaveformComplexF32']['return'] + def niRFSG_WriteWaveformComplexF64(self, vi, waveform_name, number_of_samples, waveform_data_array, more_data_pending): # noqa: N802 if self._defaults['WriteWaveformComplexF64']['return'] != 0: return self._defaults['WriteWaveformComplexF64']['return'] return self._defaults['WriteWaveformComplexF64']['return'] + def niRFSG_WriteWaveformComplexI16(self, vi, waveform_name, number_of_samples, waveform_data_array, more_data_pending): # noqa: N802 + if self._defaults['WriteWaveformComplexI16']['return'] != 0: + return self._defaults['WriteWaveformComplexI16']['return'] + return self._defaults['WriteWaveformComplexI16']['return'] + def niRFSG_close(self, vi): # noqa: N802 if self._defaults['close']['return'] != 0: return self._defaults['close']['return'] @@ -1101,15 +1101,15 @@ def set_side_effects_and_return_values(self, mock_library): mock_library.niRFSG_UnlockSession.return_value = 0 mock_library.niRFSG_WaitUntilSettled.side_effect = MockFunctionCallError("niRFSG_WaitUntilSettled") mock_library.niRFSG_WaitUntilSettled.return_value = 0 - mock_library.niRFSG_WriteArbWaveformComplexF32.side_effect = MockFunctionCallError("niRFSG_WriteArbWaveformComplexF32") - mock_library.niRFSG_WriteArbWaveformComplexF32.return_value = 0 - mock_library.niRFSG_WriteArbWaveformComplexI16.side_effect = MockFunctionCallError("niRFSG_WriteArbWaveformComplexI16") - mock_library.niRFSG_WriteArbWaveformComplexI16.return_value = 0 mock_library.niRFSG_WriteP2PEndpointI16.side_effect = MockFunctionCallError("niRFSG_WriteP2PEndpointI16") mock_library.niRFSG_WriteP2PEndpointI16.return_value = 0 mock_library.niRFSG_WriteScript.side_effect = MockFunctionCallError("niRFSG_WriteScript") mock_library.niRFSG_WriteScript.return_value = 0 + mock_library.niRFSG_WriteWaveformComplexF32.side_effect = MockFunctionCallError("niRFSG_WriteWaveformComplexF32") + mock_library.niRFSG_WriteWaveformComplexF32.return_value = 0 mock_library.niRFSG_WriteWaveformComplexF64.side_effect = MockFunctionCallError("niRFSG_WriteWaveformComplexF64") mock_library.niRFSG_WriteWaveformComplexF64.return_value = 0 + mock_library.niRFSG_WriteWaveformComplexI16.side_effect = MockFunctionCallError("niRFSG_WriteWaveformComplexI16") + mock_library.niRFSG_WriteWaveformComplexI16.return_value = 0 mock_library.niRFSG_close.side_effect = MockFunctionCallError("niRFSG_close") mock_library.niRFSG_close.return_value = 0 diff --git a/generated/niscope/niscope/unit_tests/_matchers.py b/generated/niscope/niscope/unit_tests/_matchers.py index 326c736cec..26bacb7c5d 100644 --- a/generated/niscope/niscope/unit_tests/_matchers.py +++ b/generated/niscope/niscope/unit_tests/_matchers.py @@ -291,6 +291,46 @@ def __eq__(self, other): def __repr__(self): return f"ComplexViReal64PointerMatcher({self.expected_data})" + +class ComplexViReal32PointerMatcher(_PointerMatcher): + def __init__(self, expected_data, expected_size): + _PointerMatcher.__init__(self, _complextype.ComplexViReal32) + self.expected_data = expected_data + self.expected_size = expected_size + + def __eq__(self, other): + _PointerMatcher.__eq__(self, other) + + for i in range(self.expected_size): + expected_value = self.expected_data[i] + actual_value = other[i] + if expected_value.real != actual_value.real or expected_value.imag != actual_value.imag: + return False + return True + + def __repr__(self): + return f"ComplexViReal32PointerMatcher({self.expected_data})" + + +class ComplexViInt16PointerMatcher(_PointerMatcher): + def __init__(self, expected_data, expected_size): + _PointerMatcher.__init__(self, _complextype.ComplexViInt16) + self.expected_data = expected_data + self.expected_size = expected_size + + def __eq__(self, other): + _PointerMatcher.__eq__(self, other) + + for i in range(self.expected_size): + expected_value = self.expected_data[i] + actual_value = other[i] + if expected_value.real != actual_value.real or expected_value.imag != actual_value.imag: + return False + return True + + def __repr__(self): + return f"ComplexViInt16PointerMatcher({self.expected_data})" + # Buffers diff --git a/generated/nise/nise/unit_tests/_matchers.py b/generated/nise/nise/unit_tests/_matchers.py index c59575d30e..e0ba4d41c2 100644 --- a/generated/nise/nise/unit_tests/_matchers.py +++ b/generated/nise/nise/unit_tests/_matchers.py @@ -291,6 +291,46 @@ def __eq__(self, other): def __repr__(self): return f"ComplexViReal64PointerMatcher({self.expected_data})" + +class ComplexViReal32PointerMatcher(_PointerMatcher): + def __init__(self, expected_data, expected_size): + _PointerMatcher.__init__(self, _complextype.ComplexViReal32) + self.expected_data = expected_data + self.expected_size = expected_size + + def __eq__(self, other): + _PointerMatcher.__eq__(self, other) + + for i in range(self.expected_size): + expected_value = self.expected_data[i] + actual_value = other[i] + if expected_value.real != actual_value.real or expected_value.imag != actual_value.imag: + return False + return True + + def __repr__(self): + return f"ComplexViReal32PointerMatcher({self.expected_data})" + + +class ComplexViInt16PointerMatcher(_PointerMatcher): + def __init__(self, expected_data, expected_size): + _PointerMatcher.__init__(self, _complextype.ComplexViInt16) + self.expected_data = expected_data + self.expected_size = expected_size + + def __eq__(self, other): + _PointerMatcher.__eq__(self, other) + + for i in range(self.expected_size): + expected_value = self.expected_data[i] + actual_value = other[i] + if expected_value.real != actual_value.real or expected_value.imag != actual_value.imag: + return False + return True + + def __repr__(self): + return f"ComplexViInt16PointerMatcher({self.expected_data})" + # Buffers diff --git a/generated/niswitch/niswitch/unit_tests/_matchers.py b/generated/niswitch/niswitch/unit_tests/_matchers.py index de360f8021..d8d076538e 100644 --- a/generated/niswitch/niswitch/unit_tests/_matchers.py +++ b/generated/niswitch/niswitch/unit_tests/_matchers.py @@ -291,6 +291,46 @@ def __eq__(self, other): def __repr__(self): return f"ComplexViReal64PointerMatcher({self.expected_data})" + +class ComplexViReal32PointerMatcher(_PointerMatcher): + def __init__(self, expected_data, expected_size): + _PointerMatcher.__init__(self, _complextype.ComplexViReal32) + self.expected_data = expected_data + self.expected_size = expected_size + + def __eq__(self, other): + _PointerMatcher.__eq__(self, other) + + for i in range(self.expected_size): + expected_value = self.expected_data[i] + actual_value = other[i] + if expected_value.real != actual_value.real or expected_value.imag != actual_value.imag: + return False + return True + + def __repr__(self): + return f"ComplexViReal32PointerMatcher({self.expected_data})" + + +class ComplexViInt16PointerMatcher(_PointerMatcher): + def __init__(self, expected_data, expected_size): + _PointerMatcher.__init__(self, _complextype.ComplexViInt16) + self.expected_data = expected_data + self.expected_size = expected_size + + def __eq__(self, other): + _PointerMatcher.__eq__(self, other) + + for i in range(self.expected_size): + expected_value = self.expected_data[i] + actual_value = other[i] + if expected_value.real != actual_value.real or expected_value.imag != actual_value.imag: + return False + return True + + def __repr__(self): + return f"ComplexViInt16PointerMatcher({self.expected_data})" + # Buffers diff --git a/generated/nitclk/nitclk/unit_tests/_matchers.py b/generated/nitclk/nitclk/unit_tests/_matchers.py index 3b4f49d9dd..359749fec4 100644 --- a/generated/nitclk/nitclk/unit_tests/_matchers.py +++ b/generated/nitclk/nitclk/unit_tests/_matchers.py @@ -291,6 +291,46 @@ def __eq__(self, other): def __repr__(self): return f"ComplexViReal64PointerMatcher({self.expected_data})" + +class ComplexViReal32PointerMatcher(_PointerMatcher): + def __init__(self, expected_data, expected_size): + _PointerMatcher.__init__(self, _complextype.ComplexViReal32) + self.expected_data = expected_data + self.expected_size = expected_size + + def __eq__(self, other): + _PointerMatcher.__eq__(self, other) + + for i in range(self.expected_size): + expected_value = self.expected_data[i] + actual_value = other[i] + if expected_value.real != actual_value.real or expected_value.imag != actual_value.imag: + return False + return True + + def __repr__(self): + return f"ComplexViReal32PointerMatcher({self.expected_data})" + + +class ComplexViInt16PointerMatcher(_PointerMatcher): + def __init__(self, expected_data, expected_size): + _PointerMatcher.__init__(self, _complextype.ComplexViInt16) + self.expected_data = expected_data + self.expected_size = expected_size + + def __eq__(self, other): + _PointerMatcher.__eq__(self, other) + + for i in range(self.expected_size): + expected_value = self.expected_data[i] + actual_value = other[i] + if expected_value.real != actual_value.real or expected_value.imag != actual_value.imag: + return False + return True + + def __repr__(self): + return f"ComplexViInt16PointerMatcher({self.expected_data})" + # Buffers diff --git a/src/nifake/metadata/functions.py b/src/nifake/metadata/functions.py index 17e9924abb..c15a7c1de7 100644 --- a/src/nifake/metadata/functions.py +++ b/src/nifake/metadata/functions.py @@ -378,6 +378,7 @@ 'returns': 'ViStatus' }, 'WriteWaveformComplexF64': { + 'codegen_method': 'private', 'documentation': { 'description': 'TBD' }, @@ -423,6 +424,96 @@ ], 'returns': 'ViStatus' }, + 'WriteWaveformComplexI16': { + 'codegen_method': 'private', + 'documentation': { + 'description': 'TBD' + }, + 'included_in_proto': False, + 'is_error_handling': False, + 'method_templates': [ + { + 'documentation_filename': 'numpy_method', + 'library_interpreter_filename': 'numpy_write_method', + 'method_python_name_suffix': '', + 'session_filename': 'numpy_write_method' + } + ], + 'parameters': [ + { + 'direction': 'in', + 'name': 'vi', + 'type': 'ViSession', + }, + { + 'direction': 'in', + 'name': 'numberOfSamples', + 'type': 'ViInt32', + 'use_array': False, + 'use_in_python_api': False + }, + { + 'direction': 'in', + 'name': 'waveformDataArray', + 'numpy': True, + 'size': { + 'mechanism': 'len', + 'value': 'numberOfSamples' + }, + 'type': 'ComplexViInt16[]', + 'use_numpy_array': True, + 'complex_type': 'interleaved', + 'use_in_python_api': True + } + ], + 'returns': 'ViStatus', + }, + 'WriteWaveformComplexF32': { + 'codegen_method': 'private', + 'documentation': { + 'description': 'TBD' + }, + 'included_in_proto': False, + 'is_error_handling': False, + 'method_templates': [ + { + 'documentation_filename': 'numpy_method', + 'library_interpreter_filename': 'numpy_write_method', + 'method_python_name_suffix': '', + 'session_filename': 'numpy_write_method' + } + ], + 'parameters': [ + { + 'direction': 'in', + 'name': 'vi', + 'type': 'ViSession', + 'use_array': False, + 'use_in_python_api': True + }, + { + 'direction': 'in', + 'name': 'numberOfSamples', + 'type': 'ViInt32', + 'use_array': False, + 'use_in_python_api': False + }, + { + 'direction': 'in', + 'name': 'waveformDataArray', + 'numpy': True, + 'size': { + 'mechanism': 'len', + 'value': 'numberOfSamples' + }, + 'type': 'ComplexViReal32[]', + 'complex_type': 'numpy', + 'use_numpy_array': True, + 'use_in_python_api': True + } + ], + 'returns': 'ViStatus', + }, 'GetABoolean': { 'codegen_method': 'public', 'documentation': { diff --git a/src/nifake/unit_tests/test_library_interpreter.py b/src/nifake/unit_tests/test_library_interpreter.py index 52feea74a4..adaef20efb 100644 --- a/src/nifake/unit_tests/test_library_interpreter.py +++ b/src/nifake/unit_tests/test_library_interpreter.py @@ -35,9 +35,6 @@ def setup_method(self, method): self.side_effects_helper = _mock_helper.SideEffectsHelper() self.side_effects_helper.set_side_effects_and_return_values(self.patched_library) self.patched_library.niFake_SetRuntimeEnvironment.side_effect = self.side_effects_helper.niFake_SetRuntimeEnvironment - - self.patched_library.niFake_WriteWaveformComplexF64.side_effect = self.side_effects_helper.niFake_WriteWaveformComplexF64 - self.get_ctypes_pointer_for_buffer_side_effect_count = 0 self.get_ctypes_pointer_for_buffer_side_effect_items = [] @@ -866,6 +863,50 @@ def test_write_numpy_complex128_valid_input(self): _matchers.ComplexViReal64PointerMatcher(waveform_data_pointer, number_of_samples) ) + def test_write_waveform_complex_f64_invalid_input(self): + import numpy as np + + invalid_waveform_data = np.full(1000, 0.707 + 0.707j, dtype=np.complex128) + expected_error_message = "Invalid waveform data provided. Expected a non-empty array of complex64." + interpreter = self.get_initialized_library_interpreter() + self.patched_library.niFake_WriteWaveformComplexF32.side_effect = ValueError("Invalid waveform data provided. Expected a non-empty array of complex64.") + with pytest.raises(ValueError) as exc_info: + interpreter.write_waveform_complex_f32(invalid_waveform_data) + + assert str(exc_info.value) == expected_error_message + + def test_write_interleaved_complexi16_invalid_input(self): + import numpy as np + + invalid_waveform_data = np.array([], dtype=np.complex64) + expected_error_message = "Invalid waveform data provided. Expected a non-empty array of Int16." + + interpreter = self.get_initialized_library_interpreter() + self.patched_library.niFake_WriteWaveformComplexI16.side_effect = ValueError("Invalid waveform data provided. Expected a non-empty array of Int16.") + with pytest.raises(ValueError) as exc_info: + interpreter.write_waveform_complex_i16(invalid_waveform_data) + assert str(exc_info.value) == expected_error_message + + def test_write_interleaved_complexi16_valid_input(self): + import ctypes + import numpy as np + + from nifake._complextype import ComplexViInt16 + + waveform_data = np.array([32767, 0] * 1000, dtype=np.int16) + number_of_samples = len(waveform_data) // 2 + complex_dtype = numpy.dtype(ComplexViInt16) + structured_array = waveform_data.view(complex_dtype) + waveform_data_pointer = structured_array.ctypes.data_as(ctypes.POINTER(ComplexViInt16)) + self.patched_library.niFake_WriteWaveformComplexI16.side_effect = self.side_effects_helper.niFake_WriteWaveformComplexI16 + interpreter = self.get_initialized_library_interpreter() + interpreter.write_waveform_complex_i16(waveform_data) + self.patched_library.niFake_WriteWaveformComplexI16.assert_called_once_with( + _matchers.ViSessionMatcher(SESSION_NUM_FOR_TEST), + _matchers.ViInt32Matcher(number_of_samples), + _matchers.ComplexViInt16PointerMatcher(waveform_data_pointer, number_of_samples) + ) + def test_matcher_prints(self): assert _matchers.ViSessionMatcher(SESSION_NUM_FOR_TEST).__repr__() == "ViSessionMatcher(" + str(nifake._visatype.ViSession) + ", 42)" assert _matchers.ViAttrMatcher(SESSION_NUM_FOR_TEST).__repr__() == "ViAttrMatcher(" + str(nifake._visatype.ViAttr) + ", 42)" diff --git a/src/nirfsg/metadata/functions.py b/src/nirfsg/metadata/functions.py index 6dc53e8013..25c0791be8 100644 --- a/src/nirfsg/metadata/functions.py +++ b/src/nirfsg/metadata/functions.py @@ -5063,7 +5063,7 @@ 'returns': 'ViStatus', 'use_session_lock': True }, - 'WriteArbWaveformComplexI16': { + 'WriteWaveformComplexI16': { 'codegen_method': 'private', 'documentation': { 'description': 'TBD' @@ -5125,7 +5125,7 @@ 'returns': 'ViStatus', 'use_session_lock': True }, - 'WriteArbWaveformComplexF32': { + 'WriteWaveformComplexF32': { 'codegen_method': 'private', 'documentation': { 'description': 'TBD' From aaf9386da56aef72f7d576da7eec8935fab26cd0 Mon Sep 17 00:00:00 2001 From: Rahul R Date: Thu, 15 May 2025 12:47:29 +0530 Subject: [PATCH 04/33] Updated changelog and included examples --- docs/nirfsg/examples.rst | 18 ++++++++++++++++++ generated/nifake/nifake/session.py | 6 +++--- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/docs/nirfsg/examples.rst b/docs/nirfsg/examples.rst index aeaca2c243..3202debb57 100644 --- a/docs/nirfsg/examples.rst +++ b/docs/nirfsg/examples.rst @@ -3,6 +3,15 @@ Examples `You can download all nirfsg examples here `_ +nirfsg_arb_waveform.py +---------------------- + +.. literalinclude:: ../../src/nirfsg/examples/nirfsg_arb_waveform.py + :language: python + :linenos: + :encoding: utf8 + :caption: `(nirfsg_arb_waveform.py) `_ + nirfsg_cw.py ------------ @@ -12,3 +21,12 @@ nirfsg_cw.py :encoding: utf8 :caption: `(nirfsg_cw.py) `_ +nirfsg_script.py +---------------- + +.. literalinclude:: ../../src/nirfsg/examples/nirfsg_script.py + :language: python + :linenos: + :encoding: utf8 + :caption: `(nirfsg_script.py) `_ + diff --git a/generated/nifake/nifake/session.py b/generated/nifake/nifake/session.py index e2da0bc05c..d13d8e1eca 100644 --- a/generated/nifake/nifake/session.py +++ b/generated/nifake/nifake/session.py @@ -1674,7 +1674,7 @@ def write_waveform_numpy(self, waveform): def _write_waveform_complex_f32(self, waveform_data_array): r'''_write_waveform_complex_f32 - TBD + A method that writes a waveform of complex64 numbers. Args: waveform_data_array (numpy.array(dtype=numpy.complex64)): @@ -1694,7 +1694,7 @@ def _write_waveform_complex_f32(self, waveform_data_array): def _write_waveform_complex_f64(self, waveform_data_array): r'''_write_waveform_complex_f64 - TBD + A method that writes a waveform of complex128 numbers. Args: waveform_data_array (numpy.array(dtype=numpy.complex128)): @@ -1714,7 +1714,7 @@ def _write_waveform_complex_f64(self, waveform_data_array): def _write_waveform_complex_i16(self, waveform_data_array): r'''_write_waveform_complex_i16 - TBD + A method that writes a waveform of i16 numbers. Args: waveform_data_array (numpy.array(dtype=numpy.int16)): From 599c0dfd4a4dc92e791edc20fca1dd6ba5518ac9 Mon Sep 17 00:00:00 2001 From: Rahul R Date: Thu, 15 May 2025 12:48:00 +0530 Subject: [PATCH 05/33] Updated the metadata --- CHANGELOG.md | 14 +- build/helper/codegen_helper.py | 1 - docs/nirfsg/class.rst | 25 +- generated/nirfsg/nirfsg/session.py | 103 +- src/nifake/metadata/functions.py | 34 +- src/nirfsg/examples/nirfsg_arb_waveform.py | 46 + src/nirfsg/examples/nirfsg_script.py | 54 + src/nirfsg/metadata/functions.py | 78 +- tox_report.log | 2137 ++++++++++++++++++++ 9 files changed, 2450 insertions(+), 42 deletions(-) create mode 100644 src/nirfsg/examples/nirfsg_arb_waveform.py create mode 100644 src/nirfsg/examples/nirfsg_script.py create mode 100644 tox_report.log diff --git a/CHANGELOG.md b/CHANGELOG.md index c3563df429..f89e0e442c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -49,6 +49,7 @@ #### [nidcpower] Unreleased - Added + - (Common) All functions should have parameters that take in numpy.complex types. - Changed - Removed @@ -522,6 +523,7 @@ #### [nidigital] Unreleased - Added + - (Common) All functions should have parameters that take in numpy.complex types. - Changed - Removed @@ -755,6 +757,7 @@ #### [nidmm] Unreleased - Added + - (Common) All functions should have parameters that take in numpy.complex types. - Changed - Removed @@ -1070,6 +1073,7 @@ #### [nifgen] Unreleased - Added + - (Common) All functions should have parameters that take in numpy.complex types. - Changed - Removed @@ -1446,6 +1450,7 @@ #### [nimodinst] Unreleased - Added + - (Common) All functions should have parameters that take in numpy.complex types. - Changed - Removed @@ -1670,6 +1675,8 @@ - Enabled selected public APIs - Basic example - Documentation for APIs (not final) + - (Common) All functions should have parameters that take in numpy.complex types. + - Enabled write_arb_waveform funtions along with examples. - Changed - Removed @@ -1703,6 +1710,7 @@ #### [niscope] Unreleased - Added + - (Common) All functions should have parameters that take in numpy.complex types. - Changed - Removed @@ -2140,8 +2148,8 @@ - [0.2.0](#nise-020---2018-10-25) - [0.1.0](#nise-010---2018-10-17) -#### [nise] Unreleased - Added + - (Common) All functions should have parameters that take in numpy.complex types. - Changed - Removed @@ -2296,8 +2304,8 @@ - [0.3.0](#niswitch-030---2017-10-13) - [0.2.0](#niswitch-020---2017-09-20) -#### [niswitch] Unreleased - Added + - (Common) All functions should have parameters that take in numpy.complex types. - Changed - Removed @@ -2547,8 +2555,8 @@ - [0.3.0](#nitclk-030---2019-11-19) - [0.1.0](#nitclk-010---2019-10-21) -#### [nitclk] Unreleased - Added + - (Common) All functions should have parameters that take in numpy.complex types. - Changed - Removed diff --git a/build/helper/codegen_helper.py b/build/helper/codegen_helper.py index 6121569ecf..b6e3ff3716 100644 --- a/build/helper/codegen_helper.py +++ b/build/helper/codegen_helper.py @@ -574,4 +574,3 @@ def get_enum_value_snippet(value): '''Returns value formatted into string, surrounding it with single quotes if it is of str type''' return ("'{}'" if type(value) is str else "{}").format(value) - diff --git a/docs/nirfsg/class.rst b/docs/nirfsg/class.rst index d45ab2c5a2..5663227a65 100644 --- a/docs/nirfsg/class.rst +++ b/docs/nirfsg/class.rst @@ -2697,20 +2697,29 @@ write_arb_waveform .. py:method:: write_arb_waveform(waveform_name, waveform_data_array, more_data_pending) - Writes data to the waveform in onboard memory. + Writes an arbitrary waveform to the NI-RFSG device starting at the position of the last data written in onboard memory. - By default, subsequent calls to this method - continue writing data from the position of the last sample written. You - can set the write position and offset by calling the :py:meth:`nirfsg.Session.SetNamedWaveformNextWritePosition` - :py:meth:`nirfsg.Session.SetWaveformNextWritePosition` method. + This method accepts the complex baseband data in the form of numpy array of numpy.complex64 or numpy.complex128 or interleaved numpy array of numpy.int16. If the waveform to write is already allocated using the :py:meth:`nirfsg.Session.allocate_arb_waveform` method, the **:py:attr:`nirfsg.Session.MORE_DATA_PENDING`** parameter is ignored. The PXI-5670/5671 must be in the Configuration state before you call this method. When streaming is enabled, you can call this method when the PXIe-5672/5673/5673E or PXIe-5820/5830/5831/5832/5840/5841/5842/5860 is in the Generation state. + ---- + **Supported Devices** : PXIe-5644/5645/5646, PXI-5670/5671, PXIe-5672/5673/5673E, PXIe-5820/5830/5831/5832/5840/5841/5842/5860 + + **Related Topics** + + `Streaming `_ + + `Assigning Properties or Properties to a Waveform `_ + .. note:: One or more of the referenced properties are not in the Python API for this driver. + :param waveform_name: + Specifies the name used to identify the waveform. This string is case-insensitive and alphanumeric, and it does not use reserved words. + @@ -2718,6 +2727,8 @@ write_arb_waveform :param waveform_data_array: + Specifies the array of data to load into the waveform. The array must have at least as many elements as the value in the **size_in_samples** parameter in the :py:meth:`nirfsg.Session.allocate_arb_waveform` method. + @@ -2725,8 +2736,12 @@ write_arb_waveform :param more_data_pending: + Specifies whether or not the data block contains the end of the waveform. Set this parameter to True to allow data to be appended later to the waveform. Splitting the waveform into multiple data blocks can reduce the memory requirements of the write operation. Append data to a previously written waveform by using the same waveform in the **name** parameter. Set **:py:attr:`nirfsg.Session.MORE_DATA_PENDING`** to False to indicate that this data block contains the end of the waveform. If the waveform is already allocated, this parameter is ignored. + + .. note:: One or more of the referenced properties are not in the Python API for this driver. + :type more_data_pending: bool diff --git a/generated/nirfsg/nirfsg/session.py b/generated/nirfsg/nirfsg/session.py index aa097a0ab6..d977796c33 100644 --- a/generated/nirfsg/nirfsg/session.py +++ b/generated/nirfsg/nirfsg/session.py @@ -8046,14 +8046,31 @@ def write_script(self, script): def _write_waveform_complex_f32(self, waveform_name, waveform_data_array, more_data_pending): r'''_write_waveform_complex_f32 - TBD + Writes an arbitrary waveform to the NI-RFSG device starting at the position of the last data written in onboard memory. + + This method accepts the complex baseband data in the form of complex singles. If the waveform to write is already allocated using the %method{allocate arb waveform} method, the **%parameter{more data pending}** parameter is ignored. The PXI-5670/5671 must be in the Configuration state before you call this method. When streaming is enabled, you can call this method when the PXIe-5672/5673/5673E or PXIe-5820/5830/5831/5832/5840/5841/5842/5860 is in the Generation state. + ---- + **Note** + On the PXIe-5644/5645/5646, PXIe-5672/5673/5673E, and PXIe-5820/5830/5831/5832/5840/5841/5842/5860, the **%parameter{more data pending}** parameter is always ignored. To write data in blocks on these devices, you must allocate the waveform before writing it. + ---- + + **Supported Devices**: PXIe-5644/5645/5646, PXI-5670/5671, PXIe-5672/5673/5673E, PXIe-5820/5830/5831/5832/5840/5841/5842/5860 + + **Related Topics** + + [Streaming](https://www.ni.com/docs/en-US/bundle/ni-rfsg/page/streaming.html) + + [Assigning Properties or Properties to a Waveform](https://www.ni.com/docs/en-US/bundle/ni-rfsg/page/assigning-properties-or-properties-to-a-wavef.html) Args: - waveform_name (str): + waveform_name (str): Specifies the name used to identify the waveform. This string is case-insensitive and alphanumeric, and it does not use reserved words. + + waveform_data_array (numpy.array(dtype=numpy.complex64)): Specifies the array of data to load into the waveform. The array must have at least as many elements as the value in the **size_in_samples** parameter in the allocate_arb_waveform method. - waveform_data_array (numpy.array(dtype=numpy.complex64)): + more_data_pending (bool): Specifies whether or not the data block contains the end of the waveform. Set this parameter to True to allow data to be appended later to the waveform. Splitting the waveform into multiple data blocks can reduce the memory requirements of the write operation. Append data to a previously written waveform by using the same waveform in the **name** parameter. Set **MORE_DATA_PENDING** to False to indicate that this data block contains the end of the waveform. If the waveform is already allocated, this parameter is ignored. - more_data_pending (bool): + Note: + One or more of the referenced properties are not in the Python API for this driver. ''' import numpy @@ -8070,14 +8087,31 @@ def _write_waveform_complex_f32(self, waveform_name, waveform_data_array, more_d def _write_waveform_complex_f64(self, waveform_name, waveform_data_array, more_data_pending): r'''_write_waveform_complex_f64 - TBD + Writes an arbitrary waveform to the NI-RFSG device starting at the position of the last data written in onboard memory. + + This method accepts the complex baseband data in the form of complex doubles. If the waveform to write is already allocated using the %method{allocate arb waveform}, the moreDataPending parameter is ignored. The PXI-5670/5671 must be in the Configuration state before you call this method. When streaming is enabled, you can call this method when the PXIe-5672/5673/5673E or PXIe-5820/5830/5831/5832/5840/5841/5842 is in the Generation state. + ---- + **Note** + On the PXIe-5644/5645/5646, PXIe-5672/5673/5673E, and PXIe-5820/5830/5831/5832/5840/5841/5842, the moreDataPending parameter is always ignored. To write data in blocks on these devices, you must allocate the waveform before writing it. + ---- + + **Supported Devices**: PXIe-5644/5645/5646, PXI-5670/5671, PXIe-5672/5673/5673E, PXIe-5820/5830/5831/5832/5840/5841/5842 + + **Related Topics** + + [Streaming](https://www.ni.com/docs/en-US/bundle/ni-rfsg/page/streaming.html) + + [Assigning Properties or Properties to a Waveform](https://www.ni.com/docs/en-US/bundle/ni-rfsg/page/assigning-properties-or-properties-to-a-wavef.html) Args: - waveform_name (str): + waveform_name (str): Specifies the name used to identify the waveform. This string is case-insensitive and alphanumeric, and it does not use reserved words. - waveform_data_array (numpy.array(dtype=numpy.complex128)): + waveform_data_array (numpy.array(dtype=numpy.complex128)): Specifies the array of data to load into the waveform. The array must have at least as many elements as the value in the **size_in_samples** parameter in the allocate_arb_waveform method. - more_data_pending (bool): + more_data_pending (bool): Specifies whether or not the data block contains the end of the waveform. Set this parameter to True to allow data to be appended later to the waveform. Splitting the waveform into multiple data blocks can reduce the memory requirements of the write operation. Append data to a previously written waveform by using the same waveform in the **name** parameter. Set **MORE_DATA_PENDING** to False to indicate that this data block contains the end of the waveform. If the waveform is already allocated, this parameter is ignored. + + Note: + One or more of the referenced properties are not in the Python API for this driver. ''' import numpy @@ -8094,14 +8128,32 @@ def _write_waveform_complex_f64(self, waveform_name, waveform_data_array, more_d def _write_waveform_complex_i16(self, waveform_name, waveform_data_array, more_data_pending): r'''_write_waveform_complex_i16 - TBD + Writes an arbitrary waveform to the NI-RFSG device starting at the position of the last data written in onboard memory. + + This method accepts the interleaved I/Q data of a complex baseband signal. The PXI-5670/5671 must be in the Configuration state before you call this method. When streaming is enabled, this method can be called when the PXIe-5672/5673/5673E or PXIe-5820/5830/5831/5832/5840/5841/5842/5860 is in the Generation state. + ---- + **Note** + This method only supports %enum_value{power level type.peak power} mode as specified in the %property{power level type} property. If you download a waveform when using this method, you cannot set the %property{power level type} to %enum_value{power level type.average power} without causing error in the output. + ---- + + + **Supported Devices**: PXIe-5644/5645/5646, PXIe-5672/5673/5673E, PXIe-5820/5830/5831/5832/5840/5841/5842/5860 + + **Related Topics** + + [Streaming](https://www.ni.com/docs/en-US/bundle/ni-rfsg/page/streaming.html) + + [Assigning Properties or Properties to a Waveform](https://www.ni.com/docs/en-US/bundle/ni-rfsg/page/assigning-properties-or-properties-to-a-wavef.html) Args: - waveform_name (str): + waveform_name (str): Specifies the name used to identify the waveform. This string is case-insensitive and alphanumeric, and it does not use reserved words. + + waveform_data_array (numpy.array(dtype=numpy.int16)): Specifies the array of data to load into the waveform. The array must have at least as many elements as the value in the **size_in_samples** parameter in the allocate_arb_waveform method. - waveform_data_array (numpy.array(dtype=numpy.int16)): + more_data_pending (bool): Specifies whether or not the data block contains the end of the waveform. Set this parameter to True to allow data to be appended later to the waveform. Splitting the waveform into multiple data blocks can reduce the memory requirements of the write operation. Append data to a previously written waveform by using the same waveform in the **name** parameter. Set **MORE_DATA_PENDING** to False to indicate that this data block contains the end of the waveform. If the waveform is already allocated, this parameter is ignored. - more_data_pending (bool): + Note: + One or more of the referenced properties are not in the Python API for this driver. ''' import numpy @@ -8118,19 +8170,30 @@ def _write_waveform_complex_i16(self, waveform_name, waveform_data_array, more_d def write_arb_waveform(self, waveform_name, waveform_data_array, more_data_pending): '''write_arb_waveform - Writes data to the waveform in onboard memory. + Writes an arbitrary waveform to the NI-RFSG device starting at the position of the last data written in onboard memory. - By default, subsequent calls to this method - continue writing data from the position of the last sample written. You - can set the write position and offset by calling the SetNamedWaveformNextWritePosition - SetWaveformNextWritePosition method. + This method accepts the complex baseband data in the form of numpy array of numpy.complex64 or numpy.complex128 or interleaved numpy array of numpy.int16. If the waveform to write is already allocated using the allocate_arb_waveform method, the **MORE_DATA_PENDING** parameter is ignored. The PXI-5670/5671 must be in the Configuration state before you call this method. When streaming is enabled, you can call this method when the PXIe-5672/5673/5673E or PXIe-5820/5830/5831/5832/5840/5841/5842/5860 is in the Generation state. + ---- + **Supported Devices** : PXIe-5644/5645/5646, PXI-5670/5671, PXIe-5672/5673/5673E, PXIe-5820/5830/5831/5832/5840/5841/5842/5860 + + **Related Topics** + + `Streaming `_ + + `Assigning Properties or Properties to a Waveform `_ + + Note: + One or more of the referenced properties are not in the Python API for this driver. Args: - waveform_name (str): + waveform_name (str): Specifies the name used to identify the waveform. This string is case-insensitive and alphanumeric, and it does not use reserved words. + + waveform_data_array (list of ComplexViReal64): Specifies the array of data to load into the waveform. The array must have at least as many elements as the value in the **size_in_samples** parameter in the allocate_arb_waveform method. - waveform_data_array (list of ComplexViReal64): + more_data_pending (bool): Specifies whether or not the data block contains the end of the waveform. Set this parameter to True to allow data to be appended later to the waveform. Splitting the waveform into multiple data blocks can reduce the memory requirements of the write operation. Append data to a previously written waveform by using the same waveform in the **name** parameter. Set **MORE_DATA_PENDING** to False to indicate that this data block contains the end of the waveform. If the waveform is already allocated, this parameter is ignored. - more_data_pending (bool): + Note: + One or more of the referenced properties are not in the Python API for this driver. ''' if str(type(waveform_data_array)).find("'numpy.ndarray'") != -1: diff --git a/src/nifake/metadata/functions.py b/src/nifake/metadata/functions.py index c15a7c1de7..8d1c2b83ad 100644 --- a/src/nifake/metadata/functions.py +++ b/src/nifake/metadata/functions.py @@ -380,7 +380,7 @@ 'WriteWaveformComplexF64': { 'codegen_method': 'private', 'documentation': { - 'description': 'TBD' + 'description': 'A function that writes a waveform of complex128 numbers.' }, 'included_in_proto': False, 'is_error_handling': False, @@ -403,6 +403,9 @@ }, { 'direction': 'in', + 'documentation': { + 'description': 'Specifies the number of samples in the message signal.' + }, 'name': 'numberOfSamples', 'type': 'ViInt32', 'use_array': False, @@ -410,6 +413,9 @@ }, { 'direction': 'in', + 'documentation': { + 'description': 'Specifies the array of data to load into the waveform. Array should be numberOfSamples big.' + }, 'name': 'waveformDataArray', 'numpy': True, 'size': { @@ -427,7 +433,7 @@ 'WriteWaveformComplexI16': { 'codegen_method': 'private', 'documentation': { - 'description': 'TBD' + 'description': 'A function that writes a waveform of i16 numbers.' }, 'included_in_proto': False, 'is_error_handling': False, @@ -442,11 +448,17 @@ 'parameters': [ { 'direction': 'in', + 'documentation': { + 'description': 'Identifies a particular instrument session.' + }, 'name': 'vi', - 'type': 'ViSession', + 'type': 'ViSession' }, { 'direction': 'in', + 'documentation': { + 'description': 'Specifies the number of samples in the message signal.' + }, 'name': 'numberOfSamples', 'type': 'ViInt32', 'use_array': False, @@ -454,6 +466,9 @@ }, { 'direction': 'in', + 'documentation': { + 'description': 'Specifies the array of data to load into the waveform. Array should be numberOfSamples big.' + }, 'name': 'waveformDataArray', 'numpy': True, 'size': { @@ -471,7 +486,7 @@ 'WriteWaveformComplexF32': { 'codegen_method': 'private', 'documentation': { - 'description': 'TBD' + 'description': 'A function that writes a waveform of complex64 numbers.' }, 'included_in_proto': False, 'is_error_handling': False, @@ -486,13 +501,19 @@ 'parameters': [ { 'direction': 'in', + 'documentation': { + 'description': 'Identifies a particular instrument session.' + }, 'name': 'vi', - 'type': 'ViSession', + 'type': 'ViSession' 'use_array': False, 'use_in_python_api': True }, { 'direction': 'in', + 'documentation': { + 'description': 'Specifies the number of samples in the message signal.' + }, 'name': 'numberOfSamples', 'type': 'ViInt32', 'use_array': False, @@ -500,6 +521,9 @@ }, { 'direction': 'in', + 'documentation': { + 'description': 'Specifies the array of data to load into the waveform. Array should be numberOfSamples big.' + }, 'name': 'waveformDataArray', 'numpy': True, 'size': { diff --git a/src/nirfsg/examples/nirfsg_arb_waveform.py b/src/nirfsg/examples/nirfsg_arb_waveform.py new file mode 100644 index 0000000000..179bc78e7b --- /dev/null +++ b/src/nirfsg/examples/nirfsg_arb_waveform.py @@ -0,0 +1,46 @@ +import argparse +import nirfsg +import numpy as np +import sys + + +def example(resource_name, options, frequency, power_level, number_of_samples): + waveform_data = np.full(number_of_samples, 1 + 0j, dtype=np.complex128) + with nirfsg.Session(resource_name=resource_name, id_query=False, reset_device=False, options=options) as session: + session.configure_rf( + frequency, + power_level + ) + session.generation_mode = nirfsg.GenerationMode.ARB_WAVEFORM + session.write_arb_waveform('wfm', waveform_data, False) + with session.initiate(): + session.check_generation_status() + + +def _main(argsv): + parser = argparse.ArgumentParser(description='Continuously generates an arbitrary waveform using NI-RFSG.', formatter_class=argparse.ArgumentDefaultsHelpFormatter) + parser.add_argument('-n', '--resource-name', default='5841', help='Resource name of the NI RF signal generator.') + parser.add_argument('-f', '--frequency', default=1e9, type=float, help='Frequency in Hz.') + parser.add_argument('-p', '--power-level', default=-10.0, type=float, help='Power level in dBm.') + parser.add_argument('-n', '--number-of-samples', default=1000, type=int, help='Number of samples.') + parser.add_argument('-op', '--option-string', default='Simulate=1, DriverSetup=Model:5841', type=str, help='Option string for the session.') + args = parser.parse_args(argsv) + example(args.resource_name, args.option_string, args.frequency, args.power_level, args.number_of_samples) + + +def main(): + _main(sys.argv[1:]) + + +def test_example(): + options = "Simulate=1, DriverSetup=Model:5841" + example('5841', options, 1e9, -10.0) + + +def test_main(): + cmd_line = ['--resource-name', '5841', '--frequency', '1e9', '--power-level', '-10', '--number-of-samples', '1000', '--option-string', 'Simulate=1, DriverSetup=Model:5841'] + _main(cmd_line) + + +if __name__ == '__main__': + main() \ No newline at end of file diff --git a/src/nirfsg/examples/nirfsg_script.py b/src/nirfsg/examples/nirfsg_script.py new file mode 100644 index 0000000000..a667390c52 --- /dev/null +++ b/src/nirfsg/examples/nirfsg_script.py @@ -0,0 +1,54 @@ +import argparse +import nirfsg +import numpy as np +import sys + +SAMPLE_SCRIPT = ''' +script continuousWaveform + repeat forever + generate wfm + end repeat +end script +''' + +def example(resource_name, options, frequency, power_level, number_of_samples): + waveform_data = np.full(number_of_samples, 1 + 0j, dtype=np.complex64) + with nirfsg.Session(resource_name=resource_name, id_query=False, reset_device=False, options=options) as session: + session.configure_rf( + frequency, + power_level + ) + session.generation_mode = nirfsg.GenerationMode.SCRIPT + session.write_arb_waveform('wfm', waveform_data, False) + session.write_script(SAMPLE_SCRIPT) + with session.initiate(): + session.check_generation_status() + + +def _main(argsv): + parser = argparse.ArgumentParser(description='Generates a signal based on the script provided.', formatter_class=argparse.ArgumentDefaultsHelpFormatter) + parser.add_argument('-n', '--resource-name', default='5841', help='Resource name of the NI RF signal generator.') + parser.add_argument('-f', '--frequency', default=1e9, type=float, help='Frequency in Hz.') + parser.add_argument('-p', '--power-level', default=-10.0, type=float, help='Power level in dBm.') + parser.add_argument('-n', '--number-of-samples', default=1000, type=int, help='Number of samples.') + parser.add_argument('-op', '--option-string', default='Simulate=1, DriverSetup=Model:5841', type=str, help='Option string for the session.') + args = parser.parse_args(argsv) + example(args.resource_name, args.option_string, args.frequency, args.power_level, args.number_of_samples) + + +def main(): + _main(sys.argv[1:]) + + +def test_example(): + options = "Simulate=1, DriverSetup=Model:5841" + example('5841', options, 1e9, -10.0) + + +def test_main(): + cmd_line = ['--resource-name', '5841', '--frequency', '1e9', '--power-level', '-10', '--number-of-samples', '1000', '--option-string', 'Simulate=1, DriverSetup=Model:5841'] + _main(cmd_line) + + +if __name__ == '__main__': + main() \ No newline at end of file diff --git a/src/nirfsg/metadata/functions.py b/src/nirfsg/metadata/functions.py index 25c0791be8..189702c295 100644 --- a/src/nirfsg/metadata/functions.py +++ b/src/nirfsg/metadata/functions.py @@ -4947,9 +4947,9 @@ 'WriteWaveformDispatcher': { 'codegen_method': 'python-only', 'documentation': { - 'description': 'Writes data to the waveform in onboard memory.\n\nBy default, subsequent calls to this function\ncontinue writing data from the position of the last sample written. You\ncan set the write position and offset by calling the nirfsg_SetNamedWaveformNextWritePosition\nnirfsg_SetWaveformNextWritePosition function.' + 'description': ' \n Writes an arbitrary waveform to the NI-RFSG device starting at the position of the last data written in onboard memory. \n \n This function accepts the complex baseband data in the form of numpy array of numpy.complex64 or numpy.complex128 or interleaved numpy array of numpy.int16. If the waveform to write is already allocated using the nirfsg_AllocateArbWaveform function, the **NIRFSG_ATTR_MORE_DATA_PENDING** parameter is ignored. The PXI-5670/5671 must be in the Configuration state before you call this function. When streaming is enabled, you can call this function when the PXIe-5672/5673/5673E or PXIe-5820/5830/5831/5832/5840/5841/5842/5860 is in the Generation state.\n ----\n **Supported Devices** : PXIe-5644/5645/5646, PXI-5670/5671, PXIe-5672/5673/5673E, PXIe-5820/5830/5831/5832/5840/5841/5842/5860\n\n **Related Topics**\n\n `Streaming `_\n\n `Assigning Properties or Attributes to a Waveform `_\n ' }, - 'included_in_proto': True, + 'included_in_proto': False, 'method_templates': [ { 'documentation_filename': 'default_method', @@ -4961,6 +4961,9 @@ 'parameters': [ { 'direction': 'in', + 'documentation': { + 'description': 'Identifies your instrument session. The ViSession handle is obtained from the nirfsg_Init function or the nirfsg_InitWithOptions function and identifies a particular instrument session.' + }, 'name': 'vi', 'type': 'ViSession', 'use_array': False, @@ -4968,6 +4971,9 @@ }, { 'direction': 'in', + 'documentation': { + 'description': 'Specifies the name used to identify the waveform. This string is case-insensitive and alphanumeric, and it does not use reserved words.' + }, 'name': 'waveformName', 'type': 'ViConstString', 'use_array': False, @@ -4975,6 +4981,9 @@ }, { 'direction': 'in', + 'documentation': { + 'description': 'Specifies the number of samples in the message signal.' + }, 'name': 'numberOfSamples', 'type': 'ViInt32', 'use_array': False, @@ -4982,6 +4991,9 @@ }, { 'direction': 'in', + 'documentation': { + 'description': 'Specifies the array of data to load into the waveform. The array must have at least as many elements as the value in the **size_in_samples** parameter in the nirfsg_AllocateArbWaveform function.' + }, 'name': 'waveformDataArray', 'size': { 'mechanism': 'len', @@ -4992,6 +5004,10 @@ }, { 'direction': 'in', + 'direction': 'in', + 'documentation': { + 'description': 'Specifies whether or not the data block contains the end of the waveform. Set this parameter to VI_TRUE to allow data to be appended later to the waveform. Splitting the waveform into multiple data blocks can reduce the memory requirements of the write operation. Append data to a previously written waveform by using the same waveform in the **name** parameter. Set **NIRFSG_ATTR_MORE_DATA_PENDING** to VI_FALSE to indicate that this data block contains the end of the waveform. If the waveform is already allocated, this parameter is ignored.' + }, 'name': 'moreDataPending', 'type': 'ViBoolean', 'use_array': False, @@ -5004,9 +5020,9 @@ 'WriteWaveformComplexF64': { 'codegen_method': 'private', 'documentation': { - 'description': 'TBD' + 'description': ' \n Writes an arbitrary waveform to the NI-RFSG device starting at the position of the last data written in onboard memory. \n \n This function accepts the complex baseband data in the form of complex doubles. If the waveform to write is already allocated using the %function{allocate arb waveform}, the moreDataPending parameter is ignored. The PXI-5670/5671 must be in the Configuration state before you call this function. When streaming is enabled, you can call this function when the PXIe-5672/5673/5673E or PXIe-5820/5830/5831/5832/5840/5841/5842 is in the Generation state.\n ----\n **Note**\n On the PXIe-5644/5645/5646, PXIe-5672/5673/5673E, and PXIe-5820/5830/5831/5832/5840/5841/5842, the moreDataPending parameter is always ignored. To write data in blocks on these devices, you must allocate the waveform before writing it.\n ----\n\n **Supported Devices**: PXIe-5644/5645/5646, PXI-5670/5671, PXIe-5672/5673/5673E, PXIe-5820/5830/5831/5832/5840/5841/5842\n\n **Related Topics**\n\n [Streaming](https://www.ni.com/docs/en-US/bundle/ni-rfsg/page/streaming.html)\n\n [Assigning Properties or Attributes to a Waveform](https://www.ni.com/docs/en-US/bundle/ni-rfsg/page/assigning-properties-or-attributes-to-a-wavef.html)\n ' }, - 'included_in_proto': True, + 'included_in_proto': False, 'is_error_handling': False, 'method_templates': [ { @@ -5020,6 +5036,9 @@ 'parameters': [ { 'direction': 'in', + 'documentation': { + 'description': 'Identifies your instrument session. The ViSession handle is obtained from the nirfsg_Init function or the nirfsg_InitWithOptions function and identifies a particular instrument session.' + }, 'name': 'vi', 'type': 'ViSession', 'use_array': False, @@ -5027,6 +5046,10 @@ }, { 'direction': 'in', + 'direction': 'in', + 'documentation': { + 'description': 'Specifies the name used to identify the waveform. This string is case-insensitive and alphanumeric, and it does not use reserved words.' + }, 'name': 'waveformName', 'type': 'ViConstString', 'use_array': False, @@ -5034,6 +5057,9 @@ }, { 'direction': 'in', + 'documentation': { + 'description': 'Specifies the number of samples in the message signal.' + }, 'name': 'numberOfSamples', 'type': 'ViInt32', 'use_array': False, @@ -5041,6 +5067,9 @@ }, { 'direction': 'in', + 'documentation': { + 'description': 'Specifies the array of data to load into the waveform. The array must have at least as many elements as the value in the **size_in_samples** parameter in the nirfsg_AllocateArbWaveform function.' + }, 'name': 'waveformDataArray', 'numpy': True, 'size': { @@ -5054,6 +5083,9 @@ }, { 'direction': 'in', + 'documentation': { + 'description': 'Specifies whether or not the data block contains the end of the waveform. Set this parameter to VI_TRUE to allow data to be appended later to the waveform. Splitting the waveform into multiple data blocks can reduce the memory requirements of the write operation. Append data to a previously written waveform by using the same waveform in the **name** parameter. Set **NIRFSG_ATTR_MORE_DATA_PENDING** to VI_FALSE to indicate that this data block contains the end of the waveform. If the waveform is already allocated, this parameter is ignored.' + }, 'name': 'moreDataPending', 'type': 'ViBoolean', 'use_array': False, @@ -5066,9 +5098,9 @@ 'WriteWaveformComplexI16': { 'codegen_method': 'private', 'documentation': { - 'description': 'TBD' + 'description': ' \n Writes an arbitrary waveform to the NI-RFSG device starting at the position of the last data written in onboard memory. \n \n This function accepts the interleaved I/Q data of a complex baseband signal. The PXI-5670/5671 must be in the Configuration state before you call this function. When streaming is enabled, this function can be called when the PXIe-5672/5673/5673E or PXIe-5820/5830/5831/5832/5840/5841/5842/5860 is in the Generation state.\n ----\n **Note**\n This function only supports %enum_value{power level type.peak power} mode as specified in the %attribute{power level type} attribute. If you download a waveform when using this function, you cannot set the %attribute{power level type} to %enum_value{power level type.average power} without causing error in the output.\n ----\n\n\n **Supported Devices**: PXIe-5644/5645/5646, PXIe-5672/5673/5673E, PXIe-5820/5830/5831/5832/5840/5841/5842/5860\n\n **Related Topics**\n\n [Streaming](https://www.ni.com/docs/en-US/bundle/ni-rfsg/page/streaming.html)\n\n [Assigning Properties or Attributes to a Waveform](https://www.ni.com/docs/en-US/bundle/ni-rfsg/page/assigning-properties-or-attributes-to-a-wavef.html)\n ' }, - 'included_in_proto': True, + 'included_in_proto': False, 'is_error_handling': False, 'method_templates': [ { @@ -5082,6 +5114,9 @@ 'parameters': [ { 'direction': 'in', + 'documentation': { + 'description': 'Identifies your instrument session. The ViSession handle is obtained from the nirfsg_Init function or the nirfsg_InitWithOptions function and identifies a particular instrument session.' + }, 'name': 'vi', 'type': 'ViSession', 'use_array': False, @@ -5089,6 +5124,9 @@ }, { 'direction': 'in', + 'documentation': { + 'description': 'Specifies the name used to identify the waveform. This string is case-insensitive and alphanumeric, and it does not use reserved words.' + }, 'name': 'waveformName', 'type': 'ViConstString', 'use_array': False, @@ -5096,6 +5134,9 @@ }, { 'direction': 'in', + 'documentation': { + 'description': 'Specifies the number of samples in the message signal.' + }, 'name': 'numberOfSamples', 'type': 'ViInt32', 'use_array': False, @@ -5103,6 +5144,9 @@ }, { 'direction': 'in', + 'documentation': { + 'description': 'Specifies the array of data to load into the waveform. The array must have at least as many elements as the value in the **size_in_samples** parameter in the nirfsg_AllocateArbWaveform function.' + }, 'name': 'waveformDataArray', 'numpy': True, 'size': { @@ -5116,6 +5160,9 @@ }, { 'direction': 'in', + 'documentation': { + 'description': 'Specifies whether or not the data block contains the end of the waveform. Set this parameter to VI_TRUE to allow data to be appended later to the waveform. Splitting the waveform into multiple data blocks can reduce the memory requirements of the write operation. Append data to a previously written waveform by using the same waveform in the **name** parameter. Set **NIRFSG_ATTR_MORE_DATA_PENDING** to VI_FALSE to indicate that this data block contains the end of the waveform. If the waveform is already allocated, this parameter is ignored.' + }, 'name': 'moreDataPending', 'type': 'ViBoolean', 'use_array': False, @@ -5128,9 +5175,9 @@ 'WriteWaveformComplexF32': { 'codegen_method': 'private', 'documentation': { - 'description': 'TBD' + 'description': ' \n Writes an arbitrary waveform to the NI-RFSG device starting at the position of the last data written in onboard memory. \n \n This function accepts the complex baseband data in the form of complex singles. If the waveform to write is already allocated using the %function{allocate arb waveform} function, the **%parameter{more data pending}** parameter is ignored. The PXI-5670/5671 must be in the Configuration state before you call this function. When streaming is enabled, you can call this function when the PXIe-5672/5673/5673E or PXIe-5820/5830/5831/5832/5840/5841/5842/5860 is in the Generation state.\n ----\n **Note**\n On the PXIe-5644/5645/5646, PXIe-5672/5673/5673E, and PXIe-5820/5830/5831/5832/5840/5841/5842/5860, the **%parameter{more data pending}** parameter is always ignored. To write data in blocks on these devices, you must allocate the waveform before writing it.\n ----\n\n **Supported Devices**: PXIe-5644/5645/5646, PXI-5670/5671, PXIe-5672/5673/5673E, PXIe-5820/5830/5831/5832/5840/5841/5842/5860\n\n **Related Topics**\n\n [Streaming](https://www.ni.com/docs/en-US/bundle/ni-rfsg/page/streaming.html)\n\n [Assigning Properties or Attributes to a Waveform](https://www.ni.com/docs/en-US/bundle/ni-rfsg/page/assigning-properties-or-attributes-to-a-wavef.html)\n ' }, - 'included_in_proto': True, + 'included_in_proto': False, 'is_error_handling': False, 'method_templates': [ { @@ -5144,6 +5191,9 @@ 'parameters': [ { 'direction': 'in', + 'documentation': { + 'description': 'Identifies your instrument session. The ViSession handle is obtained from the nirfsg_Init function or the nirfsg_InitWithOptions function and identifies a particular instrument session.' + }, 'name': 'vi', 'type': 'ViSession', 'use_array': False, @@ -5151,6 +5201,9 @@ }, { 'direction': 'in', + 'documentation': { + 'description': 'Specifies the name used to identify the waveform. This string is case-insensitive and alphanumeric, and it does not use reserved words.' + }, 'name': 'waveformName', 'type': 'ViConstString', 'use_array': False, @@ -5158,6 +5211,9 @@ }, { 'direction': 'in', + 'documentation': { + 'description': 'Specifies the number of samples in the message signal.' + }, 'name': 'numberOfSamples', 'type': 'ViInt32', 'use_array': False, @@ -5165,6 +5221,9 @@ }, { 'direction': 'in', + 'documentation': { + 'description': 'Specifies the array of data to load into the waveform. The array must have at least as many elements as the value in the **size_in_samples** parameter in the nirfsg_AllocateArbWaveform function.' + }, 'name': 'waveformDataArray', 'numpy': True, 'size': { @@ -5178,6 +5237,9 @@ }, { 'direction': 'in', + 'documentation': { + 'description': 'Specifies whether or not the data block contains the end of the waveform. Set this parameter to VI_TRUE to allow data to be appended later to the waveform. Splitting the waveform into multiple data blocks can reduce the memory requirements of the write operation. Append data to a previously written waveform by using the same waveform in the **name** parameter. Set **NIRFSG_ATTR_MORE_DATA_PENDING** to VI_FALSE to indicate that this data block contains the end of the waveform. If the waveform is already allocated, this parameter is ignored.' + }, 'name': 'moreDataPending', 'type': 'ViBoolean', 'use_array': False, diff --git a/tox_report.log b/tox_report.log new file mode 100644 index 0000000000..c231d603a9 --- /dev/null +++ b/tox_report.log @@ -0,0 +1,2137 @@ +py312-build_test: commands[0]> python --version +Python 3.12.10 +py312-build_test: commands[1]> python -c 'import platform; print(platform.architecture())' +('64bit', 'ELF') +py312-build_test: commands[2]> python -m pip install --disable-pip-version-check --upgrade pip +Requirement already satisfied: pip in ./.tox/64/py312-build_test/lib/python3.12/site-packages (25.1.1) +py312-build_test: commands[3]> python -m pip list +Package Version +----------- ------- +coverage 7.8.0 +flake8 7.1.2 +hacking 7.0.0 +iniconfig 2.1.0 +Mako 1.3.10 +MarkupSafe 3.0.2 +mccabe 0.7.0 +packaging 25.0 +pep8-naming 0.15.1 +pip 25.1.1 +pluggy 1.5.0 +pycodestyle 2.12.1 +pyflakes 3.2.0 +pytest 8.3.5 +py312-build_test: commands[4]> coverage run --rcfile=tools/coverage_unit_tests.rc --source build.helper -m pytest --pyargs build.helper +============================= test session starts ============================== +platform linux -- Python 3.12.10, pytest-8.3.5, pluggy-1.5.0 -- /home/rahur/nimipythonmyfork/nimi-python/.tox/64/py312-build_test/bin/python +cachedir: .tox/64/py312-build_test/.pytest_cache +rootdir: /home/rahur/nimipythonmyfork/nimi-python +configfile: tox.ini +collecting ... collected 1 item + +build/helper/documentation_helper.py::build.helper.documentation_helper.as_rest_table PASSED [100%] + +============================== 1 passed in 0.24s =============================== +py312-build_test: commands[5]> coverage run --append --rcfile=tools/coverage_unit_tests.rc --source build.helper -m pytest build/unit_tests -s +============================= test session starts ============================== +platform linux -- Python 3.12.10, pytest-8.3.5, pluggy-1.5.0 -- /home/rahur/nimipythonmyfork/nimi-python/.tox/64/py312-build_test/bin/python +cachedir: .tox/64/py312-build_test/.pytest_cache +rootdir: /home/rahur/nimipythonmyfork/nimi-python +configfile: tox.ini +collecting ... collected 93 items + +build/unit_tests/test_codegen_helper.py::test_get_library_interpreter_method_return_snippet_vi PASSED +build/unit_tests/test_codegen_helper.py::test_get_library_interpreter_method_return_snippet_int PASSED +build/unit_tests/test_codegen_helper.py::test_get_library_interpreter_method_return_snippet_string PASSED +build/unit_tests/test_codegen_helper.py::test_get_library_interpreter_method_return_snippet_custom_type PASSED +build/unit_tests/test_codegen_helper.py::test_get_library_interpreter_method_return_snippet_enum PASSED +build/unit_tests/test_codegen_helper.py::test_get_library_interpreter_method_return_snippet_into PASSED +build/unit_tests/test_codegen_helper.py::test_get_grpc_interpreter_method_return_snippet_vi PASSED +build/unit_tests/test_codegen_helper.py::test_get_grpc_interpreter_method_return_snippet_int PASSED +build/unit_tests/test_codegen_helper.py::test_get_grpc_interpreter_method_return_snippet_string PASSED +build/unit_tests/test_codegen_helper.py::test_get_grpc_interpreter_method_return_snippet_custom_type PASSED +build/unit_tests/test_codegen_helper.py::test_get_grpc_interpreter_method_return_snippet_enum PASSED +build/unit_tests/test_codegen_helper.py::test_get_grpc_interpreter_method_return_snippet_bytes PASSED +build/unit_tests/test_codegen_helper.py::test_get_session_method_return_snippet PASSED +build/unit_tests/test_codegen_helper.py::test_get_session_method_return_snippet_non_numpy PASSED +build/unit_tests/test_codegen_helper.py::test_get_session_method_return_snippet_numpy PASSED +build/unit_tests/test_codegen_helper.py::test_get_enum_type_check_snippet PASSED +build/unit_tests/test_codegen_helper.py::test_get_buffer_parameters_for_size_parameter_none PASSED +build/unit_tests/test_codegen_helper.py::test_get_buffer_parameters_for_size_parameter PASSED +build/unit_tests/test_codegen_helper.py::test_get_ctype_variable_declaration_snippet_case_c010 PASSED +build/unit_tests/test_codegen_helper.py::test_get_ctype_variable_declaration_snippet_case_c020 PASSED +build/unit_tests/test_codegen_helper.py::test_get_ctype_variable_declaration_snippet_case_c030 PASSED +build/unit_tests/test_codegen_helper.py::test_get_ctype_variable_declaration_snippet_case_c050 PASSED +build/unit_tests/test_codegen_helper.py::test_get_ctype_variable_declaration_snippet_case_c060 PASSED +build/unit_tests/test_codegen_helper.py::test_get_ctype_variable_declaration_snippet_case_c070 PASSED +build/unit_tests/test_codegen_helper.py::test_get_ctype_variable_declaration_snippet_case_c080 PASSED +build/unit_tests/test_codegen_helper.py::test_get_ctype_variable_declaration_snippet_case_c090 PASSED +build/unit_tests/test_codegen_helper.py::test_get_ctype_variable_declaration_snippet_case_c100 PASSED +build/unit_tests/test_codegen_helper.py::test_get_ctype_variable_declaration_snippet_case_s110 PASSED +build/unit_tests/test_codegen_helper.py::test_get_ctype_variable_declaration_snippet_case_s120 PASSED +build/unit_tests/test_codegen_helper.py::test_get_ctype_variable_declaration_snippet_case_s130 PASSED +build/unit_tests/test_codegen_helper.py::test_get_ctype_variable_declaration_snippet_case_s150 PASSED +build/unit_tests/test_codegen_helper.py::test_get_ctype_variable_declaration_snippet_case_s160 PASSED +build/unit_tests/test_codegen_helper.py::test_get_ctype_variable_declaration_snippet_case_s170 PASSED +build/unit_tests/test_codegen_helper.py::test_get_ctype_variable_declaration_snippet_case_s180 PASSED +build/unit_tests/test_codegen_helper.py::test_get_ctype_variable_declaration_snippet_case_s2190 PASSED +build/unit_tests/test_codegen_helper.py::test_get_ctype_variable_declaration_snippet_case_s200 PASSED +build/unit_tests/test_codegen_helper.py::test_get_ctype_variable_declaration_snippet_case_s210 PASSED +build/unit_tests/test_codegen_helper.py::test_get_ctype_variable_declaration_snippet_case_s220 PASSED +build/unit_tests/test_codegen_helper.py::test_get_ctype_variable_declaration_snippet_case_b510 PASSED +build/unit_tests/test_codegen_helper.py::test_get_ctype_variable_declaration_snippet_case_b540 PASSED +build/unit_tests/test_codegen_helper.py::test_get_ctype_variable_declaration_snippet_case_b550_array PASSED +build/unit_tests/test_codegen_helper.py::test_get_ctype_variable_declaration_snippet_case_b550_list PASSED +build/unit_tests/test_codegen_helper.py::test_get_ctype_variable_declaration_snippet_case_b560 PASSED +build/unit_tests/test_codegen_helper.py::test_get_ctype_variable_declaration_snippet_case_b570 PASSED +build/unit_tests/test_codegen_helper.py::test_get_ctype_variable_declaration_snippet_case_b580_array PASSED +build/unit_tests/test_codegen_helper.py::test_get_ctype_variable_declaration_snippet_case_b590_array PASSED +build/unit_tests/test_codegen_helper.py::test_get_ctype_variable_declaration_snippet_case_b580_list PASSED +build/unit_tests/test_codegen_helper.py::test_get_ctype_variable_declaration_snippet_case_b590_list PASSED +build/unit_tests/test_codegen_helper.py::test_get_ctype_variable_declaration_snippet_case_b600 PASSED +build/unit_tests/test_codegen_helper.py::test_get_ctype_variable_declaration_snippet_case_b610_array PASSED +build/unit_tests/test_codegen_helper.py::test_get_ctype_variable_declaration_snippet_case_b620_array PASSED +build/unit_tests/test_codegen_helper.py::test_get_ctype_variable_declaration_snippet_case_b610_list PASSED +build/unit_tests/test_codegen_helper.py::test_get_ctype_variable_declaration_snippet_case_b620_list PASSED +build/unit_tests/test_codegen_helper.py::test_get_ctype_variable_declaration_snippet_bad_ivi_dance_step PASSED +build/unit_tests/test_codegen_helper.py::test_get_enum_value_snippet PASSED +build/unit_tests/test_documentation_helper.py::test_get_function_rst_default PASSED +build/unit_tests/test_documentation_helper.py::test_get_function_rst_numpy PASSED +build/unit_tests/test_documentation_helper.py::test_get_attribute_repeated_caps PASSED +build/unit_tests/test_documentation_helper.py::test_get_attribute_repeated_caps_with_conjunction PASSED +build/unit_tests/test_documentation_helper.py::test_module_supports_repeated_caps PASSED +build/unit_tests/test_documentation_helper.py::test_get_function_docstring_default PASSED +build/unit_tests/test_documentation_helper.py::test_get_function_docstring_numpy PASSED +build/unit_tests/test_documentation_helper.py::test_get_rst_header_snippet PASSED +build/unit_tests/test_documentation_helper.py::test_get_documentation_for_node_docstring PASSED +build/unit_tests/test_documentation_helper.py::test_get_rst_picture_reference PASSED +build/unit_tests/test_documentation_helper.py::test_square_up_tables PASSED +build/unit_tests/test_documentation_helper.py::test_add_notes_re_links PASSED +build/unit_tests/test_documentation_snippets.py::test_close_function_def_for_doc_note_not_list PASSED +build/unit_tests/test_documentation_snippets.py::test_close_function_def_for_doc_note_list PASSED +build/unit_tests/test_documentation_snippets.py::test_close_function_def_for_doc_no_note PASSED +build/unit_tests/test_documentation_snippets.py::test_initiate_function_def_for_doc_note_not_list PASSED +build/unit_tests/test_documentation_snippets.py::test_initiate_function_def_for_doc_note_list PASSED +build/unit_tests/test_documentation_snippets.py::test_initiate_function_def_for_doc_no_note PASSED +build/unit_tests/test_helper.py::test_get_development_status PASSED +build/unit_tests/test_helper.py::test_enum_uses_converter PASSED +build/unit_tests/test_metadata_add_all.py::test_add_functions_metadata_simple Couldn't find InitWithOptions init function +PASSED +build/unit_tests/test_metadata_add_all.py::test_add_attributes_metadata_simple PASSED +build/unit_tests/test_metadata_add_all.py::test_add_enums_metadata_simple PASSED +build/unit_tests/test_metadata_add_all.py::test_add_all_metadata_defaults Couldn't find InitWithOptions init function +PASSED +build/unit_tests/test_metadata_add_all.py::test_add_all_metadata Couldn't find InitWithOptions init function +PASSED +build/unit_tests/test_metadata_add_all.py::test_add_enum_codegen_method PASSED +build/unit_tests/test_metadata_add_all.py::test_add_enum_codegen_method_error PASSED +build/unit_tests/test_metadata_add_all.py::test_get_functions_that_use_enums PASSED +build/unit_tests/test_metadata_add_all.py::test_get_attributes_that_use_enums PASSED +build/unit_tests/test_metadata_add_all.py::test_get_least_restrictive_codegen_method PASSED +build/unit_tests/test_metadata_merge_dicts.py::test_merge_dict_second_is_empty PASSED +build/unit_tests/test_metadata_merge_dicts.py::test_merge_dict_key_exists PASSED +build/unit_tests/test_metadata_merge_dicts.py::test_merge_dict_recurse PASSED +build/unit_tests/test_metadata_merge_dicts.py::test_merge_dict_replace_in_list PASSED +build/unit_tests/test_metadata_merge_dicts.py::test_merge_dict_replace_in_dict_and_list PASSED +build/unit_tests/test_metadata_merge_dicts.py::test_merge_dict_with_regex PASSED +build/unit_tests/test_metadata_merge_dicts.py::test_merge_dict_with_regex_off PASSED +build/unit_tests/test_metadata_merge_dicts.py::test_merge_dict_top_level_key_missing PASSED + +============================== 93 passed in 0.30s ============================== +py312-build_test: commands[6]> coverage report +Name Stmts Miss Cover +------------------------------------------------------------- +build/helper/__init__.py 52 0 100% +build/helper/codegen_helper.py 307 50 84% +build/helper/documentation_helper.py 519 60 88% +build/helper/documentation_snippets.py 53 8 85% +build/helper/helper.py 50 10 80% +build/helper/metadata_add_all.py 430 82 81% +build/helper/metadata_filters.py 92 19 79% +build/helper/metadata_find.py 28 9 68% +build/helper/metadata_merge_dicts.py 43 9 79% +build/helper/parameter_usage_options.py 58 0 100% +------------------------------------------------------------- +TOTAL 1632 247 85% +py312-build_test: commands[7]> coverage xml -o codegen.xml +Wrote XML report to codegen.xml +py312-build_test: commands[8]> coverage html --directory=generated/htmlcov/unit_tests/codegen +Wrote HTML report to generated/htmlcov/unit_tests/codegen/index.html +py312-build_test: commands[9]> flake8 --config=./tox.ini '--per-file-ignores=build/unit_tests/*.py:F403,F405' build/ +py312-build_test: OK ✔ in 2.39 seconds +py312-codegen: commands[0]> python --version +Python 3.12.10 +py312-codegen: commands[1]> python -c 'import platform; print(platform.architecture())' +('64bit', 'ELF') +py312-codegen: commands[2]> python -m pip install --disable-pip-version-check --upgrade pip +Requirement already satisfied: pip in ./.tox/64/py312-codegen/lib/python3.12/site-packages (25.1.1) +py312-codegen: commands[3]> make + +Making nifake + Generating: generated/nifake/nifake/_attributes.py + Generating: generated/nifake/nifake/enums.py + Generating: generated/nifake/nifake/_library.py + Generating: generated/nifake/nifake/_library_interpreter.py + Generating: generated/nifake/nifake/_library_singleton.py + Generating: generated/nifake/nifake/session.py + Generating: generated/nifake/nifake/errors.py + Generating: generated/nifake/nifake/unit_tests/_mock_helper.py + Generating: generated/nifake/nifake/unit_tests/_matchers.py + Generating: generated/nifake/nifake/__init__.py + Generating: generated/nifake/nifake/_converters.py + Generating: generated/nifake/nifake/_complextype.py + Generating: generated/nifake/nifake/VERSION + Generating: generated/nifake/nifake/_grpc_stub_interpreter.py + Generating: generated/nifake/nifake/grpc_session_options.py + Generating: generated/nifake/setup.py + Generating: generated/nifake/tox-system_tests.ini + Copying: generated/nifake/nifake/unit_tests/test_converters.py + Copying: generated/nifake/nifake/unit_tests/test_grpc.py + Copying: generated/nifake/nifake/unit_tests/test_library_interpreter.py + Copying: generated/nifake/nifake/unit_tests/test_library_singleton.py + Copying: generated/nifake/nifake/unit_tests/test_session.py + +Making nidcpower + +Making nidigital + +Making nidmm + +Making nifgen + +Making nirfsg + Generating: generated/nirfsg/nirfsg/_attributes.py + Generating: generated/nirfsg/nirfsg/enums.py + Generating: generated/nirfsg/nirfsg/_library.py + Generating: generated/nirfsg/nirfsg/_library_interpreter.py + Generating: generated/nirfsg/nirfsg/_library_singleton.py + Generating: generated/nirfsg/nirfsg/session.py +Warning: "Init" not found in function metadata. Typo? Generated code will be funky! +Warning: "Init" not found in function metadata. Typo? Generated code will be funky! +Warning: "WriteArbWaveform" not found in function metadata. Typo? Generated code will be funky! +Warning: "WriteArbWaveform" not found in function metadata. Typo? Generated code will be funky! +Warning: "WriteArbWaveform" not found in function metadata. Typo? Generated code will be funky! +Warning: "WriteArbWaveform" not found in function metadata. Typo? Generated code will be funky! +Warning: "GetTerminalName" not found in function metadata. Typo? Generated code will be funky! +Warning: "GetTerminalName" not found in function metadata. Typo? Generated code will be funky! +Warning: "ConfigureRf" not found in function metadata. Typo? Generated code will be funky! +Warning: "ConfigureRf" not found in function metadata. Typo? Generated code will be funky! +Warning: "RevisionQuery" not found in function metadata. Typo? Generated code will be funky! +Warning: "RevisionQuery" not found in function metadata. Typo? Generated code will be funky! +Warning: "Init" not found in function metadata. Typo? Generated code will be funky! +Warning: "Init" not found in function metadata. Typo? Generated code will be funky! +Warning: "GetTerminalName" not found in function metadata. Typo? Generated code will be funky! +Warning: "GetTerminalName" not found in function metadata. Typo? Generated code will be funky! +Warning: "WriteP2pEndpointI16" not found in function metadata. Typo? Generated code will be funky! +Warning: "WriteP2pEndpointI16" not found in function metadata. Typo? Generated code will be funky! +Warning: "WriteP2pEndpointI16" not found in function metadata. Typo? Generated code will be funky! +Warning: "WriteP2pEndpointI16" not found in function metadata. Typo? Generated code will be funky! +Warning: "ConfigureRf" not found in function metadata. Typo? Generated code will be funky! +Warning: "ConfigureRf" not found in function metadata. Typo? Generated code will be funky! +Warning: "ResetWithOptions" not found in function metadata. Typo? Generated code will be funky! +Warning: "ResetWithOptions" not found in function metadata. Typo? Generated code will be funky! +Warning: "GetTerminalName" not found in function metadata. Typo? Generated code will be funky! +Warning: "GetTerminalName" not found in function metadata. Typo? Generated code will be funky! +Warning: "GetTerminalName" not found in function metadata. Typo? Generated code will be funky! +Warning: "GetTerminalName" not found in function metadata. Typo? Generated code will be funky! +Warning: "GetTerminalName" not found in function metadata. Typo? Generated code will be funky! +Warning: "GetTerminalName" not found in function metadata. Typo? Generated code will be funky! +Warning: "ResetWithOptions" not found in function metadata. Typo? Generated code will be funky! +Warning: "ResetWithOptions" not found in function metadata. Typo? Generated code will be funky! +Warning: "ReadAndDownloadWaveformFromFileTdms" not found in function metadata. Typo? Generated code will be funky! +Warning: "ResetWithOptions" not found in function metadata. Typo? Generated code will be funky! +Warning: "ReadAndDownloadWaveformFromFileTdms" not found in function metadata. Typo? Generated code will be funky! +Warning: "ResetWithOptions" not found in function metadata. Typo? Generated code will be funky! +Warning: "WriteArbWaveform" not found in function metadata. Typo? Generated code will be funky! +Warning: "Init" not found in function metadata. Typo? Generated code will be funky! +Warning: "ResetWithOptions" not found in function metadata. Typo? Generated code will be funky! +Warning: "WriteArbWaveform" not found in function metadata. Typo? Generated code will be funky! +Warning: "WriteArbWaveform" not found in function metadata. Typo? Generated code will be funky! + Generating: generated/nirfsg/nirfsg/errors.py + Generating: generated/nirfsg/nirfsg/unit_tests/_mock_helper.py + Generating: generated/nirfsg/nirfsg/unit_tests/_matchers.py + Generating: generated/nirfsg/nirfsg/__init__.py + Generating: generated/nirfsg/nirfsg/_converters.py + Generating: generated/nirfsg/nirfsg/_complextype.py + Generating: generated/nirfsg/nirfsg/VERSION + Generating: docs/nirfsg/about_nirfsg.inc + Generating: docs/nirfsg/index.rst + Generating: docs/nirfsg/nirfsg.rst + Generating: docs/nirfsg/enums.rst + Generating: docs/nirfsg/examples.rst + Generating: docs/nirfsg/installation.inc + Generating: docs/nirfsg/status.inc + Generating: docs/nirfsg/class.rst +Warning: "WriteArbWaveform" not found in function metadata. Typo? Generated code will be funky! +Warning: "Init" not found in function metadata. Typo? Generated code will be funky! +Warning: "ResetWithOptions" not found in function metadata. Typo? Generated code will be funky! +Warning: "WriteArbWaveform" not found in function metadata. Typo? Generated code will be funky! +Warning: "WriteArbWaveform" not found in function metadata. Typo? Generated code will be funky! +Warning: "Init" not found in function metadata. Typo? Generated code will be funky! +Warning: "WriteArbWaveform" not found in function metadata. Typo? Generated code will be funky! +Warning: "WriteArbWaveform" not found in function metadata. Typo? Generated code will be funky! +Warning: "GetTerminalName" not found in function metadata. Typo? Generated code will be funky! +Warning: "ConfigureRf" not found in function metadata. Typo? Generated code will be funky! +Warning: "RevisionQuery" not found in function metadata. Typo? Generated code will be funky! +Warning: "Init" not found in function metadata. Typo? Generated code will be funky! +Warning: "GetTerminalName" not found in function metadata. Typo? Generated code will be funky! +Warning: "WriteP2pEndpointI16" not found in function metadata. Typo? Generated code will be funky! +Warning: "WriteP2pEndpointI16" not found in function metadata. Typo? Generated code will be funky! +Warning: "ConfigureRf" not found in function metadata. Typo? Generated code will be funky! +Warning: "ResetWithOptions" not found in function metadata. Typo? Generated code will be funky! +Warning: "GetTerminalName" not found in function metadata. Typo? Generated code will be funky! +Warning: "GetTerminalName" not found in function metadata. Typo? Generated code will be funky! +Warning: "GetTerminalName" not found in function metadata. Typo? Generated code will be funky! +Warning: "ResetWithOptions" not found in function metadata. Typo? Generated code will be funky! +Warning: "ReadAndDownloadWaveformFromFileTdms" not found in function metadata. Typo? Generated code will be funky! +Warning: "ResetWithOptions" not found in function metadata. Typo? Generated code will be funky! + Generating: docs/nirfsg/toc.inc + Generating: docs/nirfsg/errors.rst + Generating: docs/nirfsg/rep_caps.rst + Creating: generated/nirfsg/README.rst + Generating: generated/nirfsg/setup.py + Generating: generated/nirfsg/tox-system_tests.ini + Zipping: generated/examples/nirfsg_examples.zip + adding: nirfsg_arb_waveform.py (deflated 60%) + adding: nirfsg_script.py (deflated 60%) + Generating: docs/nirfsg/conf.py + Generating: docs/nirfsg/.readthedocs.yaml + +Making niscope + +Making niswitch + +Making nise + +Making nimodinst + +Making nitclk + +Making Global Files + Creating Root: README.rst +py312-codegen: OK ✔ in 8.14 seconds +py312-installers: commands[0]> python --version +Python 3.12.10 +py312-installers: commands[1]> python -c 'import platform; print(platform.architecture())' +('64bit', 'ELF') +py312-installers: commands[2]> python -m pip install --disable-pip-version-check --upgrade pip +Requirement already satisfied: pip in ./.tox/64/py312-installers/lib/python3.12/site-packages (25.1.1) +py312-installers: commands[3]> make installers + +Making nifake installers + +Making nidcpower installers + +Making nidigital installers + +Making nidmm installers + +Making nifgen installers + +Making nirfsg installers + +Making niscope installers + +Making niswitch installers + +Making nise installers + +Making nimodinst installers + +Making nitclk installers +py312-installers: OK ✔ in 0.6 seconds +py312-flake8: commands[0]> python --version +Python 3.12.10 +py312-flake8: commands[1]> python -c 'import platform; print(platform.architecture())' +('64bit', 'ELF') +py312-flake8: commands[2]> python -m pip install --disable-pip-version-check --upgrade pip +Requirement already satisfied: pip in ./.tox/64/py312-flake8/lib/python3.12/site-packages (25.1.1) +py312-flake8: commands[3]> flake8 --config=./tox.ini generated/ +py312-flake8: commands[4]> flake8 --config=./tox.ini tools/ +py312-flake8: commands[5]> flake8 --config=./tox.ini src/nidcpower/system_tests/ src/nidcpower/examples/ +py312-flake8: commands[6]> flake8 --config=./tox.ini src/nidigital/system_tests/ src/nidigital/examples/ +py312-flake8: commands[7]> flake8 --config=./tox.ini src/nidmm/system_tests/ src/nidmm/examples/ +py312-flake8: commands[8]> flake8 --config=./tox.ini src/nifgen/system_tests/ src/nifgen/examples/ +py312-flake8: commands[9]> flake8 --config=./tox.ini src/nimodinst/system_tests/ src/nimodinst/examples/ +py312-flake8: commands[10]> flake8 --config=./tox.ini src/niscope/system_tests/ src/niscope/examples/ +py312-flake8: commands[11]> flake8 --config=./tox.ini src/nise/system_tests/ src/nise/examples/ +py312-flake8: commands[12]> flake8 --config=./tox.ini src/niswitch/system_tests/ src/niswitch/examples/ +py312-flake8: commands[13]> flake8 --config=./tox.ini src/nitclk/system_tests/ src/nitclk/examples/ +py312-flake8: OK ✔ in 2.73 seconds +py312-docs: commands[0] /home/rahur/nimipythonmyfork/nimi-python/docs> python --version +Python 3.12.10 +py312-docs: commands[1] /home/rahur/nimipythonmyfork/nimi-python/docs> python -c 'import platform; print(platform.architecture())' +('64bit', 'ELF') +py312-docs: commands[2] /home/rahur/nimipythonmyfork/nimi-python/docs> sphinx-build -b html -d .tox/64/py312-docs/tmp/doctrees ./nidcpower ../generated/docs/nidcpower/html +Running Sphinx v8.2.3 +loading translations [en]... done +Converting `source_suffix = '.rst'` to `source_suffix = {'.rst': 'restructuredtext'}`. +loading pickled environment... failed: source directory has changed +done +loading intersphinx inventory 'python' from https://docs.python.org/3/objects.inv ... +loading intersphinx inventory 'nidigital' from https://nidigital.readthedocs.io/en/latest/objects.inv ... +loading intersphinx inventory 'nidmm' from https://nidmm.readthedocs.io/en/latest/objects.inv ... +loading intersphinx inventory 'nifgen' from https://nifgen.readthedocs.io/en/latest/objects.inv ... +loading intersphinx inventory 'nimodinst' from https://nimodinst.readthedocs.io/en/latest/objects.inv ... +loading intersphinx inventory 'nirfsg' from https://nirfsg.readthedocs.io/en/latest/objects.inv ... +loading intersphinx inventory 'niscope' from https://niscope.readthedocs.io/en/latest/objects.inv ... +loading intersphinx inventory 'nise' from https://nise.readthedocs.io/en/latest/objects.inv ... +loading intersphinx inventory 'niswitch' from https://niswitch.readthedocs.io/en/latest/objects.inv ... +loading intersphinx inventory 'nitclk' from https://nitclk.readthedocs.io/en/latest/objects.inv ... +building [mo]: targets for 0 po files that are out of date +writing output... +building [html]: targets for 8 source files that are out of date +updating environment: [new config] 8 added, 0 changed, 0 removed +reading sources... [ 12%] class +reading sources... [ 25%] enums +reading sources... [ 38%] errors +reading sources... [ 50%] examples +reading sources... [ 62%] grpc_session_options +reading sources... [ 75%] index +reading sources... [ 88%] nidcpower +reading sources... [100%] rep_caps + +looking for now-outdated files... none found +pickling environment... done +checking consistency... done +preparing documents... done +copying assets... +copying static files... +Writing evaluated template result to /home/rahur/nimipythonmyfork/nimi-python/generated/docs/nidcpower/html/_static/basic.css +Writing evaluated template result to /home/rahur/nimipythonmyfork/nimi-python/generated/docs/nidcpower/html/_static/language_data.js +Writing evaluated template result to /home/rahur/nimipythonmyfork/nimi-python/generated/docs/nidcpower/html/_static/documentation_options.js +Writing evaluated template result to /home/rahur/nimipythonmyfork/nimi-python/generated/docs/nidcpower/html/_static/js/versions.js +copying static files: done +copying extra files... +copying extra files: done +copying assets: done +writing output... [ 12%] class +writing output... [ 25%] enums +writing output... [ 38%] errors +writing output... [ 50%] examples +writing output... [ 62%] grpc_session_options +writing output... [ 75%] index +writing output... [ 88%] nidcpower +writing output... [100%] rep_caps + +generating indices... genindex py-modindex done +highlighting module code... +writing additional pages... search done +dumping search index in English (code: en)... done +dumping object inventory... done +build succeeded. + +The HTML pages are in ../generated/docs/nidcpower/html. +py312-docs: commands[3] /home/rahur/nimipythonmyfork/nimi-python/docs> sphinx-build -b html -d .tox/64/py312-docs/tmp/doctrees ./nidigital ../generated/docs/nidigital/html +Running Sphinx v8.2.3 +loading translations [en]... done +Converting `source_suffix = '.rst'` to `source_suffix = {'.rst': 'restructuredtext'}`. +loading pickled environment... failed: source directory has changed +done +loading intersphinx inventory 'python' from https://docs.python.org/3/objects.inv ... +loading intersphinx inventory 'nidcpower' from https://nidcpower.readthedocs.io/en/latest/objects.inv ... +loading intersphinx inventory 'nidmm' from https://nidmm.readthedocs.io/en/latest/objects.inv ... +loading intersphinx inventory 'nifgen' from https://nifgen.readthedocs.io/en/latest/objects.inv ... +loading intersphinx inventory 'nimodinst' from https://nimodinst.readthedocs.io/en/latest/objects.inv ... +loading intersphinx inventory 'nirfsg' from https://nirfsg.readthedocs.io/en/latest/objects.inv ... +loading intersphinx inventory 'niscope' from https://niscope.readthedocs.io/en/latest/objects.inv ... +loading intersphinx inventory 'nise' from https://nise.readthedocs.io/en/latest/objects.inv ... +loading intersphinx inventory 'niswitch' from https://niswitch.readthedocs.io/en/latest/objects.inv ... +loading intersphinx inventory 'nitclk' from https://nitclk.readthedocs.io/en/latest/objects.inv ... +building [mo]: targets for 0 po files that are out of date +writing output... +building [html]: targets for 8 source files that are out of date +updating environment: [new config] 8 added, 0 changed, 0 removed +reading sources... [ 12%] class +reading sources... [ 25%] enums +reading sources... [ 38%] errors +reading sources... [ 50%] examples +reading sources... [ 62%] grpc_session_options +reading sources... [ 75%] index +reading sources... [ 88%] nidigital +reading sources... [100%] rep_caps + +looking for now-outdated files... none found +pickling environment... done +checking consistency... done +preparing documents... done +copying assets... +copying static files... +Writing evaluated template result to /home/rahur/nimipythonmyfork/nimi-python/generated/docs/nidigital/html/_static/basic.css +Writing evaluated template result to /home/rahur/nimipythonmyfork/nimi-python/generated/docs/nidigital/html/_static/language_data.js +Writing evaluated template result to /home/rahur/nimipythonmyfork/nimi-python/generated/docs/nidigital/html/_static/documentation_options.js +Writing evaluated template result to /home/rahur/nimipythonmyfork/nimi-python/generated/docs/nidigital/html/_static/js/versions.js +copying static files: done +copying extra files... +copying extra files: done +copying assets: done +writing output... [ 12%] class +writing output... [ 25%] enums +writing output... [ 38%] errors +writing output... [ 50%] examples +writing output... [ 62%] grpc_session_options +writing output... [ 75%] index +writing output... [ 88%] nidigital +writing output... [100%] rep_caps + +generating indices... genindex py-modindex done +highlighting module code... +writing additional pages... search done +dumping search index in English (code: en)... done +dumping object inventory... done +build succeeded, 3 warnings. + +The HTML pages are in ../generated/docs/nidigital/html. +py312-docs: commands[4] /home/rahur/nimipythonmyfork/nimi-python/docs> sphinx-build -b html -d .tox/64/py312-docs/tmp/doctrees ./nidmm ../generated/docs/nidmm/html +Running Sphinx v8.2.3 +loading translations [en]... done +Converting `source_suffix = '.rst'` to `source_suffix = {'.rst': 'restructuredtext'}`. +loading pickled environment... failed: source directory has changed +done +loading intersphinx inventory 'python' from https://docs.python.org/3/objects.inv ... +loading intersphinx inventory 'nidcpower' from https://nidcpower.readthedocs.io/en/latest/objects.inv ... +loading intersphinx inventory 'nidigital' from https://nidigital.readthedocs.io/en/latest/objects.inv ... +loading intersphinx inventory 'nifgen' from https://nifgen.readthedocs.io/en/latest/objects.inv ... +loading intersphinx inventory 'nimodinst' from https://nimodinst.readthedocs.io/en/latest/objects.inv ... +loading intersphinx inventory 'nirfsg' from https://nirfsg.readthedocs.io/en/latest/objects.inv ... +loading intersphinx inventory 'niscope' from https://niscope.readthedocs.io/en/latest/objects.inv ... +loading intersphinx inventory 'nise' from https://nise.readthedocs.io/en/latest/objects.inv ... +loading intersphinx inventory 'niswitch' from https://niswitch.readthedocs.io/en/latest/objects.inv ... +loading intersphinx inventory 'nitclk' from https://nitclk.readthedocs.io/en/latest/objects.inv ... +building [mo]: targets for 0 po files that are out of date +writing output... +building [html]: targets for 7 source files that are out of date +updating environment: [new config] 7 added, 0 changed, 0 removed +reading sources... [ 14%] class +reading sources... [ 29%] enums +reading sources... [ 43%] errors +reading sources... [ 57%] examples +reading sources... [ 71%] grpc_session_options +reading sources... [ 86%] index +reading sources... [100%] nidmm + +looking for now-outdated files... none found +pickling environment... done +checking consistency... done +preparing documents... done +copying assets... +copying static files... +Writing evaluated template result to /home/rahur/nimipythonmyfork/nimi-python/generated/docs/nidmm/html/_static/basic.css +Writing evaluated template result to /home/rahur/nimipythonmyfork/nimi-python/generated/docs/nidmm/html/_static/language_data.js +Writing evaluated template result to /home/rahur/nimipythonmyfork/nimi-python/generated/docs/nidmm/html/_static/documentation_options.js +Writing evaluated template result to /home/rahur/nimipythonmyfork/nimi-python/generated/docs/nidmm/html/_static/js/versions.js +copying static files: done +copying extra files... +copying extra files: done +copying assets: done +writing output... [ 14%] class +writing output... [ 29%] enums +writing output... [ 43%] errors +writing output... [ 57%] examples +writing output... [ 71%] grpc_session_options +writing output... [ 86%] index +writing output... [100%] nidmm + +generating indices... genindex py-modindex done +highlighting module code... +writing additional pages... search done +dumping search index in English (code: en)... done +dumping object inventory... done +build succeeded. + +The HTML pages are in ../generated/docs/nidmm/html. +py312-docs: commands[5] /home/rahur/nimipythonmyfork/nimi-python/docs> sphinx-build -b html -d .tox/64/py312-docs/tmp/doctrees ./nifgen ../generated/docs/nifgen/html +Running Sphinx v8.2.3 +loading translations [en]... done +Converting `source_suffix = '.rst'` to `source_suffix = {'.rst': 'restructuredtext'}`. +loading pickled environment... failed: source directory has changed +done +loading intersphinx inventory 'python' from https://docs.python.org/3/objects.inv ... +loading intersphinx inventory 'nidcpower' from https://nidcpower.readthedocs.io/en/latest/objects.inv ... +loading intersphinx inventory 'nidigital' from https://nidigital.readthedocs.io/en/latest/objects.inv ... +loading intersphinx inventory 'nidmm' from https://nidmm.readthedocs.io/en/latest/objects.inv ... +loading intersphinx inventory 'nimodinst' from https://nimodinst.readthedocs.io/en/latest/objects.inv ... +loading intersphinx inventory 'nirfsg' from https://nirfsg.readthedocs.io/en/latest/objects.inv ... +loading intersphinx inventory 'niscope' from https://niscope.readthedocs.io/en/latest/objects.inv ... +loading intersphinx inventory 'nise' from https://nise.readthedocs.io/en/latest/objects.inv ... +loading intersphinx inventory 'niswitch' from https://niswitch.readthedocs.io/en/latest/objects.inv ... +loading intersphinx inventory 'nitclk' from https://nitclk.readthedocs.io/en/latest/objects.inv ... +building [mo]: targets for 0 po files that are out of date +writing output... +building [html]: targets for 8 source files that are out of date +updating environment: [new config] 8 added, 0 changed, 0 removed +reading sources... [ 12%] class +reading sources... [ 25%] enums +reading sources... [ 38%] errors +reading sources... [ 50%] examples +reading sources... [ 62%] grpc_session_options +reading sources... [ 75%] index +reading sources... [ 88%] nifgen +reading sources... [100%] rep_caps + +looking for now-outdated files... none found +pickling environment... done +checking consistency... done +preparing documents... done +copying assets... +copying static files... +Writing evaluated template result to /home/rahur/nimipythonmyfork/nimi-python/generated/docs/nifgen/html/_static/basic.css +Writing evaluated template result to /home/rahur/nimipythonmyfork/nimi-python/generated/docs/nifgen/html/_static/language_data.js +Writing evaluated template result to /home/rahur/nimipythonmyfork/nimi-python/generated/docs/nifgen/html/_static/documentation_options.js +Writing evaluated template result to /home/rahur/nimipythonmyfork/nimi-python/generated/docs/nifgen/html/_static/js/versions.js +copying static files: done +copying extra files... +copying extra files: done +copying assets: done +writing output... [ 12%] class +writing output... [ 25%] enums +writing output... [ 38%] errors +writing output... [ 50%] examples +writing output... [ 62%] grpc_session_options +writing output... [ 75%] index +writing output... [ 88%] nifgen +writing output... [100%] rep_caps + +generating indices... genindex py-modindex done +highlighting module code... +writing additional pages... search done +dumping search index in English (code: en)... done +dumping object inventory... done +build succeeded. + +The HTML pages are in ../generated/docs/nifgen/html. +py312-docs: commands[6] /home/rahur/nimipythonmyfork/nimi-python/docs> sphinx-build -b html -d .tox/64/py312-docs/tmp/doctrees ./nimodinst ../generated/docs/nimodinst/html +Running Sphinx v8.2.3 +loading translations [en]... done +Converting `source_suffix = '.rst'` to `source_suffix = {'.rst': 'restructuredtext'}`. +loading pickled environment... failed: source directory has changed +done +loading intersphinx inventory 'python' from https://docs.python.org/3/objects.inv ... +loading intersphinx inventory 'nidcpower' from https://nidcpower.readthedocs.io/en/latest/objects.inv ... +loading intersphinx inventory 'nidigital' from https://nidigital.readthedocs.io/en/latest/objects.inv ... +loading intersphinx inventory 'nidmm' from https://nidmm.readthedocs.io/en/latest/objects.inv ... +loading intersphinx inventory 'nifgen' from https://nifgen.readthedocs.io/en/latest/objects.inv ... +loading intersphinx inventory 'nirfsg' from https://nirfsg.readthedocs.io/en/latest/objects.inv ... +loading intersphinx inventory 'niscope' from https://niscope.readthedocs.io/en/latest/objects.inv ... +loading intersphinx inventory 'nise' from https://nise.readthedocs.io/en/latest/objects.inv ... +loading intersphinx inventory 'niswitch' from https://niswitch.readthedocs.io/en/latest/objects.inv ... +loading intersphinx inventory 'nitclk' from https://nitclk.readthedocs.io/en/latest/objects.inv ... +building [mo]: targets for 0 po files that are out of date +writing output... +building [html]: targets for 5 source files that are out of date +updating environment: [new config] 5 added, 0 changed, 0 removed +reading sources... [ 20%] class +reading sources... [ 40%] errors +reading sources... [ 60%] examples +reading sources... [ 80%] index +reading sources... [100%] nimodinst + +looking for now-outdated files... none found +pickling environment... done +checking consistency... done +preparing documents... done +copying assets... +copying static files... +Writing evaluated template result to /home/rahur/nimipythonmyfork/nimi-python/generated/docs/nimodinst/html/_static/basic.css +Writing evaluated template result to /home/rahur/nimipythonmyfork/nimi-python/generated/docs/nimodinst/html/_static/language_data.js +Writing evaluated template result to /home/rahur/nimipythonmyfork/nimi-python/generated/docs/nimodinst/html/_static/documentation_options.js +Writing evaluated template result to /home/rahur/nimipythonmyfork/nimi-python/generated/docs/nimodinst/html/_static/js/versions.js +copying static files: done +copying extra files... +copying extra files: done +copying assets: done +writing output... [ 20%] class +writing output... [ 40%] errors +writing output... [ 60%] examples +writing output... [ 80%] index +writing output... [100%] nimodinst + +generating indices... genindex py-modindex done +highlighting module code... +writing additional pages... search done +dumping search index in English (code: en)... done +dumping object inventory... done +build succeeded. + +The HTML pages are in ../generated/docs/nimodinst/html. +py312-docs: commands[7] /home/rahur/nimipythonmyfork/nimi-python/docs> sphinx-build -b html -d .tox/64/py312-docs/tmp/doctrees ./nirfsg ../generated/docs/nirfsg/html +Running Sphinx v8.2.3 +loading translations [en]... done +Converting `source_suffix = '.rst'` to `source_suffix = {'.rst': 'restructuredtext'}`. +loading pickled environment... failed: source directory has changed +done +loading intersphinx inventory 'python' from https://docs.python.org/3/objects.inv ... +loading intersphinx inventory 'nidcpower' from https://nidcpower.readthedocs.io/en/latest/objects.inv ... +loading intersphinx inventory 'nidigital' from https://nidigital.readthedocs.io/en/latest/objects.inv ... +loading intersphinx inventory 'nidmm' from https://nidmm.readthedocs.io/en/latest/objects.inv ... +loading intersphinx inventory 'nifgen' from https://nifgen.readthedocs.io/en/latest/objects.inv ... +loading intersphinx inventory 'nimodinst' from https://nimodinst.readthedocs.io/en/latest/objects.inv ... +loading intersphinx inventory 'niscope' from https://niscope.readthedocs.io/en/latest/objects.inv ... +loading intersphinx inventory 'nise' from https://nise.readthedocs.io/en/latest/objects.inv ... +loading intersphinx inventory 'niswitch' from https://niswitch.readthedocs.io/en/latest/objects.inv ... +loading intersphinx inventory 'nitclk' from https://nitclk.readthedocs.io/en/latest/objects.inv ... +building [mo]: targets for 0 po files that are out of date +writing output... +building [html]: targets for 7 source files that are out of date +updating environment: [new config] 7 added, 0 changed, 0 removed +reading sources... [ 14%] class +reading sources... [ 29%] enums +reading sources... [ 43%] errors +reading sources... [ 57%] examples +reading sources... [ 71%] index +reading sources... [ 86%] nirfsg +reading sources... [100%] rep_caps + +looking for now-outdated files... none found +pickling environment... done +checking consistency... done +preparing documents... done +copying assets... +copying static files... +Writing evaluated template result to /home/rahur/nimipythonmyfork/nimi-python/generated/docs/nirfsg/html/_static/basic.css +Writing evaluated template result to /home/rahur/nimipythonmyfork/nimi-python/generated/docs/nirfsg/html/_static/language_data.js +Writing evaluated template result to /home/rahur/nimipythonmyfork/nimi-python/generated/docs/nirfsg/html/_static/documentation_options.js +Writing evaluated template result to /home/rahur/nimipythonmyfork/nimi-python/generated/docs/nirfsg/html/_static/js/versions.js +copying static files: done +copying extra files... +copying extra files: done +copying assets: done +writing output... [ 14%] class +writing output... [ 29%] enums +writing output... [ 43%] errors +writing output... [ 57%] examples +writing output... [ 71%] index +writing output... [ 86%] nirfsg +writing output... [100%] rep_caps + +generating indices... genindex py-modindex done +highlighting module code... +writing additional pages... search done +dumping search index in English (code: en)... done +dumping object inventory... done +build succeeded, 17 warnings. + +The HTML pages are in ../generated/docs/nirfsg/html. +py312-docs: commands[8] /home/rahur/nimipythonmyfork/nimi-python/docs> sphinx-build -b html -d .tox/64/py312-docs/tmp/doctrees ./niscope ../generated/docs/niscope/html +Running Sphinx v8.2.3 +loading translations [en]... done +Converting `source_suffix = '.rst'` to `source_suffix = {'.rst': 'restructuredtext'}`. +loading pickled environment... failed: source directory has changed +done +loading intersphinx inventory 'python' from https://docs.python.org/3/objects.inv ... +loading intersphinx inventory 'nidcpower' from https://nidcpower.readthedocs.io/en/latest/objects.inv ... +loading intersphinx inventory 'nidigital' from https://nidigital.readthedocs.io/en/latest/objects.inv ... +loading intersphinx inventory 'nidmm' from https://nidmm.readthedocs.io/en/latest/objects.inv ... +loading intersphinx inventory 'nifgen' from https://nifgen.readthedocs.io/en/latest/objects.inv ... +loading intersphinx inventory 'nimodinst' from https://nimodinst.readthedocs.io/en/latest/objects.inv ... +loading intersphinx inventory 'nirfsg' from https://nirfsg.readthedocs.io/en/latest/objects.inv ... +loading intersphinx inventory 'nise' from https://nise.readthedocs.io/en/latest/objects.inv ... +loading intersphinx inventory 'niswitch' from https://niswitch.readthedocs.io/en/latest/objects.inv ... +loading intersphinx inventory 'nitclk' from https://nitclk.readthedocs.io/en/latest/objects.inv ... +building [mo]: targets for 0 po files that are out of date +writing output... +building [html]: targets for 8 source files that are out of date +updating environment: [new config] 8 added, 0 changed, 0 removed +reading sources... [ 12%] class +reading sources... [ 25%] enums +reading sources... [ 38%] errors +reading sources... [ 50%] examples +reading sources... [ 62%] grpc_session_options +reading sources... [ 75%] index +reading sources... [ 88%] niscope +reading sources... [100%] rep_caps + +looking for now-outdated files... none found +pickling environment... done +checking consistency... done +preparing documents... done +copying assets... +copying static files... +Writing evaluated template result to /home/rahur/nimipythonmyfork/nimi-python/generated/docs/niscope/html/_static/basic.css +Writing evaluated template result to /home/rahur/nimipythonmyfork/nimi-python/generated/docs/niscope/html/_static/language_data.js +Writing evaluated template result to /home/rahur/nimipythonmyfork/nimi-python/generated/docs/niscope/html/_static/documentation_options.js +Writing evaluated template result to /home/rahur/nimipythonmyfork/nimi-python/generated/docs/niscope/html/_static/js/versions.js +copying static files: done +copying extra files... +copying extra files: done +copying assets: done +writing output... [ 12%] class +writing output... [ 25%] enums +writing output... [ 38%] errors +writing output... [ 50%] examples +writing output... [ 62%] grpc_session_options +writing output... [ 75%] index +writing output... [ 88%] niscope +writing output... [100%] rep_caps + +generating indices... genindex py-modindex done +highlighting module code... +writing additional pages... search done +dumping search index in English (code: en)... done +dumping object inventory... done +build succeeded, 2 warnings. + +The HTML pages are in ../generated/docs/niscope/html. +py312-docs: commands[9] /home/rahur/nimipythonmyfork/nimi-python/docs> sphinx-build -b html -d .tox/64/py312-docs/tmp/doctrees ./nise ../generated/docs/nise/html +Running Sphinx v8.2.3 +loading translations [en]... done +Converting `source_suffix = '.rst'` to `source_suffix = {'.rst': 'restructuredtext'}`. +loading pickled environment... failed: source directory has changed +done +loading intersphinx inventory 'python' from https://docs.python.org/3/objects.inv ... +loading intersphinx inventory 'nidcpower' from https://nidcpower.readthedocs.io/en/latest/objects.inv ... +loading intersphinx inventory 'nidigital' from https://nidigital.readthedocs.io/en/latest/objects.inv ... +loading intersphinx inventory 'nidmm' from https://nidmm.readthedocs.io/en/latest/objects.inv ... +loading intersphinx inventory 'nifgen' from https://nifgen.readthedocs.io/en/latest/objects.inv ... +loading intersphinx inventory 'nimodinst' from https://nimodinst.readthedocs.io/en/latest/objects.inv ... +loading intersphinx inventory 'nirfsg' from https://nirfsg.readthedocs.io/en/latest/objects.inv ... +loading intersphinx inventory 'niscope' from https://niscope.readthedocs.io/en/latest/objects.inv ... +loading intersphinx inventory 'niswitch' from https://niswitch.readthedocs.io/en/latest/objects.inv ... +loading intersphinx inventory 'nitclk' from https://nitclk.readthedocs.io/en/latest/objects.inv ... +building [mo]: targets for 0 po files that are out of date +writing output... +building [html]: targets for 6 source files that are out of date +updating environment: [new config] 6 added, 0 changed, 0 removed +reading sources... [ 17%] class +reading sources... [ 33%] enums +reading sources... [ 50%] errors +reading sources... [ 67%] examples +reading sources... [ 83%] index +reading sources... [100%] nise + +looking for now-outdated files... none found +pickling environment... done +checking consistency... done +preparing documents... done +copying assets... +copying static files... +Writing evaluated template result to /home/rahur/nimipythonmyfork/nimi-python/generated/docs/nise/html/_static/basic.css +Writing evaluated template result to /home/rahur/nimipythonmyfork/nimi-python/generated/docs/nise/html/_static/language_data.js +Writing evaluated template result to /home/rahur/nimipythonmyfork/nimi-python/generated/docs/nise/html/_static/documentation_options.js +Writing evaluated template result to /home/rahur/nimipythonmyfork/nimi-python/generated/docs/nise/html/_static/js/versions.js +copying static files: done +copying extra files... +copying extra files: done +copying assets: done +writing output... [ 17%] class +writing output... [ 33%] enums +writing output... [ 50%] errors +writing output... [ 67%] examples +writing output... [ 83%] index +writing output... [100%] nise + +generating indices... genindex py-modindex done +highlighting module code... +writing additional pages... search done +dumping search index in English (code: en)... done +dumping object inventory... done +build succeeded. + +The HTML pages are in ../generated/docs/nise/html. +py312-docs: commands[10] /home/rahur/nimipythonmyfork/nimi-python/docs> sphinx-build -b html -d .tox/64/py312-docs/tmp/doctrees ./niswitch ../generated/docs/niswitch/html +Running Sphinx v8.2.3 +loading translations [en]... done +Converting `source_suffix = '.rst'` to `source_suffix = {'.rst': 'restructuredtext'}`. +loading pickled environment... failed: source directory has changed +done +loading intersphinx inventory 'python' from https://docs.python.org/3/objects.inv ... +loading intersphinx inventory 'nidcpower' from https://nidcpower.readthedocs.io/en/latest/objects.inv ... +loading intersphinx inventory 'nidigital' from https://nidigital.readthedocs.io/en/latest/objects.inv ... +loading intersphinx inventory 'nidmm' from https://nidmm.readthedocs.io/en/latest/objects.inv ... +loading intersphinx inventory 'nifgen' from https://nifgen.readthedocs.io/en/latest/objects.inv ... +loading intersphinx inventory 'nimodinst' from https://nimodinst.readthedocs.io/en/latest/objects.inv ... +loading intersphinx inventory 'nirfsg' from https://nirfsg.readthedocs.io/en/latest/objects.inv ... +loading intersphinx inventory 'niscope' from https://niscope.readthedocs.io/en/latest/objects.inv ... +loading intersphinx inventory 'nise' from https://nise.readthedocs.io/en/latest/objects.inv ... +loading intersphinx inventory 'nitclk' from https://nitclk.readthedocs.io/en/latest/objects.inv ... +building [mo]: targets for 0 po files that are out of date +writing output... +building [html]: targets for 8 source files that are out of date +updating environment: [new config] 8 added, 0 changed, 0 removed +reading sources... [ 12%] class +reading sources... [ 25%] enums +reading sources... [ 38%] errors +reading sources... [ 50%] examples +reading sources... [ 62%] grpc_session_options +reading sources... [ 75%] index +reading sources... [ 88%] niswitch +reading sources... [100%] rep_caps + +looking for now-outdated files... none found +pickling environment... done +checking consistency... done +preparing documents... done +copying assets... +copying static files... +Writing evaluated template result to /home/rahur/nimipythonmyfork/nimi-python/generated/docs/niswitch/html/_static/basic.css +Writing evaluated template result to /home/rahur/nimipythonmyfork/nimi-python/generated/docs/niswitch/html/_static/language_data.js +Writing evaluated template result to /home/rahur/nimipythonmyfork/nimi-python/generated/docs/niswitch/html/_static/documentation_options.js +Writing evaluated template result to /home/rahur/nimipythonmyfork/nimi-python/generated/docs/niswitch/html/_static/js/versions.js +copying static files: done +copying extra files... +copying extra files: done +copying assets: done +writing output... [ 12%] class +writing output... [ 25%] enums +writing output... [ 38%] errors +writing output... [ 50%] examples +writing output... [ 62%] grpc_session_options +writing output... [ 75%] index +writing output... [ 88%] niswitch +writing output... [100%] rep_caps + +generating indices... genindex py-modindex done +highlighting module code... +writing additional pages... search done +dumping search index in English (code: en)... done +dumping object inventory... done +build succeeded. + +The HTML pages are in ../generated/docs/niswitch/html. +py312-docs: commands[11] /home/rahur/nimipythonmyfork/nimi-python/docs> sphinx-build -b html -d .tox/64/py312-docs/tmp/doctrees ./nitclk ../generated/docs/nitclk/html +Running Sphinx v8.2.3 +loading translations [en]... done +Converting `source_suffix = '.rst'` to `source_suffix = {'.rst': 'restructuredtext'}`. +loading pickled environment... failed: source directory has changed +done +loading intersphinx inventory 'python' from https://docs.python.org/3/objects.inv ... +loading intersphinx inventory 'nidcpower' from https://nidcpower.readthedocs.io/en/latest/objects.inv ... +loading intersphinx inventory 'nidigital' from https://nidigital.readthedocs.io/en/latest/objects.inv ... +loading intersphinx inventory 'nidmm' from https://nidmm.readthedocs.io/en/latest/objects.inv ... +loading intersphinx inventory 'nifgen' from https://nifgen.readthedocs.io/en/latest/objects.inv ... +loading intersphinx inventory 'nimodinst' from https://nimodinst.readthedocs.io/en/latest/objects.inv ... +loading intersphinx inventory 'nirfsg' from https://nirfsg.readthedocs.io/en/latest/objects.inv ... +loading intersphinx inventory 'niscope' from https://niscope.readthedocs.io/en/latest/objects.inv ... +loading intersphinx inventory 'nise' from https://nise.readthedocs.io/en/latest/objects.inv ... +loading intersphinx inventory 'niswitch' from https://niswitch.readthedocs.io/en/latest/objects.inv ... +building [mo]: targets for 0 po files that are out of date +writing output... +building [html]: targets for 5 source files that are out of date +updating environment: [new config] 5 added, 0 changed, 0 removed +reading sources... [ 20%] class +reading sources... [ 40%] errors +reading sources... [ 60%] examples +reading sources... [ 80%] index +reading sources... [100%] nitclk + +looking for now-outdated files... none found +pickling environment... done +checking consistency... done +preparing documents... done +copying assets... +copying static files... +Writing evaluated template result to /home/rahur/nimipythonmyfork/nimi-python/generated/docs/nitclk/html/_static/basic.css +Writing evaluated template result to /home/rahur/nimipythonmyfork/nimi-python/generated/docs/nitclk/html/_static/language_data.js +Writing evaluated template result to /home/rahur/nimipythonmyfork/nimi-python/generated/docs/nitclk/html/_static/documentation_options.js +Writing evaluated template result to /home/rahur/nimipythonmyfork/nimi-python/generated/docs/nitclk/html/_static/js/versions.js +copying static files: done +copying extra files... +copying extra files: done +copying assets: done +writing output... [ 20%] class +writing output... [ 40%] errors +writing output... [ 60%] examples +writing output... [ 80%] index +writing output... [100%] nitclk + +generating indices... genindex py-modindex done +highlighting module code... +writing additional pages... search done +dumping search index in English (code: en)... done +dumping object inventory... done +build succeeded. + +The HTML pages are in ../generated/docs/nitclk/html. +py312-docs: OK ✔ in 30.64 seconds +py39-test: skipped because could not find python interpreter with spec(s): py39 +py39-test: SKIP ⚠ in 0.18 seconds +py310-test: commands[0]> python --version +Python 3.10.12 +py310-test: commands[1]> python -c 'import platform; print(platform.architecture())' +('64bit', 'ELF') +py310-test: commands[2]> python -m pip install --disable-pip-version-check --upgrade pip +Requirement already satisfied: pip in ./.tox/64/py310-test/lib/python3.10/site-packages (25.1.1) +py310-test: commands[3]> python tools/install_local_wheel.py --driver nitclk +Processing ./generated/nitclk/dist/nitclk-1.4.10.dev0-py3-none-any.whl +Requirement already satisfied: hightime>=0.2.0 in ./.tox/64/py310-test/lib/python3.10/site-packages (from nitclk==1.4.10.dev0) (0.2.2) +nitclk is already installed with the same version as the provided wheel. Use --force-reinstall to force an installation of the wheel. +py310-test: commands[4]> coverage run --rcfile=tools/coverage_unit_tests.rc --source nifake -m pytest generated/nifake/nifake -s +============================= test session starts ============================== +platform linux -- Python 3.10.12, pytest-8.3.5, pluggy-1.5.0 -- /home/rahur/nimipythonmyfork/nimi-python/.tox/64/py310-test/bin/python +cachedir: .tox/64/py310-test/.pytest_cache +rootdir: /home/rahur/nimipythonmyfork/nimi-python +configfile: tox.ini +plugins: timeout-2.4.0 +collecting ... collected 251 items + +generated/nifake/nifake/unit_tests/test_converters.py::test_convert_init_with_options_dictionary PASSED +generated/nifake/nifake/unit_tests/test_converters.py::test_convert_timedelta_to_seconds_double PASSED +generated/nifake/nifake/unit_tests/test_converters.py::test_convert_timedelta_to_milliseconds_int32 PASSED +generated/nifake/nifake/unit_tests/test_converters.py::test_convert_timedeltas_to_seconds_real64 PASSED +generated/nifake/nifake/unit_tests/test_converters.py::test_convert_seconds_real64_to_timedelta PASSED +generated/nifake/nifake/unit_tests/test_converters.py::test_convert_seconds_real64_to_timedeltas PASSED +generated/nifake/nifake/unit_tests/test_converters.py::test_repeated_capabilities_string_channel PASSED +generated/nifake/nifake/unit_tests/test_converters.py::test_repeated_capabilities_string_prefix PASSED +generated/nifake/nifake/unit_tests/test_converters.py::test_repeated_capabilities_list_channel PASSED +generated/nifake/nifake/unit_tests/test_converters.py::test_repeated_capabilities_list_prefix PASSED +generated/nifake/nifake/unit_tests/test_converters.py::test_repeated_capabilities_tuple_channel PASSED +generated/nifake/nifake/unit_tests/test_converters.py::test_repeated_capabilities_tuple_prefix PASSED +generated/nifake/nifake/unit_tests/test_converters.py::test_repeated_capabilities_unicode PASSED +generated/nifake/nifake/unit_tests/test_converters.py::test_repeated_capabilities_raw PASSED +generated/nifake/nifake/unit_tests/test_converters.py::test_repeated_capabilities_slice_channel PASSED +generated/nifake/nifake/unit_tests/test_converters.py::test_repeated_capabilities_mixed_channel PASSED +generated/nifake/nifake/unit_tests/test_converters.py::test_repeated_capabilities_mixed_prefix PASSED +generated/nifake/nifake/unit_tests/test_converters.py::test_invalid_repeated_capabilities PASSED +generated/nifake/nifake/unit_tests/test_converters.py::test_repeated_capabilities_slice_prefix PASSED +generated/nifake/nifake/unit_tests/test_converters.py::test_repeated_capabilities_without_prefix PASSED +generated/nifake/nifake/unit_tests/test_converters.py::test_repeated_capabilities_string_resource_name PASSED +generated/nifake/nifake/unit_tests/test_converters.py::test_repeated_capabilities_list_resource_name PASSED +generated/nifake/nifake/unit_tests/test_converters.py::test_repeated_capabilities_tuple_resource_name PASSED +generated/nifake/nifake/unit_tests/test_converters.py::test_repeated_capabilities_mixed_resource_name PASSED +generated/nifake/nifake/unit_tests/test_converters.py::test_repeated_capabilities_invalid_resource_names PASSED +generated/nifake/nifake/unit_tests/test_converters.py::test_expand_channel_string_non_fully_qualified_channel_names PASSED +generated/nifake/nifake/unit_tests/test_converters.py::test_expand_channel_string_fully_qualified_channel_names PASSED +generated/nifake/nifake/unit_tests/test_converters.py::test_convert_chained_repeated_capability_to_parts_three_parts PASSED +generated/nifake/nifake/unit_tests/test_converters.py::test_convert_chained_repeated_capability_to_parts_single_part PASSED +generated/nifake/nifake/unit_tests/test_converters.py::test_convert_chained_repeated_capability_to_parts_empty_string PASSED +generated/nifake/nifake/unit_tests/test_converters.py::test_string_to_list_channel PASSED +generated/nifake/nifake/unit_tests/test_converters.py::test_string_to_list_prefix PASSED +generated/nifake/nifake/unit_tests/test_converters.py::test_convert_comma_separated_string_to_list PASSED +generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_server_unavailable PASSED +generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_function_not_implemented PASSED +generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_api_key_sent_to_init PASSED +generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_new_session_already_exists PASSED +generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_attach_to_non_existent_session PASSED +generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_lock_unlock PASSED +generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_simple_function PASSED +generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_get_a_number PASSED +generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_one_input_function PASSED +generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_vi_int_64_function PASSED +generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_two_input_function PASSED +generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_get_enum_value PASSED +generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_get_a_list_enums PASSED +generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_get_a_boolean PASSED +generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_get_a_list_booleans PASSED +generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_single_point_read_nan PASSED +generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_fetch_waveform PASSED +generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_fetch_waveform_into PASSED +generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_write_waveform PASSED +generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_write_waveform_numpy PASSED +generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_return_multiple_types PASSED +generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_multiple_array_types PASSED +generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_multiple_array_types_none_input PASSED +generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_multiple_arrays_same_size PASSED +generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_multiple_arrays_same_size_none_input PASSED +generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_multiple_arrays_same_size_wrong_size PASSED +generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_parameters_are_multiple_types PASSED +generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_method_with_error PASSED +generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_call_not_enough_parameters_error PASSED +generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_invalid_method_call_wrong_type_error PASSED +generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_method_with_warning PASSED +generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_read_with_warning PASSED +generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_get_a_string_of_fixed_maximum_size PASSED +generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_return_a_number_and_a_string PASSED +generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_get_an_ivi_dance_char_array PASSED +generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_get_string_ivi_dance_error PASSED +generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_get_an_ivi_dance_with_a_twist_string PASSED +generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_get_array_using_ivi_dance PASSED +generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_get_attribute_int32 PASSED +generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_set_attribute_int32 PASSED +generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_get_attribute_real64 PASSED +generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_set_attribute_real64 PASSED +generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_get_attribute_string PASSED +generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_set_attribute_string PASSED +generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_get_attribute_boolean PASSED +generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_set_attribute_boolean PASSED +generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_get_attribute_int64 PASSED +generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_set_attribute_int64 PASSED +generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_error_message_returns_error PASSED +generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_set_custom_type PASSED +generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_get_custom_type PASSED +generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_set_custom_type_array PASSED +generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_get_custom_type_array PASSED +generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_get_custom_type_typedef PASSED +generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_get_cal_date_time PASSED +generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_import_attribute_configuration_buffer PASSED +generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_missing_function PASSED +generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_simple_function PASSED +generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_get_a_number PASSED +generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_one_input_function PASSED +generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_vi_int_64_function PASSED +generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_two_input_function PASSED +generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_get_enum_value PASSED +generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_get_a_list_enums PASSED +generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_get_a_boolean PASSED +generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_get_a_list_booleans PASSED +generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_single_point_read_nan PASSED +generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_fetch_waveform PASSED +generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_fetch_waveform_into PASSED +generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_write_waveform PASSED +generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_write_waveform_numpy PASSED +generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_return_multiple_types PASSED +generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_multiple_array_types PASSED +generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_multiple_array_types_none_input PASSED +generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_multiple_arrays_same_size PASSED +generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_multiple_arrays_same_size_none_input PASSED +generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_parameters_are_multiple_types PASSED +generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_method_with_error PASSED +generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_call_not_enough_parameters_error PASSED +generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_invalid_method_call_wrong_type_error PASSED +generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_method_with_warning PASSED +generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_read_with_warning PASSED +generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_library_interpreter_always_uses_same_library_instance PASSED +generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_set_runtime_environment_is_called_once_if_present PASSED +generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_set_runtime_environment_not_present_in_driver_runtime PASSED +generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_get_a_string_of_fixed_maximum_size PASSED +generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_get_a_string_of_size_python_code PASSED +generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_return_a_number_and_a_string PASSED +generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_get_an_ivi_dance_char_array PASSED +generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_get_string_ivi_dance_error PASSED +generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_get_an_ivi_dance_with_a_twist_string PASSED +generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_get_array_using_ivi_dance PASSED +generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_get_attribute_int32 PASSED +generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_set_attribute_int32 PASSED +generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_get_attribute_real64 PASSED +generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_set_attribute_real64 PASSED +generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_get_attribute_string PASSED +generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_set_attribute_string PASSED +generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_get_attribute_boolean PASSED +generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_set_attribute_boolean PASSED +generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_get_attribute_int64 PASSED +generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_set_attribute_int64 PASSED +generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_get_error_returns_mismatched_error_code PASSED +generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_get_error_and_error_message_returns_error PASSED +generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_get_error_description_error_message_error PASSED +generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_set_custom_type PASSED +generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_get_custom_type PASSED +generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_set_custom_type_array PASSED +generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_get_custom_type_array PASSED +generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_get_custom_type_typedef PASSED +generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_get_array_using_python_code_double PASSED +generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_get_array_using_python_code_custom_type PASSED +generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_get_cal_date_time PASSED +generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_import_attribute_configuration_buffer_list_i8 PASSED +generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_import_attribute_configuration_buffer_bytes PASSED +generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_import_attribute_configuration_buffer_bytearray PASSED +generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_import_attribute_configuration_buffer_array_bytes PASSED +generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_import_attribute_configuration_buffer_str PASSED +generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_write_numpy_complex128_valid_input PASSED +generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_write_waveform_complex_f64_invalid_input PASSED +generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_write_interleaved_complexi16_invalid_input PASSED +generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_write_interleaved_complexi16_valid_input PASSED +generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_matcher_prints PASSED +generated/nifake/nifake/unit_tests/test_library_singleton.py::test_driver_runtime_not_installed_raises_driver_not_installed_error PASSED +generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_init_with_options_and_close PASSED +generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_init_with_options_nondefault_and_close PASSED +generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_close PASSED +generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_session_context_manager PASSED +generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_init_with_error PASSED +generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_close_with_error PASSED +generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_session_context_manager_init_with_error PASSED +generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_session_context_manager_close_with_error PASSED +generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_lock_session_none PASSED +generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_unlock_session_none PASSED +generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_lock_context_manager PASSED +generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_lock_context_manager_abnormal_exit PASSED +generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_self_test PASSED +generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_self_test_fail PASSED +generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_acquisition_context_manager PASSED +generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_acquisition_no_context_manager PASSED +generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_single_point_read_timedelta PASSED +generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_enum_input_function_with_defaults PASSED +generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_string_valued_enum_input_function_with_defaults PASSED +generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_fetch_waveform_into_wrong_type PASSED +generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_parameters_are_multiple_types_error PASSED +generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_error_with_rep_cap PASSED +generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_call_not_enough_parameters_error PASSED +generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_enum_input_function_with_defaults_bad_type_error PASSED +generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_get_channel_names PASSED +generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_repeated_capability_method_on_session_timedelta PASSED +generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_repeated_capability_method_on_specific_channel PASSED +generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_device_method_not_exist_on_repeated_capability_error PASSED +generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_repeated_capabilities_list PASSED +generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_chained_repeated_capabilities_list PASSED +generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_chained_repeated_capability_method_on_specific_channel PASSED +generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_function_with_repeated_capability_type PASSED +generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_get_attribute_int32 PASSED +generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_set_attribute_int32 PASSED +generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_get_attribute_int32_with_converter PASSED +generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_set_attribute_int32_with_converter PASSED +generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_get_attribute_real64 PASSED +generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_set_attribute_real64 PASSED +generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_get_attribute_real64_with_converter PASSED +generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_set_attribute_real64_with_converter PASSED +generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_get_attribute_string PASSED +generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_set_attribute_string PASSED +generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_get_attribute_string_with_converter PASSED +generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_set_attribute_string_with_converter PASSED +generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_get_attribute_boolean PASSED +generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_set_attribute_boolean PASSED +generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_get_attribute_enum_int32 PASSED +generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_set_attribute_enum_int32 PASSED +generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_get_attribute_enum_real64 PASSED +generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_set_attribute_enum_real64 PASSED +generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_get_attribute_enum_with_converter PASSED +generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_get_attribute_enum_with_converter_invalid_value_from_driver PASSED +generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_set_attribute_enum_with_converter PASSED +generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_set_attribute_enum_with_converter_invalid_input PASSED +generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_get_attribute_channel PASSED +generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_set_attribute_channel PASSED +generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_get_attribute_int64 PASSED +generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_set_attribute_int64 PASSED +generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_get_attribute_error PASSED +generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_set_attribute_error PASSED +generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_add_properties_to_session_error_set PASSED +generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_add_properties_to_session_error_get PASSED +generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_add_properties_to_repeated_capability_error_set PASSED +generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_add_properties_to_repeated_capability_error_get PASSED +generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_set_enum_attribute_int32_error PASSED +generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_set_wrong_enum_attribute_int32_error PASSED +generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_multiple_arrays_same_size_wrong_size_2 PASSED +generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_multiple_arrays_same_size_wrong_size_3 PASSED +generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_multiple_arrays_same_size_wrong_size_4 PASSED +generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_get_cal_date_time PASSED +generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_get_cal_interval PASSED +generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_import_attribute_configuration_buffer_list_i8_big PASSED +generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_import_attribute_configuration_buffer_list_i8_float PASSED +generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_import_attribute_configuration_buffer_list_i8_big_float PASSED +generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_export_attribute_configuration_buffer PASSED +generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_channel_on_session PASSED +generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_function_name PASSED +generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_buffer_converter PASSED +generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_nitclk_integration PASSED +generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_accept_list_of_time_values_as_floats PASSED +generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_accept_array_of_time_values_as_floats PASSED +generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_accept_list_of_time_values_as_timedelta_instances PASSED +generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_return_timedelta PASSED +generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_return_timedeltas PASSED +generated/nifake/nifake/unit_tests/test_session.py::TestGrpcSession::test_init_with_options_and_close PASSED +generated/nifake/nifake/unit_tests/test_session.py::TestGrpcSession::test_lock_session_none PASSED +generated/nifake/nifake/unit_tests/test_session.py::TestGrpcSession::test_unlock_session_none PASSED +generated/nifake/nifake/unit_tests/test_session.py::TestGrpcSession::test_lock_context_manager PASSED +generated/nifake/nifake/unit_tests/test_session.py::TestGrpcSession::test_lock_context_manager_abnormal_exit PASSED +generated/nifake/nifake/unit_tests/test_session.py::TestGrpcSession::test_self_test PASSED +generated/nifake/nifake/unit_tests/test_session.py::TestGrpcSession::test_export_attribute_configuration_buffer PASSED +generated/nifake/nifake/unit_tests/test_session.py::TestGrpcSession::test_get_attribute_int32 PASSED +generated/nifake/nifake/unit_tests/test_session.py::test_diagnostic_information OS: + Name: Linux + Version: #1 SMP Tue Nov 5 00:21:55 UTC 2024 + Bits: 64 +Driver: + Name: NI-FAKE + Version: Unknown +Module: + Name: nifake + Version: 1.4.10.dev0 +Python: + Version: 3.10.12 (main, Feb 4 2025, 14:57:36) [GCC 11.4.0] + Bits: 64 + Is_Venv: True + Installed Packages: + Mako==1.3.10 + MarkupSafe==3.0.2 + coverage==7.8.0 + grpcio==1.67.0 + hightime==0.2.2 + nifake==1.4.10.dev0 + nitclk==1.4.10.dev0 + pip==25.1.1 + pluggy==1.5.0 + pytest==8.3.5 + pytest-timeout==2.4.0 + setuptools==80.3.1 +PASSED +generated/nifake/nifake/unit_tests/test_session.py::test_dunder_version Version = 1.4.10.dev0 +PASSED + +============================= 251 passed in 7.26s ============================== +py310-test: commands[5]> coverage report +Name Stmts Miss Cover +----------------------------------------------------------------------------- +generated/nifake/nifake/__init__.py 76 14 82% +generated/nifake/nifake/_attributes.py 79 3 96% +generated/nifake/nifake/_complextype.py 8 0 100% +generated/nifake/nifake/_converters.py 132 6 95% +generated/nifake/nifake/_grpc_stub_interpreter.py 244 40 84% +generated/nifake/nifake/_visatype.py 19 0 100% +generated/nifake/nifake/custom_struct.py 28 3 89% +generated/nifake/nifake/custom_struct_nested_typedef.py 26 2 92% +generated/nifake/nifake/custom_struct_typedef.py 24 2 92% +generated/nifake/nifake/enums.py 42 0 100% +generated/nifake/nifake/errors.py 61 3 95% +generated/nifake/nifake/grpc_session_options.py 16 0 100% +generated/nifake/nifake/session.py 465 107 77% +----------------------------------------------------------------------------- +TOTAL 1220 180 85% +py310-test: commands[6]> coverage xml -o nifakeunittest.xml +Wrote XML report to nifakeunittest.xml +py310-test: commands[7]> coverage html --directory=generated/htmlcov/unit_tests/nifake +Wrote HTML report to generated/htmlcov/unit_tests/nifake/index.html +py310-test: commands[8]> coverage run --rcfile=tools/coverage_unit_tests.rc --source nidcpower -m pytest generated/nidcpower/nidcpower -s +============================= test session starts ============================== +platform linux -- Python 3.10.12, pytest-8.3.5, pluggy-1.5.0 -- /home/rahur/nimipythonmyfork/nimi-python/.tox/64/py310-test/bin/python +cachedir: .tox/64/py310-test/.pytest_cache +rootdir: /home/rahur/nimipythonmyfork/nimi-python +configfile: tox.ini +plugins: timeout-2.4.0 +collecting ... collected 7 items + +generated/nidcpower/nidcpower/unit_tests/test_nidcpower.py::test_lcr_measurement[ctype_members0-Dev1/0-expected_python_members0-Channel : Dev1/0\nDC voltage : 0.1 V\nDC current : 0.001 A\nStimulus frequency : 10,000 Hz\nAC voltage : 1+0.1j V RMS\nAC current : 0.01+0.001j A RMS\nImpedance : 100+10j \u03a9\nImpedance magnitude : 100.499 \u03a9\nImpedance phase : 5.71059 \xb0\nAdmittance : 0.00990099-0.000990099j S\nAdmittance magnitude: 0.00995037 S\nAdmittance phase : -5.71059 \xb0\nSeries inductance : 10 H\nSeries capacitance : 20 F\nSeries resistance : 90 \u03a9\nParallel inductance : 30 H\nParallel capacitance: 40 F\nParallel resistance : 110 \u03a9\nDissipation factor : 10\nQuality factor : 0.1\nMeasurement mode : SMU_PS\nDC in compliance : True\nAC in compliance : True\nUnbalanced : True\n] PASSED +generated/nidcpower/nidcpower/unit_tests/test_nidcpower.py::test_lcr_measurement[ctype_members1-1-expected_python_members1-Channel : 1\nDC voltage : 0 V\nDC current : 0 A\nStimulus frequency : 0 Hz\nAC voltage : 0+0j V RMS\nAC current : 0+0j A RMS\nImpedance : 0+0j \u03a9\nImpedance magnitude : 0 \u03a9\nImpedance phase : 0 \xb0\nAdmittance : nan+nanj S\nAdmittance magnitude: nan S\nAdmittance phase : nan \xb0\nSeries inductance : 0 H\nSeries capacitance : 0 F\nSeries resistance : 0 \u03a9\nParallel inductance : 0 H\nParallel capacitance: 0 F\nParallel resistance : 0 \u03a9\nDissipation factor : 0\nQuality factor : nan\nMeasurement mode : LCR\nDC in compliance : False\nAC in compliance : False\nUnbalanced : False\n] PASSED +generated/nidcpower/nidcpower/unit_tests/test_nidcpower.py::test_lcr_load_compensation_spot[python_init_params0-nidcpower.lcr_load_compensation_spot.LCRLoadCompensationSpot(frequency=200.0, reference_value_type=nidcpower.enums.LCRReferenceValueType.IMPEDANCE, reference_value=(3+4j))-Frequency : 200 Hz\nImpedance : 3+4j \u03a9\n-expected_ctype_members0] PASSED +generated/nidcpower/nidcpower/unit_tests/test_nidcpower.py::test_lcr_load_compensation_spot[python_init_params1-nidcpower.lcr_load_compensation_spot.LCRLoadCompensationSpot(frequency=300.0, reference_value_type=nidcpower.enums.LCRReferenceValueType.IDEAL_CAPACITANCE, reference_value=5.0)-Frequency : 300 Hz\nIdeal Capacitance: 5 F\n-expected_ctype_members1] PASSED +generated/nidcpower/nidcpower/unit_tests/test_nidcpower.py::test_lcr_load_compensation_spot[python_init_params2-nidcpower.lcr_load_compensation_spot.LCRLoadCompensationSpot(frequency=400.0, reference_value_type=nidcpower.enums.LCRReferenceValueType.IDEAL_INDUCTANCE, reference_value=6.0)-Frequency : 400 Hz\nIdeal Inductance : 6 H\n-expected_ctype_members2] PASSED +generated/nidcpower/nidcpower/unit_tests/test_nidcpower.py::test_lcr_load_compensation_spot[python_init_params3-nidcpower.lcr_load_compensation_spot.LCRLoadCompensationSpot(frequency=500.0, reference_value_type=nidcpower.enums.LCRReferenceValueType.IDEAL_RESISTANCE, reference_value=7.0)-Frequency : 500 Hz\nIdeal Resistance : 7 \u03a9\n-expected_ctype_members3] PASSED +generated/nidcpower/nidcpower/unit_tests/test_nidcpower.py::test_lcr_load_compensation_spot_byte_packing_alignment PASSED + +============================== 7 passed in 0.32s =============================== +py310-test: commands[9]> coverage report +Name Stmts Miss Cover +--------------------------------------------------------------------------------- +generated/nidcpower/nidcpower/lcr_load_compensation_spot.py 33 5 85% +generated/nidcpower/nidcpower/lcr_measurement.py 53 4 92% +--------------------------------------------------------------------------------- +TOTAL 86 9 90% +py310-test: commands[10]> coverage xml -o nidcpowerunittest.xml +Wrote XML report to nidcpowerunittest.xml +py310-test: commands[11]> coverage html --directory=generated/htmlcov/unit_tests/nidcpower +Wrote HTML report to generated/htmlcov/unit_tests/nidcpower/index.html +py310-test: commands[12]> coverage run --rcfile=tools/coverage_unit_tests.rc --source nidigital -m pytest generated/nidigital/nidigital -s +============================= test session starts ============================== +platform linux -- Python 3.10.12, pytest-8.3.5, pluggy-1.5.0 -- /home/rahur/nimipythonmyfork/nimi-python/.tox/64/py310-test/bin/python +cachedir: .tox/64/py310-test/.pytest_cache +rootdir: /home/rahur/nimipythonmyfork/nimi-python +configfile: tox.ini +plugins: timeout-2.4.0 +collecting ... collected 8 items + +generated/nidigital/nidigital/unit_tests/test_nidigital.py::TestSession::test_fetch_history_ram_cycle_information_position_out_of_bound PASSED +generated/nidigital/nidigital/unit_tests/test_nidigital.py::TestSession::test_fetch_history_ram_cycle_information_position_last PASSED +generated/nidigital/nidigital/unit_tests/test_nidigital.py::TestSession::test_fetch_history_ram_cycle_information_samples_to_read_too_much PASSED +generated/nidigital/nidigital/unit_tests/test_nidigital.py::TestSession::test_fetch_history_ram_cycle_information_samples_to_read_all PASSED +generated/nidigital/nidigital/unit_tests/test_nidigital.py::TestSession::test_fetch_history_ram_cycle_information_pin_list PASSED +generated/nidigital/nidigital/unit_tests/test_nidigital.py::TestSession::test_fetch_history_ram_cycle_information_site_n PASSED +generated/nidigital/nidigital/unit_tests/test_nidigital.py::TestSession::test_pin_state_enum_print PASSED +generated/nidigital/nidigital/unit_tests/test_nidigital.py::TestSession::test_write_static_pin_state_enum_print PASSED + +============================== 8 passed in 0.46s =============================== +py310-test: commands[13]> coverage report +Name Stmts Miss Cover +-------------------------------------------------------------- +generated/nidigital/nidigital/session.py 786 248 68% +-------------------------------------------------------------- +TOTAL 786 248 68% +py310-test: commands[14]> coverage xml -o nidigitalunittest.xml +Wrote XML report to nidigitalunittest.xml +py310-test: commands[15]> coverage html --directory=generated/htmlcov/unit_tests/nidigital +Wrote HTML report to generated/htmlcov/unit_tests/nidigital/index.html +py310-test: commands[16]> coverage run --rcfile=tools/coverage_unit_tests.rc --source nimodinst -m pytest generated/nimodinst/nimodinst -s +============================= test session starts ============================== +platform linux -- Python 3.10.12, pytest-8.3.5, pluggy-1.5.0 -- /home/rahur/nimipythonmyfork/nimi-python/.tox/64/py310-test/bin/python +cachedir: .tox/64/py310-test/.pytest_cache +rootdir: /home/rahur/nimipythonmyfork/nimi-python +configfile: tox.ini +plugins: timeout-2.4.0 +collecting ... collected 23 items + +generated/nimodinst/nimodinst/unit_tests/test_modinst.py::TestSession::test_open_and_close PASSED +generated/nimodinst/nimodinst/unit_tests/test_modinst.py::TestSession::test_close PASSED +generated/nimodinst/nimodinst/unit_tests/test_modinst.py::TestSession::test_context_manager PASSED +generated/nimodinst/nimodinst/unit_tests/test_modinst.py::TestSession::test_iterating_for PASSED +generated/nimodinst/nimodinst/unit_tests/test_modinst.py::TestSession::test_iterating_for_empty PASSED +generated/nimodinst/nimodinst/unit_tests/test_modinst.py::TestSession::test_get_extended_error_info PASSED +generated/nimodinst/nimodinst/unit_tests/test_modinst.py::TestSession::test_get_error_description_fails PASSED +generated/nimodinst/nimodinst/unit_tests/test_modinst.py::TestSession::test_get_attribute_session PASSED +generated/nimodinst/nimodinst/unit_tests/test_modinst.py::TestSession::test_get_attribute_vi_int32_for_loop_index PASSED +generated/nimodinst/nimodinst/unit_tests/test_modinst.py::TestSession::test_get_attribute_vi_string_for_loop_index PASSED +generated/nimodinst/nimodinst/unit_tests/test_modinst.py::TestSession::test_get_attribute_session_no_index PASSED +generated/nimodinst/nimodinst/unit_tests/test_modinst.py::TestSession::test_get_attribute_vi_int32_for_loop_multiple_devices PASSED +generated/nimodinst/nimodinst/unit_tests/test_modinst.py::TestSession::test_get_attribute_vi_string_for_loop_multiple_devices PASSED +generated/nimodinst/nimodinst/unit_tests/test_modinst.py::TestSession::test_cannot_add_properties_to_session_set PASSED +generated/nimodinst/nimodinst/unit_tests/test_modinst.py::TestSession::test_cannot_add_properties_to_session_get PASSED +generated/nimodinst/nimodinst/unit_tests/test_modinst.py::TestSession::test_cannot_add_properties_to_device_set PASSED +generated/nimodinst/nimodinst/unit_tests/test_modinst.py::TestSession::test_cannot_add_properties_to_device_get PASSED +generated/nimodinst/nimodinst/unit_tests/test_modinst.py::TestSession::test_vi_int32_attribute_read_only PASSED +generated/nimodinst/nimodinst/unit_tests/test_modinst.py::TestSession::test_vi_string_attribute_read_only PASSED +generated/nimodinst/nimodinst/unit_tests/test_modinst.py::TestSession::test_int_attribute_error PASSED +generated/nimodinst/nimodinst/unit_tests/test_modinst.py::TestSession::test_int_attribute_warning PASSED +generated/nimodinst/nimodinst/unit_tests/test_modinst.py::TestSession::test_repr_and_str nimodinst.Session(driver=''): +nimodinst._Device(owner=nimodinst.Session(driver=''), index=0): + bus_number = 42 + chassis_number = 42 + device_model = 'fourty two' + device_name = 'fourty two' + max_pciexpress_link_width = 42 + pciexpress_link_width = 42 + serial_number = 'fourty two' + slot_number = 42 + socket_number = 42 + +nimodinst._Device(owner=nimodinst.Session(driver=''), index=1): + bus_number = 42 + chassis_number = 42 + device_model = 'fourty two' + device_name = 'fourty two' + max_pciexpress_link_width = 42 + pciexpress_link_width = 42 + serial_number = 'fourty two' + slot_number = 42 + socket_number = 42 + + +nimodinst._Device(owner=nimodinst.Session(driver=''), index=0): + bus_number = 42 + chassis_number = 42 + device_model = 'fourty two' + device_name = 'fourty two' + max_pciexpress_link_width = 42 + pciexpress_link_width = 42 + serial_number = 'fourty two' + slot_number = 42 + socket_number = 42 + +nimodinst._Device(owner=nimodinst.Session(driver=''), index=1): + bus_number = 42 + chassis_number = 42 + device_model = 'fourty two' + device_name = 'fourty two' + max_pciexpress_link_width = 42 + pciexpress_link_width = 42 + serial_number = 'fourty two' + slot_number = 42 + socket_number = 42 + +PASSED +generated/nimodinst/nimodinst/unit_tests/test_modinst.py::test_diagnostic_information OS: + Name: Linux + Version: #1 SMP Tue Nov 5 00:21:55 UTC 2024 + Bits: 64 +Driver: + Name: NI-ModInst + Version: Unknown +Module: + Name: nimodinst + Version: 1.4.10.dev0 +Python: + Version: 3.10.12 (main, Feb 4 2025, 14:57:36) [GCC 11.4.0] + Bits: 64 + Is_Venv: True + Installed Packages: + Mako==1.3.10 + MarkupSafe==3.0.2 + coverage==7.8.0 + grpcio==1.67.0 + hightime==0.2.2 + nimodinst==1.4.10.dev0 + nitclk==1.4.10.dev0 + pip==25.1.1 + pluggy==1.5.0 + pytest==8.3.5 + pytest-timeout==2.4.0 + setuptools==80.3.1 +PASSED + +============================== 23 passed in 0.29s ============================== +py310-test: commands[17]> coverage report +Name Stmts Miss Cover +-------------------------------------------------------------- +generated/nimodinst/nimodinst/session.py 138 8 94% +-------------------------------------------------------------- +TOTAL 138 8 94% +py310-test: commands[18]> coverage xml -o nimodinstunittest.xml +Wrote XML report to nimodinstunittest.xml +py310-test: commands[19]> coverage html --directory=generated/htmlcov/unit_tests/nimodinst +Wrote HTML report to generated/htmlcov/unit_tests/nimodinst/index.html +py310-test: commands[20]> coverage run --rcfile=tools/coverage_unit_tests.rc --source niscope -m pytest generated/niscope/niscope -s +============================= test session starts ============================== +platform linux -- Python 3.10.12, pytest-8.3.5, pluggy-1.5.0 -- /home/rahur/nimipythonmyfork/nimi-python/.tox/64/py310-test/bin/python +cachedir: .tox/64/py310-test/.pytest_cache +rootdir: /home/rahur/nimipythonmyfork/nimi-python +configfile: tox.ini +plugins: timeout-2.4.0 +collecting ... collected 2 items + +generated/niscope/niscope/unit_tests/test_niscope.py::test_populate_samples_info PASSED +generated/niscope/niscope/unit_tests/test_niscope.py::test_populate_channel_and_record_info PASSED + +============================== 2 passed in 0.32s =============================== +py310-test: commands[21]> coverage report +Name Stmts Miss Cover +---------------------------------------------------------------- +generated/niscope/niscope/waveform_info.py 81 46 43% +---------------------------------------------------------------- +TOTAL 81 46 43% +py310-test: commands[22]> coverage xml -o niscopeunittest.xml +Wrote XML report to niscopeunittest.xml +py310-test: commands[23]> coverage html --directory=generated/htmlcov/unit_tests/niscope +Wrote HTML report to generated/htmlcov/unit_tests/niscope/index.html +py310-test: commands[24]> coverage run --rcfile=tools/coverage_unit_tests.rc --source nitclk -m pytest generated/nitclk/nitclk -s +============================= test session starts ============================== +platform linux -- Python 3.10.12, pytest-8.3.5, pluggy-1.5.0 -- /home/rahur/nimipythonmyfork/nimi-python/.tox/64/py310-test/bin/python +cachedir: .tox/64/py310-test/.pytest_cache +rootdir: /home/rahur/nimipythonmyfork/nimi-python +configfile: tox.ini +plugins: timeout-2.4.0 +collecting ... collected 25 items + +generated/nitclk/nitclk/unit_tests/test_nitclk.py::TestNitclkApi::test_initialize_one_session PASSED +generated/nitclk/nitclk/unit_tests/test_nitclk.py::TestNitclkApi::test_initialize_multiple_sessions PASSED +generated/nitclk/nitclk/unit_tests/test_nitclk.py::TestNitclkApi::test_configure_for_homogeneous_triggers PASSED +generated/nitclk/nitclk/unit_tests/test_nitclk.py::TestNitclkApi::test_finish_sync_pulse_sender_synchronize PASSED +generated/nitclk/nitclk/unit_tests/test_nitclk.py::TestNitclkApi::test_is_done PASSED +generated/nitclk/nitclk/unit_tests/test_nitclk.py::TestNitclkApi::test_setup_for_sync_pulse_sender_synchronize PASSED +generated/nitclk/nitclk/unit_tests/test_nitclk.py::TestNitclkApi::test_synchronize PASSED +generated/nitclk/nitclk/unit_tests/test_nitclk.py::TestNitclkApi::test_synchronize_timedelta PASSED +generated/nitclk/nitclk/unit_tests/test_nitclk.py::TestNitclkApi::test_synchronize_to_sync_pulse_sender PASSED +generated/nitclk/nitclk/unit_tests/test_nitclk.py::TestNitclkApi::test_wait_until_done PASSED +generated/nitclk/nitclk/unit_tests/test_nitclk.py::TestNitclkApi::test_api_error PASSED +generated/nitclk/nitclk/unit_tests/test_nitclk.py::TestNitclkApi::test_api_get_error_description_fails PASSED +generated/nitclk/nitclk/unit_tests/test_nitclk.py::TestNitclkApi::test_session_reference_error PASSED +generated/nitclk/nitclk/unit_tests/test_nitclk.py::TestNitclkApi::test_session_reference_get_error_description_fails PASSED +generated/nitclk/nitclk/unit_tests/test_nitclk.py::TestNitclkApi::test_set_vi_real64 PASSED +generated/nitclk/nitclk/unit_tests/test_nitclk.py::TestNitclkApi::test_get_vi_real64 PASSED +generated/nitclk/nitclk/unit_tests/test_nitclk.py::TestNitclkApi::test_set_timedelta_as_vi_real64 PASSED +generated/nitclk/nitclk/unit_tests/test_nitclk.py::TestNitclkApi::test_set_timedelta_as_timedelta PASSED +generated/nitclk/nitclk/unit_tests/test_nitclk.py::TestNitclkApi::test_get_timedelta PASSED +generated/nitclk/nitclk/unit_tests/test_nitclk.py::TestNitclkApi::test_set_vi_string PASSED +generated/nitclk/nitclk/unit_tests/test_nitclk.py::TestNitclkApi::test_get_vi_string PASSED +generated/nitclk/nitclk/unit_tests/test_nitclk.py::TestNitclkApi::test_set_vi_session_with_int PASSED +generated/nitclk/nitclk/unit_tests/test_nitclk.py::TestNitclkApi::test_set_vi_session_with_session_reference PASSED +generated/nitclk/nitclk/unit_tests/test_nitclk.py::TestNitclkApi::test_set_vi_session_with_session PASSED +generated/nitclk/nitclk/unit_tests/test_nitclk.py::TestNitclkApi::test_get_tclk_session_reference PASSED + +============================== 25 passed in 0.32s ============================== +py310-test: commands[25]> coverage report +Name Stmts Miss Cover +-------------------------------------------------------- +generated/nitclk/nitclk/session.py 115 2 98% +-------------------------------------------------------- +TOTAL 115 2 98% +py310-test: commands[26]> coverage xml -o nitclkunittest.xml +Wrote XML report to nitclkunittest.xml +py310-test: commands[27]> coverage html --directory=generated/htmlcov/unit_tests/nitclk +Wrote HTML report to generated/htmlcov/unit_tests/nitclk/index.html +py310-test: OK ✔ in 13.43 seconds +py311-test: skipped because could not find python interpreter with spec(s): py311 +py311-test: SKIP ⚠ in 0.21 seconds +py312-test: commands[0]> python --version +Python 3.12.10 +py312-test: commands[1]> python -c 'import platform; print(platform.architecture())' +('64bit', 'ELF') +py312-test: commands[2]> python -m pip install --disable-pip-version-check --upgrade pip +Requirement already satisfied: pip in ./.tox/64/py312-test/lib/python3.12/site-packages (25.1.1) +py312-test: commands[3]> python tools/install_local_wheel.py --driver nitclk +Processing ./generated/nitclk/dist/nitclk-1.4.10.dev0-py3-none-any.whl +Requirement already satisfied: hightime>=0.2.0 in ./.tox/64/py312-test/lib/python3.12/site-packages (from nitclk==1.4.10.dev0) (0.2.2) +nitclk is already installed with the same version as the provided wheel. Use --force-reinstall to force an installation of the wheel. +py312-test: commands[4]> coverage run --rcfile=tools/coverage_unit_tests.rc --source nifake -m pytest generated/nifake/nifake -s +============================= test session starts ============================== +platform linux -- Python 3.12.10, pytest-8.3.5, pluggy-1.5.0 -- /home/rahur/nimipythonmyfork/nimi-python/.tox/64/py312-test/bin/python +cachedir: .tox/64/py312-test/.pytest_cache +rootdir: /home/rahur/nimipythonmyfork/nimi-python +configfile: tox.ini +plugins: timeout-2.4.0 +collecting ... collected 251 items + +generated/nifake/nifake/unit_tests/test_converters.py::test_convert_init_with_options_dictionary PASSED +generated/nifake/nifake/unit_tests/test_converters.py::test_convert_timedelta_to_seconds_double PASSED +generated/nifake/nifake/unit_tests/test_converters.py::test_convert_timedelta_to_milliseconds_int32 PASSED +generated/nifake/nifake/unit_tests/test_converters.py::test_convert_timedeltas_to_seconds_real64 PASSED +generated/nifake/nifake/unit_tests/test_converters.py::test_convert_seconds_real64_to_timedelta PASSED +generated/nifake/nifake/unit_tests/test_converters.py::test_convert_seconds_real64_to_timedeltas PASSED +generated/nifake/nifake/unit_tests/test_converters.py::test_repeated_capabilities_string_channel PASSED +generated/nifake/nifake/unit_tests/test_converters.py::test_repeated_capabilities_string_prefix PASSED +generated/nifake/nifake/unit_tests/test_converters.py::test_repeated_capabilities_list_channel PASSED +generated/nifake/nifake/unit_tests/test_converters.py::test_repeated_capabilities_list_prefix PASSED +generated/nifake/nifake/unit_tests/test_converters.py::test_repeated_capabilities_tuple_channel PASSED +generated/nifake/nifake/unit_tests/test_converters.py::test_repeated_capabilities_tuple_prefix PASSED +generated/nifake/nifake/unit_tests/test_converters.py::test_repeated_capabilities_unicode PASSED +generated/nifake/nifake/unit_tests/test_converters.py::test_repeated_capabilities_raw PASSED +generated/nifake/nifake/unit_tests/test_converters.py::test_repeated_capabilities_slice_channel PASSED +generated/nifake/nifake/unit_tests/test_converters.py::test_repeated_capabilities_mixed_channel PASSED +generated/nifake/nifake/unit_tests/test_converters.py::test_repeated_capabilities_mixed_prefix PASSED +generated/nifake/nifake/unit_tests/test_converters.py::test_invalid_repeated_capabilities PASSED +generated/nifake/nifake/unit_tests/test_converters.py::test_repeated_capabilities_slice_prefix PASSED +generated/nifake/nifake/unit_tests/test_converters.py::test_repeated_capabilities_without_prefix PASSED +generated/nifake/nifake/unit_tests/test_converters.py::test_repeated_capabilities_string_resource_name PASSED +generated/nifake/nifake/unit_tests/test_converters.py::test_repeated_capabilities_list_resource_name PASSED +generated/nifake/nifake/unit_tests/test_converters.py::test_repeated_capabilities_tuple_resource_name PASSED +generated/nifake/nifake/unit_tests/test_converters.py::test_repeated_capabilities_mixed_resource_name PASSED +generated/nifake/nifake/unit_tests/test_converters.py::test_repeated_capabilities_invalid_resource_names PASSED +generated/nifake/nifake/unit_tests/test_converters.py::test_expand_channel_string_non_fully_qualified_channel_names PASSED +generated/nifake/nifake/unit_tests/test_converters.py::test_expand_channel_string_fully_qualified_channel_names PASSED +generated/nifake/nifake/unit_tests/test_converters.py::test_convert_chained_repeated_capability_to_parts_three_parts PASSED +generated/nifake/nifake/unit_tests/test_converters.py::test_convert_chained_repeated_capability_to_parts_single_part PASSED +generated/nifake/nifake/unit_tests/test_converters.py::test_convert_chained_repeated_capability_to_parts_empty_string PASSED +generated/nifake/nifake/unit_tests/test_converters.py::test_string_to_list_channel PASSED +generated/nifake/nifake/unit_tests/test_converters.py::test_string_to_list_prefix PASSED +generated/nifake/nifake/unit_tests/test_converters.py::test_convert_comma_separated_string_to_list PASSED +generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_server_unavailable PASSED +generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_function_not_implemented PASSED +generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_api_key_sent_to_init PASSED +generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_new_session_already_exists PASSED +generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_attach_to_non_existent_session PASSED +generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_lock_unlock PASSED +generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_simple_function PASSED +generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_get_a_number PASSED +generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_one_input_function PASSED +generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_vi_int_64_function PASSED +generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_two_input_function PASSED +generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_get_enum_value PASSED +generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_get_a_list_enums PASSED +generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_get_a_boolean PASSED +generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_get_a_list_booleans PASSED +generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_single_point_read_nan PASSED +generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_fetch_waveform PASSED +generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_fetch_waveform_into PASSED +generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_write_waveform PASSED +generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_write_waveform_numpy PASSED +generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_return_multiple_types PASSED +generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_multiple_array_types PASSED +generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_multiple_array_types_none_input PASSED +generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_multiple_arrays_same_size PASSED +generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_multiple_arrays_same_size_none_input PASSED +generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_multiple_arrays_same_size_wrong_size PASSED +generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_parameters_are_multiple_types PASSED +generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_method_with_error PASSED +generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_call_not_enough_parameters_error PASSED +generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_invalid_method_call_wrong_type_error PASSED +generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_method_with_warning PASSED +generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_read_with_warning PASSED +generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_get_a_string_of_fixed_maximum_size PASSED +generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_return_a_number_and_a_string PASSED +generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_get_an_ivi_dance_char_array PASSED +generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_get_string_ivi_dance_error PASSED +generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_get_an_ivi_dance_with_a_twist_string PASSED +generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_get_array_using_ivi_dance PASSED +generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_get_attribute_int32 PASSED +generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_set_attribute_int32 PASSED +generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_get_attribute_real64 PASSED +generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_set_attribute_real64 PASSED +generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_get_attribute_string PASSED +generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_set_attribute_string PASSED +generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_get_attribute_boolean PASSED +generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_set_attribute_boolean PASSED +generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_get_attribute_int64 PASSED +generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_set_attribute_int64 PASSED +generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_error_message_returns_error PASSED +generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_set_custom_type PASSED +generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_get_custom_type PASSED +generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_set_custom_type_array PASSED +generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_get_custom_type_array PASSED +generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_get_custom_type_typedef PASSED +generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_get_cal_date_time PASSED +generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_import_attribute_configuration_buffer PASSED +generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_missing_function PASSED +generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_simple_function PASSED +generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_get_a_number PASSED +generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_one_input_function PASSED +generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_vi_int_64_function PASSED +generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_two_input_function PASSED +generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_get_enum_value PASSED +generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_get_a_list_enums PASSED +generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_get_a_boolean PASSED +generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_get_a_list_booleans PASSED +generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_single_point_read_nan PASSED +generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_fetch_waveform PASSED +generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_fetch_waveform_into PASSED +generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_write_waveform PASSED +generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_write_waveform_numpy PASSED +generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_return_multiple_types PASSED +generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_multiple_array_types PASSED +generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_multiple_array_types_none_input PASSED +generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_multiple_arrays_same_size PASSED +generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_multiple_arrays_same_size_none_input PASSED +generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_parameters_are_multiple_types PASSED +generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_method_with_error PASSED +generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_call_not_enough_parameters_error PASSED +generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_invalid_method_call_wrong_type_error PASSED +generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_method_with_warning PASSED +generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_read_with_warning PASSED +generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_library_interpreter_always_uses_same_library_instance PASSED +generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_set_runtime_environment_is_called_once_if_present PASSED +generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_set_runtime_environment_not_present_in_driver_runtime PASSED +generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_get_a_string_of_fixed_maximum_size PASSED +generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_get_a_string_of_size_python_code PASSED +generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_return_a_number_and_a_string PASSED +generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_get_an_ivi_dance_char_array PASSED +generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_get_string_ivi_dance_error PASSED +generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_get_an_ivi_dance_with_a_twist_string PASSED +generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_get_array_using_ivi_dance PASSED +generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_get_attribute_int32 PASSED +generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_set_attribute_int32 PASSED +generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_get_attribute_real64 PASSED +generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_set_attribute_real64 PASSED +generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_get_attribute_string PASSED +generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_set_attribute_string PASSED +generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_get_attribute_boolean PASSED +generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_set_attribute_boolean PASSED +generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_get_attribute_int64 PASSED +generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_set_attribute_int64 PASSED +generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_get_error_returns_mismatched_error_code PASSED +generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_get_error_and_error_message_returns_error PASSED +generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_get_error_description_error_message_error PASSED +generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_set_custom_type PASSED +generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_get_custom_type PASSED +generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_set_custom_type_array PASSED +generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_get_custom_type_array PASSED +generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_get_custom_type_typedef PASSED +generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_get_array_using_python_code_double PASSED +generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_get_array_using_python_code_custom_type PASSED +generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_get_cal_date_time PASSED +generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_import_attribute_configuration_buffer_list_i8 PASSED +generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_import_attribute_configuration_buffer_bytes PASSED +generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_import_attribute_configuration_buffer_bytearray PASSED +generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_import_attribute_configuration_buffer_array_bytes PASSED +generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_import_attribute_configuration_buffer_str PASSED +generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_write_numpy_complex128_valid_input PASSED +generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_write_waveform_complex_f64_invalid_input PASSED +generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_write_interleaved_complexi16_invalid_input PASSED +generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_write_interleaved_complexi16_valid_input PASSED +generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_matcher_prints PASSED +generated/nifake/nifake/unit_tests/test_library_singleton.py::test_driver_runtime_not_installed_raises_driver_not_installed_error PASSED +generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_init_with_options_and_close PASSED +generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_init_with_options_nondefault_and_close PASSED +generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_close PASSED +generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_session_context_manager PASSED +generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_init_with_error PASSED +generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_close_with_error PASSED +generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_session_context_manager_init_with_error PASSED +generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_session_context_manager_close_with_error PASSED +generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_lock_session_none PASSED +generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_unlock_session_none PASSED +generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_lock_context_manager PASSED +generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_lock_context_manager_abnormal_exit PASSED +generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_self_test PASSED +generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_self_test_fail PASSED +generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_acquisition_context_manager PASSED +generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_acquisition_no_context_manager PASSED +generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_single_point_read_timedelta PASSED +generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_enum_input_function_with_defaults PASSED +generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_string_valued_enum_input_function_with_defaults PASSED +generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_fetch_waveform_into_wrong_type PASSED +generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_parameters_are_multiple_types_error PASSED +generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_error_with_rep_cap PASSED +generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_call_not_enough_parameters_error PASSED +generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_enum_input_function_with_defaults_bad_type_error PASSED +generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_get_channel_names PASSED +generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_repeated_capability_method_on_session_timedelta PASSED +generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_repeated_capability_method_on_specific_channel PASSED +generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_device_method_not_exist_on_repeated_capability_error PASSED +generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_repeated_capabilities_list PASSED +generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_chained_repeated_capabilities_list PASSED +generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_chained_repeated_capability_method_on_specific_channel PASSED +generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_function_with_repeated_capability_type PASSED +generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_get_attribute_int32 PASSED +generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_set_attribute_int32 PASSED +generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_get_attribute_int32_with_converter PASSED +generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_set_attribute_int32_with_converter PASSED +generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_get_attribute_real64 PASSED +generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_set_attribute_real64 PASSED +generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_get_attribute_real64_with_converter PASSED +generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_set_attribute_real64_with_converter PASSED +generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_get_attribute_string PASSED +generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_set_attribute_string PASSED +generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_get_attribute_string_with_converter PASSED +generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_set_attribute_string_with_converter PASSED +generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_get_attribute_boolean PASSED +generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_set_attribute_boolean PASSED +generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_get_attribute_enum_int32 PASSED +generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_set_attribute_enum_int32 PASSED +generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_get_attribute_enum_real64 PASSED +generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_set_attribute_enum_real64 PASSED +generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_get_attribute_enum_with_converter PASSED +generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_get_attribute_enum_with_converter_invalid_value_from_driver PASSED +generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_set_attribute_enum_with_converter PASSED +generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_set_attribute_enum_with_converter_invalid_input PASSED +generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_get_attribute_channel PASSED +generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_set_attribute_channel PASSED +generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_get_attribute_int64 PASSED +generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_set_attribute_int64 PASSED +generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_get_attribute_error PASSED +generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_set_attribute_error PASSED +generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_add_properties_to_session_error_set PASSED +generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_add_properties_to_session_error_get PASSED +generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_add_properties_to_repeated_capability_error_set PASSED +generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_add_properties_to_repeated_capability_error_get PASSED +generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_set_enum_attribute_int32_error PASSED +generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_set_wrong_enum_attribute_int32_error PASSED +generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_multiple_arrays_same_size_wrong_size_2 PASSED +generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_multiple_arrays_same_size_wrong_size_3 PASSED +generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_multiple_arrays_same_size_wrong_size_4 PASSED +generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_get_cal_date_time PASSED +generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_get_cal_interval PASSED +generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_import_attribute_configuration_buffer_list_i8_big PASSED +generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_import_attribute_configuration_buffer_list_i8_float PASSED +generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_import_attribute_configuration_buffer_list_i8_big_float PASSED +generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_export_attribute_configuration_buffer PASSED +generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_channel_on_session PASSED +generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_function_name PASSED +generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_buffer_converter PASSED +generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_nitclk_integration PASSED +generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_accept_list_of_time_values_as_floats PASSED +generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_accept_array_of_time_values_as_floats PASSED +generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_accept_list_of_time_values_as_timedelta_instances PASSED +generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_return_timedelta PASSED +generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_return_timedeltas PASSED +generated/nifake/nifake/unit_tests/test_session.py::TestGrpcSession::test_init_with_options_and_close PASSED +generated/nifake/nifake/unit_tests/test_session.py::TestGrpcSession::test_lock_session_none PASSED +generated/nifake/nifake/unit_tests/test_session.py::TestGrpcSession::test_unlock_session_none PASSED +generated/nifake/nifake/unit_tests/test_session.py::TestGrpcSession::test_lock_context_manager PASSED +generated/nifake/nifake/unit_tests/test_session.py::TestGrpcSession::test_lock_context_manager_abnormal_exit PASSED +generated/nifake/nifake/unit_tests/test_session.py::TestGrpcSession::test_self_test PASSED +generated/nifake/nifake/unit_tests/test_session.py::TestGrpcSession::test_export_attribute_configuration_buffer PASSED +generated/nifake/nifake/unit_tests/test_session.py::TestGrpcSession::test_get_attribute_int32 PASSED +generated/nifake/nifake/unit_tests/test_session.py::test_diagnostic_information OS: + Name: Linux + Version: #1 SMP Tue Nov 5 00:21:55 UTC 2024 + Bits: 64 +Driver: + Name: NI-FAKE + Version: Unknown +Module: + Name: nifake + Version: 1.4.10.dev0 +Python: + Version: 3.12.10 (main, Apr 9 2025, 08:55:05) [GCC 11.4.0] + Bits: 64 + Is_Venv: True + Installed Packages: + Mako==1.3.10 + MarkupSafe==3.0.2 + coverage==7.8.0 + grpcio==1.67.0 + hightime==0.2.2 + iniconfig==2.1.0 + nifake==1.4.10.dev0 + nitclk==1.4.10.dev0 + numpy==2.2.5 + packaging==25.0 + pip==25.1.1 + pluggy==1.5.0 + protobuf==5.27.2 + pytest==8.3.5 + pytest-timeout==2.4.0 +PASSED +generated/nifake/nifake/unit_tests/test_session.py::test_dunder_version Version = 1.4.10.dev0 +PASSED + +============================= 251 passed in 6.55s ============================== +py312-test: commands[5]> coverage report +Name Stmts Miss Cover +----------------------------------------------------------------------------- +generated/nifake/nifake/__init__.py 76 14 82% +generated/nifake/nifake/_attributes.py 79 3 96% +generated/nifake/nifake/_complextype.py 8 0 100% +generated/nifake/nifake/_converters.py 132 6 95% +generated/nifake/nifake/_grpc_stub_interpreter.py 244 40 84% +generated/nifake/nifake/_visatype.py 19 0 100% +generated/nifake/nifake/custom_struct.py 28 3 89% +generated/nifake/nifake/custom_struct_nested_typedef.py 26 2 92% +generated/nifake/nifake/custom_struct_typedef.py 24 2 92% +generated/nifake/nifake/enums.py 42 0 100% +generated/nifake/nifake/errors.py 61 3 95% +generated/nifake/nifake/grpc_session_options.py 16 0 100% +generated/nifake/nifake/session.py 465 107 77% +----------------------------------------------------------------------------- +TOTAL 1220 180 85% +py312-test: commands[6]> coverage xml -o nifakeunittest.xml +Wrote XML report to nifakeunittest.xml +py312-test: commands[7]> coverage html --directory=generated/htmlcov/unit_tests/nifake +Wrote HTML report to generated/htmlcov/unit_tests/nifake/index.html +py312-test: commands[8]> coverage run --rcfile=tools/coverage_unit_tests.rc --source nidcpower -m pytest generated/nidcpower/nidcpower -s +============================= test session starts ============================== +platform linux -- Python 3.12.10, pytest-8.3.5, pluggy-1.5.0 -- /home/rahur/nimipythonmyfork/nimi-python/.tox/64/py312-test/bin/python +cachedir: .tox/64/py312-test/.pytest_cache +rootdir: /home/rahur/nimipythonmyfork/nimi-python +configfile: tox.ini +plugins: timeout-2.4.0 +collecting ... collected 7 items + +generated/nidcpower/nidcpower/unit_tests/test_nidcpower.py::test_lcr_measurement[ctype_members0-Dev1/0-expected_python_members0-Channel : Dev1/0\nDC voltage : 0.1 V\nDC current : 0.001 A\nStimulus frequency : 10,000 Hz\nAC voltage : 1+0.1j V RMS\nAC current : 0.01+0.001j A RMS\nImpedance : 100+10j \u03a9\nImpedance magnitude : 100.499 \u03a9\nImpedance phase : 5.71059 \xb0\nAdmittance : 0.00990099-0.000990099j S\nAdmittance magnitude: 0.00995037 S\nAdmittance phase : -5.71059 \xb0\nSeries inductance : 10 H\nSeries capacitance : 20 F\nSeries resistance : 90 \u03a9\nParallel inductance : 30 H\nParallel capacitance: 40 F\nParallel resistance : 110 \u03a9\nDissipation factor : 10\nQuality factor : 0.1\nMeasurement mode : SMU_PS\nDC in compliance : True\nAC in compliance : True\nUnbalanced : True\n] PASSED +generated/nidcpower/nidcpower/unit_tests/test_nidcpower.py::test_lcr_measurement[ctype_members1-1-expected_python_members1-Channel : 1\nDC voltage : 0 V\nDC current : 0 A\nStimulus frequency : 0 Hz\nAC voltage : 0+0j V RMS\nAC current : 0+0j A RMS\nImpedance : 0+0j \u03a9\nImpedance magnitude : 0 \u03a9\nImpedance phase : 0 \xb0\nAdmittance : nan+nanj S\nAdmittance magnitude: nan S\nAdmittance phase : nan \xb0\nSeries inductance : 0 H\nSeries capacitance : 0 F\nSeries resistance : 0 \u03a9\nParallel inductance : 0 H\nParallel capacitance: 0 F\nParallel resistance : 0 \u03a9\nDissipation factor : 0\nQuality factor : nan\nMeasurement mode : LCR\nDC in compliance : False\nAC in compliance : False\nUnbalanced : False\n] PASSED +generated/nidcpower/nidcpower/unit_tests/test_nidcpower.py::test_lcr_load_compensation_spot[python_init_params0-nidcpower.lcr_load_compensation_spot.LCRLoadCompensationSpot(frequency=200.0, reference_value_type=nidcpower.enums.LCRReferenceValueType.IMPEDANCE, reference_value=(3+4j))-Frequency : 200 Hz\nImpedance : 3+4j \u03a9\n-expected_ctype_members0] PASSED +generated/nidcpower/nidcpower/unit_tests/test_nidcpower.py::test_lcr_load_compensation_spot[python_init_params1-nidcpower.lcr_load_compensation_spot.LCRLoadCompensationSpot(frequency=300.0, reference_value_type=nidcpower.enums.LCRReferenceValueType.IDEAL_CAPACITANCE, reference_value=5.0)-Frequency : 300 Hz\nIdeal Capacitance: 5 F\n-expected_ctype_members1] PASSED +generated/nidcpower/nidcpower/unit_tests/test_nidcpower.py::test_lcr_load_compensation_spot[python_init_params2-nidcpower.lcr_load_compensation_spot.LCRLoadCompensationSpot(frequency=400.0, reference_value_type=nidcpower.enums.LCRReferenceValueType.IDEAL_INDUCTANCE, reference_value=6.0)-Frequency : 400 Hz\nIdeal Inductance : 6 H\n-expected_ctype_members2] PASSED +generated/nidcpower/nidcpower/unit_tests/test_nidcpower.py::test_lcr_load_compensation_spot[python_init_params3-nidcpower.lcr_load_compensation_spot.LCRLoadCompensationSpot(frequency=500.0, reference_value_type=nidcpower.enums.LCRReferenceValueType.IDEAL_RESISTANCE, reference_value=7.0)-Frequency : 500 Hz\nIdeal Resistance : 7 \u03a9\n-expected_ctype_members3] PASSED +generated/nidcpower/nidcpower/unit_tests/test_nidcpower.py::test_lcr_load_compensation_spot_byte_packing_alignment PASSED + +============================== 7 passed in 0.37s =============================== +py312-test: commands[9]> coverage report +Name Stmts Miss Cover +--------------------------------------------------------------------------------- +generated/nidcpower/nidcpower/lcr_load_compensation_spot.py 33 5 85% +generated/nidcpower/nidcpower/lcr_measurement.py 53 4 92% +--------------------------------------------------------------------------------- +TOTAL 86 9 90% +py312-test: commands[10]> coverage xml -o nidcpowerunittest.xml +Wrote XML report to nidcpowerunittest.xml +py312-test: commands[11]> coverage html --directory=generated/htmlcov/unit_tests/nidcpower +Wrote HTML report to generated/htmlcov/unit_tests/nidcpower/index.html +py312-test: commands[12]> coverage run --rcfile=tools/coverage_unit_tests.rc --source nidigital -m pytest generated/nidigital/nidigital -s +============================= test session starts ============================== +platform linux -- Python 3.12.10, pytest-8.3.5, pluggy-1.5.0 -- /home/rahur/nimipythonmyfork/nimi-python/.tox/64/py312-test/bin/python +cachedir: .tox/64/py312-test/.pytest_cache +rootdir: /home/rahur/nimipythonmyfork/nimi-python +configfile: tox.ini +plugins: timeout-2.4.0 +collecting ... collected 8 items + +generated/nidigital/nidigital/unit_tests/test_nidigital.py::TestSession::test_fetch_history_ram_cycle_information_position_out_of_bound PASSED +generated/nidigital/nidigital/unit_tests/test_nidigital.py::TestSession::test_fetch_history_ram_cycle_information_position_last PASSED +generated/nidigital/nidigital/unit_tests/test_nidigital.py::TestSession::test_fetch_history_ram_cycle_information_samples_to_read_too_much PASSED +generated/nidigital/nidigital/unit_tests/test_nidigital.py::TestSession::test_fetch_history_ram_cycle_information_samples_to_read_all PASSED +generated/nidigital/nidigital/unit_tests/test_nidigital.py::TestSession::test_fetch_history_ram_cycle_information_pin_list PASSED +generated/nidigital/nidigital/unit_tests/test_nidigital.py::TestSession::test_fetch_history_ram_cycle_information_site_n PASSED +generated/nidigital/nidigital/unit_tests/test_nidigital.py::TestSession::test_pin_state_enum_print PASSED +generated/nidigital/nidigital/unit_tests/test_nidigital.py::TestSession::test_write_static_pin_state_enum_print PASSED + +============================== 8 passed in 0.46s =============================== +py312-test: commands[13]> coverage report +Name Stmts Miss Cover +-------------------------------------------------------------- +generated/nidigital/nidigital/session.py 786 248 68% +-------------------------------------------------------------- +TOTAL 786 248 68% +py312-test: commands[14]> coverage xml -o nidigitalunittest.xml +Wrote XML report to nidigitalunittest.xml +py312-test: commands[15]> coverage html --directory=generated/htmlcov/unit_tests/nidigital +Wrote HTML report to generated/htmlcov/unit_tests/nidigital/index.html +py312-test: commands[16]> coverage run --rcfile=tools/coverage_unit_tests.rc --source nimodinst -m pytest generated/nimodinst/nimodinst -s +============================= test session starts ============================== +platform linux -- Python 3.12.10, pytest-8.3.5, pluggy-1.5.0 -- /home/rahur/nimipythonmyfork/nimi-python/.tox/64/py312-test/bin/python +cachedir: .tox/64/py312-test/.pytest_cache +rootdir: /home/rahur/nimipythonmyfork/nimi-python +configfile: tox.ini +plugins: timeout-2.4.0 +collecting ... collected 23 items + +generated/nimodinst/nimodinst/unit_tests/test_modinst.py::TestSession::test_open_and_close PASSED +generated/nimodinst/nimodinst/unit_tests/test_modinst.py::TestSession::test_close PASSED +generated/nimodinst/nimodinst/unit_tests/test_modinst.py::TestSession::test_context_manager PASSED +generated/nimodinst/nimodinst/unit_tests/test_modinst.py::TestSession::test_iterating_for PASSED +generated/nimodinst/nimodinst/unit_tests/test_modinst.py::TestSession::test_iterating_for_empty PASSED +generated/nimodinst/nimodinst/unit_tests/test_modinst.py::TestSession::test_get_extended_error_info PASSED +generated/nimodinst/nimodinst/unit_tests/test_modinst.py::TestSession::test_get_error_description_fails PASSED +generated/nimodinst/nimodinst/unit_tests/test_modinst.py::TestSession::test_get_attribute_session PASSED +generated/nimodinst/nimodinst/unit_tests/test_modinst.py::TestSession::test_get_attribute_vi_int32_for_loop_index PASSED +generated/nimodinst/nimodinst/unit_tests/test_modinst.py::TestSession::test_get_attribute_vi_string_for_loop_index PASSED +generated/nimodinst/nimodinst/unit_tests/test_modinst.py::TestSession::test_get_attribute_session_no_index PASSED +generated/nimodinst/nimodinst/unit_tests/test_modinst.py::TestSession::test_get_attribute_vi_int32_for_loop_multiple_devices PASSED +generated/nimodinst/nimodinst/unit_tests/test_modinst.py::TestSession::test_get_attribute_vi_string_for_loop_multiple_devices PASSED +generated/nimodinst/nimodinst/unit_tests/test_modinst.py::TestSession::test_cannot_add_properties_to_session_set PASSED +generated/nimodinst/nimodinst/unit_tests/test_modinst.py::TestSession::test_cannot_add_properties_to_session_get PASSED +generated/nimodinst/nimodinst/unit_tests/test_modinst.py::TestSession::test_cannot_add_properties_to_device_set PASSED +generated/nimodinst/nimodinst/unit_tests/test_modinst.py::TestSession::test_cannot_add_properties_to_device_get PASSED +generated/nimodinst/nimodinst/unit_tests/test_modinst.py::TestSession::test_vi_int32_attribute_read_only PASSED +generated/nimodinst/nimodinst/unit_tests/test_modinst.py::TestSession::test_vi_string_attribute_read_only PASSED +generated/nimodinst/nimodinst/unit_tests/test_modinst.py::TestSession::test_int_attribute_error PASSED +generated/nimodinst/nimodinst/unit_tests/test_modinst.py::TestSession::test_int_attribute_warning PASSED +generated/nimodinst/nimodinst/unit_tests/test_modinst.py::TestSession::test_repr_and_str nimodinst.Session(driver=''): +nimodinst._Device(owner=nimodinst.Session(driver=''), index=0): + bus_number = 42 + chassis_number = 42 + device_model = 'fourty two' + device_name = 'fourty two' + max_pciexpress_link_width = 42 + pciexpress_link_width = 42 + serial_number = 'fourty two' + slot_number = 42 + socket_number = 42 + +nimodinst._Device(owner=nimodinst.Session(driver=''), index=1): + bus_number = 42 + chassis_number = 42 + device_model = 'fourty two' + device_name = 'fourty two' + max_pciexpress_link_width = 42 + pciexpress_link_width = 42 + serial_number = 'fourty two' + slot_number = 42 + socket_number = 42 + + +nimodinst._Device(owner=nimodinst.Session(driver=''), index=0): + bus_number = 42 + chassis_number = 42 + device_model = 'fourty two' + device_name = 'fourty two' + max_pciexpress_link_width = 42 + pciexpress_link_width = 42 + serial_number = 'fourty two' + slot_number = 42 + socket_number = 42 + +nimodinst._Device(owner=nimodinst.Session(driver=''), index=1): + bus_number = 42 + chassis_number = 42 + device_model = 'fourty two' + device_name = 'fourty two' + max_pciexpress_link_width = 42 + pciexpress_link_width = 42 + serial_number = 'fourty two' + slot_number = 42 + socket_number = 42 + +PASSED +generated/nimodinst/nimodinst/unit_tests/test_modinst.py::test_diagnostic_information OS: + Name: Linux + Version: #1 SMP Tue Nov 5 00:21:55 UTC 2024 + Bits: 64 +Driver: + Name: NI-ModInst + Version: Unknown +Module: + Name: nimodinst + Version: 1.4.10.dev0 +Python: + Version: 3.12.10 (main, Apr 9 2025, 08:55:05) [GCC 11.4.0] + Bits: 64 + Is_Venv: True + Installed Packages: + Mako==1.3.10 + MarkupSafe==3.0.2 + coverage==7.8.0 + grpcio==1.67.0 + hightime==0.2.2 + iniconfig==2.1.0 + nimodinst==1.4.10.dev0 + nitclk==1.4.10.dev0 + numpy==2.2.5 + packaging==25.0 + pip==25.1.1 + pluggy==1.5.0 + protobuf==5.27.2 + pytest==8.3.5 + pytest-timeout==2.4.0 +PASSED + +============================== 23 passed in 0.34s ============================== +py312-test: commands[17]> coverage report +Name Stmts Miss Cover +-------------------------------------------------------------- +generated/nimodinst/nimodinst/session.py 138 8 94% +-------------------------------------------------------------- +TOTAL 138 8 94% +py312-test: commands[18]> coverage xml -o nimodinstunittest.xml +Wrote XML report to nimodinstunittest.xml +py312-test: commands[19]> coverage html --directory=generated/htmlcov/unit_tests/nimodinst +Wrote HTML report to generated/htmlcov/unit_tests/nimodinst/index.html +py312-test: commands[20]> coverage run --rcfile=tools/coverage_unit_tests.rc --source niscope -m pytest generated/niscope/niscope -s +============================= test session starts ============================== +platform linux -- Python 3.12.10, pytest-8.3.5, pluggy-1.5.0 -- /home/rahur/nimipythonmyfork/nimi-python/.tox/64/py312-test/bin/python +cachedir: .tox/64/py312-test/.pytest_cache +rootdir: /home/rahur/nimipythonmyfork/nimi-python +configfile: tox.ini +plugins: timeout-2.4.0 +collecting ... collected 2 items + +generated/niscope/niscope/unit_tests/test_niscope.py::test_populate_samples_info PASSED +generated/niscope/niscope/unit_tests/test_niscope.py::test_populate_channel_and_record_info PASSED + +============================== 2 passed in 0.36s =============================== +py312-test: commands[21]> coverage report +Name Stmts Miss Cover +---------------------------------------------------------------- +generated/niscope/niscope/waveform_info.py 81 46 43% +---------------------------------------------------------------- +TOTAL 81 46 43% +py312-test: commands[22]> coverage xml -o niscopeunittest.xml +Wrote XML report to niscopeunittest.xml +py312-test: commands[23]> coverage html --directory=generated/htmlcov/unit_tests/niscope +Wrote HTML report to generated/htmlcov/unit_tests/niscope/index.html +py312-test: commands[24]> coverage run --rcfile=tools/coverage_unit_tests.rc --source nitclk -m pytest generated/nitclk/nitclk -s +============================= test session starts ============================== +platform linux -- Python 3.12.10, pytest-8.3.5, pluggy-1.5.0 -- /home/rahur/nimipythonmyfork/nimi-python/.tox/64/py312-test/bin/python +cachedir: .tox/64/py312-test/.pytest_cache +rootdir: /home/rahur/nimipythonmyfork/nimi-python +configfile: tox.ini +plugins: timeout-2.4.0 +collecting ... collected 25 items + +generated/nitclk/nitclk/unit_tests/test_nitclk.py::TestNitclkApi::test_initialize_one_session PASSED +generated/nitclk/nitclk/unit_tests/test_nitclk.py::TestNitclkApi::test_initialize_multiple_sessions PASSED +generated/nitclk/nitclk/unit_tests/test_nitclk.py::TestNitclkApi::test_configure_for_homogeneous_triggers PASSED +generated/nitclk/nitclk/unit_tests/test_nitclk.py::TestNitclkApi::test_finish_sync_pulse_sender_synchronize PASSED +generated/nitclk/nitclk/unit_tests/test_nitclk.py::TestNitclkApi::test_is_done PASSED +generated/nitclk/nitclk/unit_tests/test_nitclk.py::TestNitclkApi::test_setup_for_sync_pulse_sender_synchronize PASSED +generated/nitclk/nitclk/unit_tests/test_nitclk.py::TestNitclkApi::test_synchronize PASSED +generated/nitclk/nitclk/unit_tests/test_nitclk.py::TestNitclkApi::test_synchronize_timedelta PASSED +generated/nitclk/nitclk/unit_tests/test_nitclk.py::TestNitclkApi::test_synchronize_to_sync_pulse_sender PASSED +generated/nitclk/nitclk/unit_tests/test_nitclk.py::TestNitclkApi::test_wait_until_done PASSED +generated/nitclk/nitclk/unit_tests/test_nitclk.py::TestNitclkApi::test_api_error PASSED +generated/nitclk/nitclk/unit_tests/test_nitclk.py::TestNitclkApi::test_api_get_error_description_fails PASSED +generated/nitclk/nitclk/unit_tests/test_nitclk.py::TestNitclkApi::test_session_reference_error PASSED +generated/nitclk/nitclk/unit_tests/test_nitclk.py::TestNitclkApi::test_session_reference_get_error_description_fails PASSED +generated/nitclk/nitclk/unit_tests/test_nitclk.py::TestNitclkApi::test_set_vi_real64 PASSED +generated/nitclk/nitclk/unit_tests/test_nitclk.py::TestNitclkApi::test_get_vi_real64 PASSED +generated/nitclk/nitclk/unit_tests/test_nitclk.py::TestNitclkApi::test_set_timedelta_as_vi_real64 PASSED +generated/nitclk/nitclk/unit_tests/test_nitclk.py::TestNitclkApi::test_set_timedelta_as_timedelta PASSED +generated/nitclk/nitclk/unit_tests/test_nitclk.py::TestNitclkApi::test_get_timedelta PASSED +generated/nitclk/nitclk/unit_tests/test_nitclk.py::TestNitclkApi::test_set_vi_string PASSED +generated/nitclk/nitclk/unit_tests/test_nitclk.py::TestNitclkApi::test_get_vi_string PASSED +generated/nitclk/nitclk/unit_tests/test_nitclk.py::TestNitclkApi::test_set_vi_session_with_int PASSED +generated/nitclk/nitclk/unit_tests/test_nitclk.py::TestNitclkApi::test_set_vi_session_with_session_reference PASSED +generated/nitclk/nitclk/unit_tests/test_nitclk.py::TestNitclkApi::test_set_vi_session_with_session PASSED +generated/nitclk/nitclk/unit_tests/test_nitclk.py::TestNitclkApi::test_get_tclk_session_reference PASSED + +============================== 25 passed in 0.33s ============================== +py312-test: commands[25]> coverage report +Name Stmts Miss Cover +-------------------------------------------------------- +generated/nitclk/nitclk/session.py 115 2 98% +-------------------------------------------------------- +TOTAL 115 2 98% +py312-test: commands[26]> coverage xml -o nitclkunittest.xml +Wrote XML report to nitclkunittest.xml +py312-test: commands[27]> coverage html --directory=generated/htmlcov/unit_tests/nitclk +Wrote HTML report to generated/htmlcov/unit_tests/nitclk/index.html +py312-test: OK ✔ in 12.51 seconds +py313-test: skipped because could not find python interpreter with spec(s): py313 +py313-test: SKIP ⚠ in 0.17 seconds +py312-pkg: commands[0]> python --version +Python 3.12.10 +py312-pkg: commands[1]> python -c 'import platform; print(platform.architecture())' +('64bit', 'ELF') +py312-pkg: commands[2]> python -m twine --version +twine version 6.1.0 (keyring: 25.6.0, packaging: 25.0, requests: 2.32.3, +requests-toolbelt: 1.0.0, urllib3: 2.4.0, id: 1.5.0) +py312-pkg: commands[3]> python -m twine check 'generated/nifake/dist/*' +Checking generated/nifake/dist/nifake-1.4.10.dev0-py3-none-any.whl: PASSED +Checking generated/nifake/dist/nifake-1.4.10.dev0.tar.gz: PASSED +py312-pkg: commands[4]> python -m twine check 'generated/nidcpower/dist/*' +Checking generated/nidcpower/dist/nidcpower-1.4.10.dev0-py3-none-any.whl: PASSED +Checking generated/nidcpower/dist/nidcpower-1.4.10.dev0.tar.gz: PASSED +py312-pkg: commands[5]> python -m twine check 'generated/nidigital/dist/*' +Checking generated/nidigital/dist/nidigital-1.4.10.dev0-py3-none-any.whl: PASSED +Checking generated/nidigital/dist/nidigital-1.4.10.dev0.tar.gz: PASSED +py312-pkg: commands[6]> python -m twine check 'generated/nidmm/dist/*' +Checking generated/nidmm/dist/nidmm-1.4.10.dev0-py3-none-any.whl: PASSED +Checking generated/nidmm/dist/nidmm-1.4.10.dev0.tar.gz: PASSED +py312-pkg: commands[7]> python -m twine check 'generated/nifgen/dist/*' +Checking generated/nifgen/dist/nifgen-1.4.10.dev0-py3-none-any.whl: PASSED +Checking generated/nifgen/dist/nifgen-1.4.10.dev0.tar.gz: PASSED +py312-pkg: commands[8]> python -m twine check 'generated/nirfsg/dist/*' +Checking generated/nirfsg/dist/nirfsg-0.2.0-py3-none-any.whl: PASSED +Checking generated/nirfsg/dist/nirfsg-0.2.0.tar.gz: PASSED +py312-pkg: commands[9]> python -m twine check 'generated/niscope/dist/*' +Checking generated/niscope/dist/niscope-1.4.10.dev0-py3-none-any.whl: PASSED +Checking generated/niscope/dist/niscope-1.4.10.dev0.tar.gz: PASSED +py312-pkg: commands[10]> python -m twine check 'generated/nise/dist/*' +Checking generated/nise/dist/nise-1.4.10.dev0-py3-none-any.whl: PASSED +Checking generated/nise/dist/nise-1.4.10.dev0.tar.gz: PASSED +py312-pkg: commands[11]> python -m twine check 'generated/niswitch/dist/*' +Checking generated/niswitch/dist/niswitch-1.4.10.dev0-py3-none-any.whl: PASSED +Checking generated/niswitch/dist/niswitch-1.4.10.dev0.tar.gz: PASSED + py312-build_test: OK (2.39=setup[0.06]+cmd[0.01,0.04,0.51,0.12,0.50,0.51,0.10,0.12,0.13,0.31] seconds) + py312-codegen: OK (8.14=setup[0.01]+cmd[0.00,0.02,0.53,7.58] seconds) + py312-installers: OK (0.60=setup[0.01]+cmd[0.00,0.02,0.46,0.11] seconds) + py39-test: SKIP (0.18 seconds) + py310-test: OK (13.43=setup[0.02]+cmd[0.00,0.02,0.53,0.35,8.42,0.11,0.12,0.17,0.49,0.06,0.06,0.07,0.68,0.09,0.10,0.11,0.46,0.06,0.06,0.07,0.50,0.06,0.06,0.07,0.51,0.06,0.06,0.07] seconds) + py311-test: SKIP (0.21 seconds) + py312-test: OK (12.51=setup[0.02]+cmd[0.00,0.02,0.46,0.33,7.38,0.10,0.10,0.12,0.59,0.06,0.06,0.07,0.69,0.08,0.09,0.10,0.54,0.06,0.06,0.07,0.57,0.06,0.06,0.07,0.55,0.06,0.06,0.07] seconds) + py313-test: SKIP (0.17 seconds) + py312-flake8: OK (2.73=setup[0.01]+cmd[0.00,0.02,0.50,0.95,0.09,0.18,0.21,0.12,0.14,0.09,0.15,0.08,0.10,0.09] seconds) + py312-docs: OK (30.64=setup[0.02]+cmd[0.00,0.02,4.03,2.66,2.10,2.59,1.37,10.20,2.67,1.73,1.41,1.86] seconds) + py312-pkg: OK (2.39=setup[0.01]+cmd[0.00,0.02,0.19,0.22,0.26,0.25,0.24,0.25,0.24,0.25,0.23,0.23] seconds) + congratulations :) (73.46 seconds) From d7df61dbb791384195962157c081c2872991b506 Mon Sep 17 00:00:00 2001 From: Rahul R Date: Thu, 15 May 2025 12:48:34 +0530 Subject: [PATCH 06/33] Remove log file --- tox_report.log | 2137 ------------------------------------------------ 1 file changed, 2137 deletions(-) delete mode 100644 tox_report.log diff --git a/tox_report.log b/tox_report.log deleted file mode 100644 index c231d603a9..0000000000 --- a/tox_report.log +++ /dev/null @@ -1,2137 +0,0 @@ -py312-build_test: commands[0]> python --version -Python 3.12.10 -py312-build_test: commands[1]> python -c 'import platform; print(platform.architecture())' -('64bit', 'ELF') -py312-build_test: commands[2]> python -m pip install --disable-pip-version-check --upgrade pip -Requirement already satisfied: pip in ./.tox/64/py312-build_test/lib/python3.12/site-packages (25.1.1) -py312-build_test: commands[3]> python -m pip list -Package Version ------------ ------- -coverage 7.8.0 -flake8 7.1.2 -hacking 7.0.0 -iniconfig 2.1.0 -Mako 1.3.10 -MarkupSafe 3.0.2 -mccabe 0.7.0 -packaging 25.0 -pep8-naming 0.15.1 -pip 25.1.1 -pluggy 1.5.0 -pycodestyle 2.12.1 -pyflakes 3.2.0 -pytest 8.3.5 -py312-build_test: commands[4]> coverage run --rcfile=tools/coverage_unit_tests.rc --source build.helper -m pytest --pyargs build.helper -============================= test session starts ============================== -platform linux -- Python 3.12.10, pytest-8.3.5, pluggy-1.5.0 -- /home/rahur/nimipythonmyfork/nimi-python/.tox/64/py312-build_test/bin/python -cachedir: .tox/64/py312-build_test/.pytest_cache -rootdir: /home/rahur/nimipythonmyfork/nimi-python -configfile: tox.ini -collecting ... collected 1 item - -build/helper/documentation_helper.py::build.helper.documentation_helper.as_rest_table PASSED [100%] - -============================== 1 passed in 0.24s =============================== -py312-build_test: commands[5]> coverage run --append --rcfile=tools/coverage_unit_tests.rc --source build.helper -m pytest build/unit_tests -s -============================= test session starts ============================== -platform linux -- Python 3.12.10, pytest-8.3.5, pluggy-1.5.0 -- /home/rahur/nimipythonmyfork/nimi-python/.tox/64/py312-build_test/bin/python -cachedir: .tox/64/py312-build_test/.pytest_cache -rootdir: /home/rahur/nimipythonmyfork/nimi-python -configfile: tox.ini -collecting ... collected 93 items - -build/unit_tests/test_codegen_helper.py::test_get_library_interpreter_method_return_snippet_vi PASSED -build/unit_tests/test_codegen_helper.py::test_get_library_interpreter_method_return_snippet_int PASSED -build/unit_tests/test_codegen_helper.py::test_get_library_interpreter_method_return_snippet_string PASSED -build/unit_tests/test_codegen_helper.py::test_get_library_interpreter_method_return_snippet_custom_type PASSED -build/unit_tests/test_codegen_helper.py::test_get_library_interpreter_method_return_snippet_enum PASSED -build/unit_tests/test_codegen_helper.py::test_get_library_interpreter_method_return_snippet_into PASSED -build/unit_tests/test_codegen_helper.py::test_get_grpc_interpreter_method_return_snippet_vi PASSED -build/unit_tests/test_codegen_helper.py::test_get_grpc_interpreter_method_return_snippet_int PASSED -build/unit_tests/test_codegen_helper.py::test_get_grpc_interpreter_method_return_snippet_string PASSED -build/unit_tests/test_codegen_helper.py::test_get_grpc_interpreter_method_return_snippet_custom_type PASSED -build/unit_tests/test_codegen_helper.py::test_get_grpc_interpreter_method_return_snippet_enum PASSED -build/unit_tests/test_codegen_helper.py::test_get_grpc_interpreter_method_return_snippet_bytes PASSED -build/unit_tests/test_codegen_helper.py::test_get_session_method_return_snippet PASSED -build/unit_tests/test_codegen_helper.py::test_get_session_method_return_snippet_non_numpy PASSED -build/unit_tests/test_codegen_helper.py::test_get_session_method_return_snippet_numpy PASSED -build/unit_tests/test_codegen_helper.py::test_get_enum_type_check_snippet PASSED -build/unit_tests/test_codegen_helper.py::test_get_buffer_parameters_for_size_parameter_none PASSED -build/unit_tests/test_codegen_helper.py::test_get_buffer_parameters_for_size_parameter PASSED -build/unit_tests/test_codegen_helper.py::test_get_ctype_variable_declaration_snippet_case_c010 PASSED -build/unit_tests/test_codegen_helper.py::test_get_ctype_variable_declaration_snippet_case_c020 PASSED -build/unit_tests/test_codegen_helper.py::test_get_ctype_variable_declaration_snippet_case_c030 PASSED -build/unit_tests/test_codegen_helper.py::test_get_ctype_variable_declaration_snippet_case_c050 PASSED -build/unit_tests/test_codegen_helper.py::test_get_ctype_variable_declaration_snippet_case_c060 PASSED -build/unit_tests/test_codegen_helper.py::test_get_ctype_variable_declaration_snippet_case_c070 PASSED -build/unit_tests/test_codegen_helper.py::test_get_ctype_variable_declaration_snippet_case_c080 PASSED -build/unit_tests/test_codegen_helper.py::test_get_ctype_variable_declaration_snippet_case_c090 PASSED -build/unit_tests/test_codegen_helper.py::test_get_ctype_variable_declaration_snippet_case_c100 PASSED -build/unit_tests/test_codegen_helper.py::test_get_ctype_variable_declaration_snippet_case_s110 PASSED -build/unit_tests/test_codegen_helper.py::test_get_ctype_variable_declaration_snippet_case_s120 PASSED -build/unit_tests/test_codegen_helper.py::test_get_ctype_variable_declaration_snippet_case_s130 PASSED -build/unit_tests/test_codegen_helper.py::test_get_ctype_variable_declaration_snippet_case_s150 PASSED -build/unit_tests/test_codegen_helper.py::test_get_ctype_variable_declaration_snippet_case_s160 PASSED -build/unit_tests/test_codegen_helper.py::test_get_ctype_variable_declaration_snippet_case_s170 PASSED -build/unit_tests/test_codegen_helper.py::test_get_ctype_variable_declaration_snippet_case_s180 PASSED -build/unit_tests/test_codegen_helper.py::test_get_ctype_variable_declaration_snippet_case_s2190 PASSED -build/unit_tests/test_codegen_helper.py::test_get_ctype_variable_declaration_snippet_case_s200 PASSED -build/unit_tests/test_codegen_helper.py::test_get_ctype_variable_declaration_snippet_case_s210 PASSED -build/unit_tests/test_codegen_helper.py::test_get_ctype_variable_declaration_snippet_case_s220 PASSED -build/unit_tests/test_codegen_helper.py::test_get_ctype_variable_declaration_snippet_case_b510 PASSED -build/unit_tests/test_codegen_helper.py::test_get_ctype_variable_declaration_snippet_case_b540 PASSED -build/unit_tests/test_codegen_helper.py::test_get_ctype_variable_declaration_snippet_case_b550_array PASSED -build/unit_tests/test_codegen_helper.py::test_get_ctype_variable_declaration_snippet_case_b550_list PASSED -build/unit_tests/test_codegen_helper.py::test_get_ctype_variable_declaration_snippet_case_b560 PASSED -build/unit_tests/test_codegen_helper.py::test_get_ctype_variable_declaration_snippet_case_b570 PASSED -build/unit_tests/test_codegen_helper.py::test_get_ctype_variable_declaration_snippet_case_b580_array PASSED -build/unit_tests/test_codegen_helper.py::test_get_ctype_variable_declaration_snippet_case_b590_array PASSED -build/unit_tests/test_codegen_helper.py::test_get_ctype_variable_declaration_snippet_case_b580_list PASSED -build/unit_tests/test_codegen_helper.py::test_get_ctype_variable_declaration_snippet_case_b590_list PASSED -build/unit_tests/test_codegen_helper.py::test_get_ctype_variable_declaration_snippet_case_b600 PASSED -build/unit_tests/test_codegen_helper.py::test_get_ctype_variable_declaration_snippet_case_b610_array PASSED -build/unit_tests/test_codegen_helper.py::test_get_ctype_variable_declaration_snippet_case_b620_array PASSED -build/unit_tests/test_codegen_helper.py::test_get_ctype_variable_declaration_snippet_case_b610_list PASSED -build/unit_tests/test_codegen_helper.py::test_get_ctype_variable_declaration_snippet_case_b620_list PASSED -build/unit_tests/test_codegen_helper.py::test_get_ctype_variable_declaration_snippet_bad_ivi_dance_step PASSED -build/unit_tests/test_codegen_helper.py::test_get_enum_value_snippet PASSED -build/unit_tests/test_documentation_helper.py::test_get_function_rst_default PASSED -build/unit_tests/test_documentation_helper.py::test_get_function_rst_numpy PASSED -build/unit_tests/test_documentation_helper.py::test_get_attribute_repeated_caps PASSED -build/unit_tests/test_documentation_helper.py::test_get_attribute_repeated_caps_with_conjunction PASSED -build/unit_tests/test_documentation_helper.py::test_module_supports_repeated_caps PASSED -build/unit_tests/test_documentation_helper.py::test_get_function_docstring_default PASSED -build/unit_tests/test_documentation_helper.py::test_get_function_docstring_numpy PASSED -build/unit_tests/test_documentation_helper.py::test_get_rst_header_snippet PASSED -build/unit_tests/test_documentation_helper.py::test_get_documentation_for_node_docstring PASSED -build/unit_tests/test_documentation_helper.py::test_get_rst_picture_reference PASSED -build/unit_tests/test_documentation_helper.py::test_square_up_tables PASSED -build/unit_tests/test_documentation_helper.py::test_add_notes_re_links PASSED -build/unit_tests/test_documentation_snippets.py::test_close_function_def_for_doc_note_not_list PASSED -build/unit_tests/test_documentation_snippets.py::test_close_function_def_for_doc_note_list PASSED -build/unit_tests/test_documentation_snippets.py::test_close_function_def_for_doc_no_note PASSED -build/unit_tests/test_documentation_snippets.py::test_initiate_function_def_for_doc_note_not_list PASSED -build/unit_tests/test_documentation_snippets.py::test_initiate_function_def_for_doc_note_list PASSED -build/unit_tests/test_documentation_snippets.py::test_initiate_function_def_for_doc_no_note PASSED -build/unit_tests/test_helper.py::test_get_development_status PASSED -build/unit_tests/test_helper.py::test_enum_uses_converter PASSED -build/unit_tests/test_metadata_add_all.py::test_add_functions_metadata_simple Couldn't find InitWithOptions init function -PASSED -build/unit_tests/test_metadata_add_all.py::test_add_attributes_metadata_simple PASSED -build/unit_tests/test_metadata_add_all.py::test_add_enums_metadata_simple PASSED -build/unit_tests/test_metadata_add_all.py::test_add_all_metadata_defaults Couldn't find InitWithOptions init function -PASSED -build/unit_tests/test_metadata_add_all.py::test_add_all_metadata Couldn't find InitWithOptions init function -PASSED -build/unit_tests/test_metadata_add_all.py::test_add_enum_codegen_method PASSED -build/unit_tests/test_metadata_add_all.py::test_add_enum_codegen_method_error PASSED -build/unit_tests/test_metadata_add_all.py::test_get_functions_that_use_enums PASSED -build/unit_tests/test_metadata_add_all.py::test_get_attributes_that_use_enums PASSED -build/unit_tests/test_metadata_add_all.py::test_get_least_restrictive_codegen_method PASSED -build/unit_tests/test_metadata_merge_dicts.py::test_merge_dict_second_is_empty PASSED -build/unit_tests/test_metadata_merge_dicts.py::test_merge_dict_key_exists PASSED -build/unit_tests/test_metadata_merge_dicts.py::test_merge_dict_recurse PASSED -build/unit_tests/test_metadata_merge_dicts.py::test_merge_dict_replace_in_list PASSED -build/unit_tests/test_metadata_merge_dicts.py::test_merge_dict_replace_in_dict_and_list PASSED -build/unit_tests/test_metadata_merge_dicts.py::test_merge_dict_with_regex PASSED -build/unit_tests/test_metadata_merge_dicts.py::test_merge_dict_with_regex_off PASSED -build/unit_tests/test_metadata_merge_dicts.py::test_merge_dict_top_level_key_missing PASSED - -============================== 93 passed in 0.30s ============================== -py312-build_test: commands[6]> coverage report -Name Stmts Miss Cover -------------------------------------------------------------- -build/helper/__init__.py 52 0 100% -build/helper/codegen_helper.py 307 50 84% -build/helper/documentation_helper.py 519 60 88% -build/helper/documentation_snippets.py 53 8 85% -build/helper/helper.py 50 10 80% -build/helper/metadata_add_all.py 430 82 81% -build/helper/metadata_filters.py 92 19 79% -build/helper/metadata_find.py 28 9 68% -build/helper/metadata_merge_dicts.py 43 9 79% -build/helper/parameter_usage_options.py 58 0 100% -------------------------------------------------------------- -TOTAL 1632 247 85% -py312-build_test: commands[7]> coverage xml -o codegen.xml -Wrote XML report to codegen.xml -py312-build_test: commands[8]> coverage html --directory=generated/htmlcov/unit_tests/codegen -Wrote HTML report to generated/htmlcov/unit_tests/codegen/index.html -py312-build_test: commands[9]> flake8 --config=./tox.ini '--per-file-ignores=build/unit_tests/*.py:F403,F405' build/ -py312-build_test: OK ✔ in 2.39 seconds -py312-codegen: commands[0]> python --version -Python 3.12.10 -py312-codegen: commands[1]> python -c 'import platform; print(platform.architecture())' -('64bit', 'ELF') -py312-codegen: commands[2]> python -m pip install --disable-pip-version-check --upgrade pip -Requirement already satisfied: pip in ./.tox/64/py312-codegen/lib/python3.12/site-packages (25.1.1) -py312-codegen: commands[3]> make - -Making nifake - Generating: generated/nifake/nifake/_attributes.py - Generating: generated/nifake/nifake/enums.py - Generating: generated/nifake/nifake/_library.py - Generating: generated/nifake/nifake/_library_interpreter.py - Generating: generated/nifake/nifake/_library_singleton.py - Generating: generated/nifake/nifake/session.py - Generating: generated/nifake/nifake/errors.py - Generating: generated/nifake/nifake/unit_tests/_mock_helper.py - Generating: generated/nifake/nifake/unit_tests/_matchers.py - Generating: generated/nifake/nifake/__init__.py - Generating: generated/nifake/nifake/_converters.py - Generating: generated/nifake/nifake/_complextype.py - Generating: generated/nifake/nifake/VERSION - Generating: generated/nifake/nifake/_grpc_stub_interpreter.py - Generating: generated/nifake/nifake/grpc_session_options.py - Generating: generated/nifake/setup.py - Generating: generated/nifake/tox-system_tests.ini - Copying: generated/nifake/nifake/unit_tests/test_converters.py - Copying: generated/nifake/nifake/unit_tests/test_grpc.py - Copying: generated/nifake/nifake/unit_tests/test_library_interpreter.py - Copying: generated/nifake/nifake/unit_tests/test_library_singleton.py - Copying: generated/nifake/nifake/unit_tests/test_session.py - -Making nidcpower - -Making nidigital - -Making nidmm - -Making nifgen - -Making nirfsg - Generating: generated/nirfsg/nirfsg/_attributes.py - Generating: generated/nirfsg/nirfsg/enums.py - Generating: generated/nirfsg/nirfsg/_library.py - Generating: generated/nirfsg/nirfsg/_library_interpreter.py - Generating: generated/nirfsg/nirfsg/_library_singleton.py - Generating: generated/nirfsg/nirfsg/session.py -Warning: "Init" not found in function metadata. Typo? Generated code will be funky! -Warning: "Init" not found in function metadata. Typo? Generated code will be funky! -Warning: "WriteArbWaveform" not found in function metadata. Typo? Generated code will be funky! -Warning: "WriteArbWaveform" not found in function metadata. Typo? Generated code will be funky! -Warning: "WriteArbWaveform" not found in function metadata. Typo? Generated code will be funky! -Warning: "WriteArbWaveform" not found in function metadata. Typo? Generated code will be funky! -Warning: "GetTerminalName" not found in function metadata. Typo? Generated code will be funky! -Warning: "GetTerminalName" not found in function metadata. Typo? Generated code will be funky! -Warning: "ConfigureRf" not found in function metadata. Typo? Generated code will be funky! -Warning: "ConfigureRf" not found in function metadata. Typo? Generated code will be funky! -Warning: "RevisionQuery" not found in function metadata. Typo? Generated code will be funky! -Warning: "RevisionQuery" not found in function metadata. Typo? Generated code will be funky! -Warning: "Init" not found in function metadata. Typo? Generated code will be funky! -Warning: "Init" not found in function metadata. Typo? Generated code will be funky! -Warning: "GetTerminalName" not found in function metadata. Typo? Generated code will be funky! -Warning: "GetTerminalName" not found in function metadata. Typo? Generated code will be funky! -Warning: "WriteP2pEndpointI16" not found in function metadata. Typo? Generated code will be funky! -Warning: "WriteP2pEndpointI16" not found in function metadata. Typo? Generated code will be funky! -Warning: "WriteP2pEndpointI16" not found in function metadata. Typo? Generated code will be funky! -Warning: "WriteP2pEndpointI16" not found in function metadata. Typo? Generated code will be funky! -Warning: "ConfigureRf" not found in function metadata. Typo? Generated code will be funky! -Warning: "ConfigureRf" not found in function metadata. Typo? Generated code will be funky! -Warning: "ResetWithOptions" not found in function metadata. Typo? Generated code will be funky! -Warning: "ResetWithOptions" not found in function metadata. Typo? Generated code will be funky! -Warning: "GetTerminalName" not found in function metadata. Typo? Generated code will be funky! -Warning: "GetTerminalName" not found in function metadata. Typo? Generated code will be funky! -Warning: "GetTerminalName" not found in function metadata. Typo? Generated code will be funky! -Warning: "GetTerminalName" not found in function metadata. Typo? Generated code will be funky! -Warning: "GetTerminalName" not found in function metadata. Typo? Generated code will be funky! -Warning: "GetTerminalName" not found in function metadata. Typo? Generated code will be funky! -Warning: "ResetWithOptions" not found in function metadata. Typo? Generated code will be funky! -Warning: "ResetWithOptions" not found in function metadata. Typo? Generated code will be funky! -Warning: "ReadAndDownloadWaveformFromFileTdms" not found in function metadata. Typo? Generated code will be funky! -Warning: "ResetWithOptions" not found in function metadata. Typo? Generated code will be funky! -Warning: "ReadAndDownloadWaveformFromFileTdms" not found in function metadata. Typo? Generated code will be funky! -Warning: "ResetWithOptions" not found in function metadata. Typo? Generated code will be funky! -Warning: "WriteArbWaveform" not found in function metadata. Typo? Generated code will be funky! -Warning: "Init" not found in function metadata. Typo? Generated code will be funky! -Warning: "ResetWithOptions" not found in function metadata. Typo? Generated code will be funky! -Warning: "WriteArbWaveform" not found in function metadata. Typo? Generated code will be funky! -Warning: "WriteArbWaveform" not found in function metadata. Typo? Generated code will be funky! - Generating: generated/nirfsg/nirfsg/errors.py - Generating: generated/nirfsg/nirfsg/unit_tests/_mock_helper.py - Generating: generated/nirfsg/nirfsg/unit_tests/_matchers.py - Generating: generated/nirfsg/nirfsg/__init__.py - Generating: generated/nirfsg/nirfsg/_converters.py - Generating: generated/nirfsg/nirfsg/_complextype.py - Generating: generated/nirfsg/nirfsg/VERSION - Generating: docs/nirfsg/about_nirfsg.inc - Generating: docs/nirfsg/index.rst - Generating: docs/nirfsg/nirfsg.rst - Generating: docs/nirfsg/enums.rst - Generating: docs/nirfsg/examples.rst - Generating: docs/nirfsg/installation.inc - Generating: docs/nirfsg/status.inc - Generating: docs/nirfsg/class.rst -Warning: "WriteArbWaveform" not found in function metadata. Typo? Generated code will be funky! -Warning: "Init" not found in function metadata. Typo? Generated code will be funky! -Warning: "ResetWithOptions" not found in function metadata. Typo? Generated code will be funky! -Warning: "WriteArbWaveform" not found in function metadata. Typo? Generated code will be funky! -Warning: "WriteArbWaveform" not found in function metadata. Typo? Generated code will be funky! -Warning: "Init" not found in function metadata. Typo? Generated code will be funky! -Warning: "WriteArbWaveform" not found in function metadata. Typo? Generated code will be funky! -Warning: "WriteArbWaveform" not found in function metadata. Typo? Generated code will be funky! -Warning: "GetTerminalName" not found in function metadata. Typo? Generated code will be funky! -Warning: "ConfigureRf" not found in function metadata. Typo? Generated code will be funky! -Warning: "RevisionQuery" not found in function metadata. Typo? Generated code will be funky! -Warning: "Init" not found in function metadata. Typo? Generated code will be funky! -Warning: "GetTerminalName" not found in function metadata. Typo? Generated code will be funky! -Warning: "WriteP2pEndpointI16" not found in function metadata. Typo? Generated code will be funky! -Warning: "WriteP2pEndpointI16" not found in function metadata. Typo? Generated code will be funky! -Warning: "ConfigureRf" not found in function metadata. Typo? Generated code will be funky! -Warning: "ResetWithOptions" not found in function metadata. Typo? Generated code will be funky! -Warning: "GetTerminalName" not found in function metadata. Typo? Generated code will be funky! -Warning: "GetTerminalName" not found in function metadata. Typo? Generated code will be funky! -Warning: "GetTerminalName" not found in function metadata. Typo? Generated code will be funky! -Warning: "ResetWithOptions" not found in function metadata. Typo? Generated code will be funky! -Warning: "ReadAndDownloadWaveformFromFileTdms" not found in function metadata. Typo? Generated code will be funky! -Warning: "ResetWithOptions" not found in function metadata. Typo? Generated code will be funky! - Generating: docs/nirfsg/toc.inc - Generating: docs/nirfsg/errors.rst - Generating: docs/nirfsg/rep_caps.rst - Creating: generated/nirfsg/README.rst - Generating: generated/nirfsg/setup.py - Generating: generated/nirfsg/tox-system_tests.ini - Zipping: generated/examples/nirfsg_examples.zip - adding: nirfsg_arb_waveform.py (deflated 60%) - adding: nirfsg_script.py (deflated 60%) - Generating: docs/nirfsg/conf.py - Generating: docs/nirfsg/.readthedocs.yaml - -Making niscope - -Making niswitch - -Making nise - -Making nimodinst - -Making nitclk - -Making Global Files - Creating Root: README.rst -py312-codegen: OK ✔ in 8.14 seconds -py312-installers: commands[0]> python --version -Python 3.12.10 -py312-installers: commands[1]> python -c 'import platform; print(platform.architecture())' -('64bit', 'ELF') -py312-installers: commands[2]> python -m pip install --disable-pip-version-check --upgrade pip -Requirement already satisfied: pip in ./.tox/64/py312-installers/lib/python3.12/site-packages (25.1.1) -py312-installers: commands[3]> make installers - -Making nifake installers - -Making nidcpower installers - -Making nidigital installers - -Making nidmm installers - -Making nifgen installers - -Making nirfsg installers - -Making niscope installers - -Making niswitch installers - -Making nise installers - -Making nimodinst installers - -Making nitclk installers -py312-installers: OK ✔ in 0.6 seconds -py312-flake8: commands[0]> python --version -Python 3.12.10 -py312-flake8: commands[1]> python -c 'import platform; print(platform.architecture())' -('64bit', 'ELF') -py312-flake8: commands[2]> python -m pip install --disable-pip-version-check --upgrade pip -Requirement already satisfied: pip in ./.tox/64/py312-flake8/lib/python3.12/site-packages (25.1.1) -py312-flake8: commands[3]> flake8 --config=./tox.ini generated/ -py312-flake8: commands[4]> flake8 --config=./tox.ini tools/ -py312-flake8: commands[5]> flake8 --config=./tox.ini src/nidcpower/system_tests/ src/nidcpower/examples/ -py312-flake8: commands[6]> flake8 --config=./tox.ini src/nidigital/system_tests/ src/nidigital/examples/ -py312-flake8: commands[7]> flake8 --config=./tox.ini src/nidmm/system_tests/ src/nidmm/examples/ -py312-flake8: commands[8]> flake8 --config=./tox.ini src/nifgen/system_tests/ src/nifgen/examples/ -py312-flake8: commands[9]> flake8 --config=./tox.ini src/nimodinst/system_tests/ src/nimodinst/examples/ -py312-flake8: commands[10]> flake8 --config=./tox.ini src/niscope/system_tests/ src/niscope/examples/ -py312-flake8: commands[11]> flake8 --config=./tox.ini src/nise/system_tests/ src/nise/examples/ -py312-flake8: commands[12]> flake8 --config=./tox.ini src/niswitch/system_tests/ src/niswitch/examples/ -py312-flake8: commands[13]> flake8 --config=./tox.ini src/nitclk/system_tests/ src/nitclk/examples/ -py312-flake8: OK ✔ in 2.73 seconds -py312-docs: commands[0] /home/rahur/nimipythonmyfork/nimi-python/docs> python --version -Python 3.12.10 -py312-docs: commands[1] /home/rahur/nimipythonmyfork/nimi-python/docs> python -c 'import platform; print(platform.architecture())' -('64bit', 'ELF') -py312-docs: commands[2] /home/rahur/nimipythonmyfork/nimi-python/docs> sphinx-build -b html -d .tox/64/py312-docs/tmp/doctrees ./nidcpower ../generated/docs/nidcpower/html -Running Sphinx v8.2.3 -loading translations [en]... done -Converting `source_suffix = '.rst'` to `source_suffix = {'.rst': 'restructuredtext'}`. -loading pickled environment... failed: source directory has changed -done -loading intersphinx inventory 'python' from https://docs.python.org/3/objects.inv ... -loading intersphinx inventory 'nidigital' from https://nidigital.readthedocs.io/en/latest/objects.inv ... -loading intersphinx inventory 'nidmm' from https://nidmm.readthedocs.io/en/latest/objects.inv ... -loading intersphinx inventory 'nifgen' from https://nifgen.readthedocs.io/en/latest/objects.inv ... -loading intersphinx inventory 'nimodinst' from https://nimodinst.readthedocs.io/en/latest/objects.inv ... -loading intersphinx inventory 'nirfsg' from https://nirfsg.readthedocs.io/en/latest/objects.inv ... -loading intersphinx inventory 'niscope' from https://niscope.readthedocs.io/en/latest/objects.inv ... -loading intersphinx inventory 'nise' from https://nise.readthedocs.io/en/latest/objects.inv ... -loading intersphinx inventory 'niswitch' from https://niswitch.readthedocs.io/en/latest/objects.inv ... -loading intersphinx inventory 'nitclk' from https://nitclk.readthedocs.io/en/latest/objects.inv ... -building [mo]: targets for 0 po files that are out of date -writing output... -building [html]: targets for 8 source files that are out of date -updating environment: [new config] 8 added, 0 changed, 0 removed -reading sources... [ 12%] class -reading sources... [ 25%] enums -reading sources... [ 38%] errors -reading sources... [ 50%] examples -reading sources... [ 62%] grpc_session_options -reading sources... [ 75%] index -reading sources... [ 88%] nidcpower -reading sources... [100%] rep_caps - -looking for now-outdated files... none found -pickling environment... done -checking consistency... done -preparing documents... done -copying assets... -copying static files... -Writing evaluated template result to /home/rahur/nimipythonmyfork/nimi-python/generated/docs/nidcpower/html/_static/basic.css -Writing evaluated template result to /home/rahur/nimipythonmyfork/nimi-python/generated/docs/nidcpower/html/_static/language_data.js -Writing evaluated template result to /home/rahur/nimipythonmyfork/nimi-python/generated/docs/nidcpower/html/_static/documentation_options.js -Writing evaluated template result to /home/rahur/nimipythonmyfork/nimi-python/generated/docs/nidcpower/html/_static/js/versions.js -copying static files: done -copying extra files... -copying extra files: done -copying assets: done -writing output... [ 12%] class -writing output... [ 25%] enums -writing output... [ 38%] errors -writing output... [ 50%] examples -writing output... [ 62%] grpc_session_options -writing output... [ 75%] index -writing output... [ 88%] nidcpower -writing output... [100%] rep_caps - -generating indices... genindex py-modindex done -highlighting module code... -writing additional pages... search done -dumping search index in English (code: en)... done -dumping object inventory... done -build succeeded. - -The HTML pages are in ../generated/docs/nidcpower/html. -py312-docs: commands[3] /home/rahur/nimipythonmyfork/nimi-python/docs> sphinx-build -b html -d .tox/64/py312-docs/tmp/doctrees ./nidigital ../generated/docs/nidigital/html -Running Sphinx v8.2.3 -loading translations [en]... done -Converting `source_suffix = '.rst'` to `source_suffix = {'.rst': 'restructuredtext'}`. -loading pickled environment... failed: source directory has changed -done -loading intersphinx inventory 'python' from https://docs.python.org/3/objects.inv ... -loading intersphinx inventory 'nidcpower' from https://nidcpower.readthedocs.io/en/latest/objects.inv ... -loading intersphinx inventory 'nidmm' from https://nidmm.readthedocs.io/en/latest/objects.inv ... -loading intersphinx inventory 'nifgen' from https://nifgen.readthedocs.io/en/latest/objects.inv ... -loading intersphinx inventory 'nimodinst' from https://nimodinst.readthedocs.io/en/latest/objects.inv ... -loading intersphinx inventory 'nirfsg' from https://nirfsg.readthedocs.io/en/latest/objects.inv ... -loading intersphinx inventory 'niscope' from https://niscope.readthedocs.io/en/latest/objects.inv ... -loading intersphinx inventory 'nise' from https://nise.readthedocs.io/en/latest/objects.inv ... -loading intersphinx inventory 'niswitch' from https://niswitch.readthedocs.io/en/latest/objects.inv ... -loading intersphinx inventory 'nitclk' from https://nitclk.readthedocs.io/en/latest/objects.inv ... -building [mo]: targets for 0 po files that are out of date -writing output... -building [html]: targets for 8 source files that are out of date -updating environment: [new config] 8 added, 0 changed, 0 removed -reading sources... [ 12%] class -reading sources... [ 25%] enums -reading sources... [ 38%] errors -reading sources... [ 50%] examples -reading sources... [ 62%] grpc_session_options -reading sources... [ 75%] index -reading sources... [ 88%] nidigital -reading sources... [100%] rep_caps - -looking for now-outdated files... none found -pickling environment... done -checking consistency... done -preparing documents... done -copying assets... -copying static files... -Writing evaluated template result to /home/rahur/nimipythonmyfork/nimi-python/generated/docs/nidigital/html/_static/basic.css -Writing evaluated template result to /home/rahur/nimipythonmyfork/nimi-python/generated/docs/nidigital/html/_static/language_data.js -Writing evaluated template result to /home/rahur/nimipythonmyfork/nimi-python/generated/docs/nidigital/html/_static/documentation_options.js -Writing evaluated template result to /home/rahur/nimipythonmyfork/nimi-python/generated/docs/nidigital/html/_static/js/versions.js -copying static files: done -copying extra files... -copying extra files: done -copying assets: done -writing output... [ 12%] class -writing output... [ 25%] enums -writing output... [ 38%] errors -writing output... [ 50%] examples -writing output... [ 62%] grpc_session_options -writing output... [ 75%] index -writing output... [ 88%] nidigital -writing output... [100%] rep_caps - -generating indices... genindex py-modindex done -highlighting module code... -writing additional pages... search done -dumping search index in English (code: en)... done -dumping object inventory... done -build succeeded, 3 warnings. - -The HTML pages are in ../generated/docs/nidigital/html. -py312-docs: commands[4] /home/rahur/nimipythonmyfork/nimi-python/docs> sphinx-build -b html -d .tox/64/py312-docs/tmp/doctrees ./nidmm ../generated/docs/nidmm/html -Running Sphinx v8.2.3 -loading translations [en]... done -Converting `source_suffix = '.rst'` to `source_suffix = {'.rst': 'restructuredtext'}`. -loading pickled environment... failed: source directory has changed -done -loading intersphinx inventory 'python' from https://docs.python.org/3/objects.inv ... -loading intersphinx inventory 'nidcpower' from https://nidcpower.readthedocs.io/en/latest/objects.inv ... -loading intersphinx inventory 'nidigital' from https://nidigital.readthedocs.io/en/latest/objects.inv ... -loading intersphinx inventory 'nifgen' from https://nifgen.readthedocs.io/en/latest/objects.inv ... -loading intersphinx inventory 'nimodinst' from https://nimodinst.readthedocs.io/en/latest/objects.inv ... -loading intersphinx inventory 'nirfsg' from https://nirfsg.readthedocs.io/en/latest/objects.inv ... -loading intersphinx inventory 'niscope' from https://niscope.readthedocs.io/en/latest/objects.inv ... -loading intersphinx inventory 'nise' from https://nise.readthedocs.io/en/latest/objects.inv ... -loading intersphinx inventory 'niswitch' from https://niswitch.readthedocs.io/en/latest/objects.inv ... -loading intersphinx inventory 'nitclk' from https://nitclk.readthedocs.io/en/latest/objects.inv ... -building [mo]: targets for 0 po files that are out of date -writing output... -building [html]: targets for 7 source files that are out of date -updating environment: [new config] 7 added, 0 changed, 0 removed -reading sources... [ 14%] class -reading sources... [ 29%] enums -reading sources... [ 43%] errors -reading sources... [ 57%] examples -reading sources... [ 71%] grpc_session_options -reading sources... [ 86%] index -reading sources... [100%] nidmm - -looking for now-outdated files... none found -pickling environment... done -checking consistency... done -preparing documents... done -copying assets... -copying static files... -Writing evaluated template result to /home/rahur/nimipythonmyfork/nimi-python/generated/docs/nidmm/html/_static/basic.css -Writing evaluated template result to /home/rahur/nimipythonmyfork/nimi-python/generated/docs/nidmm/html/_static/language_data.js -Writing evaluated template result to /home/rahur/nimipythonmyfork/nimi-python/generated/docs/nidmm/html/_static/documentation_options.js -Writing evaluated template result to /home/rahur/nimipythonmyfork/nimi-python/generated/docs/nidmm/html/_static/js/versions.js -copying static files: done -copying extra files... -copying extra files: done -copying assets: done -writing output... [ 14%] class -writing output... [ 29%] enums -writing output... [ 43%] errors -writing output... [ 57%] examples -writing output... [ 71%] grpc_session_options -writing output... [ 86%] index -writing output... [100%] nidmm - -generating indices... genindex py-modindex done -highlighting module code... -writing additional pages... search done -dumping search index in English (code: en)... done -dumping object inventory... done -build succeeded. - -The HTML pages are in ../generated/docs/nidmm/html. -py312-docs: commands[5] /home/rahur/nimipythonmyfork/nimi-python/docs> sphinx-build -b html -d .tox/64/py312-docs/tmp/doctrees ./nifgen ../generated/docs/nifgen/html -Running Sphinx v8.2.3 -loading translations [en]... done -Converting `source_suffix = '.rst'` to `source_suffix = {'.rst': 'restructuredtext'}`. -loading pickled environment... failed: source directory has changed -done -loading intersphinx inventory 'python' from https://docs.python.org/3/objects.inv ... -loading intersphinx inventory 'nidcpower' from https://nidcpower.readthedocs.io/en/latest/objects.inv ... -loading intersphinx inventory 'nidigital' from https://nidigital.readthedocs.io/en/latest/objects.inv ... -loading intersphinx inventory 'nidmm' from https://nidmm.readthedocs.io/en/latest/objects.inv ... -loading intersphinx inventory 'nimodinst' from https://nimodinst.readthedocs.io/en/latest/objects.inv ... -loading intersphinx inventory 'nirfsg' from https://nirfsg.readthedocs.io/en/latest/objects.inv ... -loading intersphinx inventory 'niscope' from https://niscope.readthedocs.io/en/latest/objects.inv ... -loading intersphinx inventory 'nise' from https://nise.readthedocs.io/en/latest/objects.inv ... -loading intersphinx inventory 'niswitch' from https://niswitch.readthedocs.io/en/latest/objects.inv ... -loading intersphinx inventory 'nitclk' from https://nitclk.readthedocs.io/en/latest/objects.inv ... -building [mo]: targets for 0 po files that are out of date -writing output... -building [html]: targets for 8 source files that are out of date -updating environment: [new config] 8 added, 0 changed, 0 removed -reading sources... [ 12%] class -reading sources... [ 25%] enums -reading sources... [ 38%] errors -reading sources... [ 50%] examples -reading sources... [ 62%] grpc_session_options -reading sources... [ 75%] index -reading sources... [ 88%] nifgen -reading sources... [100%] rep_caps - -looking for now-outdated files... none found -pickling environment... done -checking consistency... done -preparing documents... done -copying assets... -copying static files... -Writing evaluated template result to /home/rahur/nimipythonmyfork/nimi-python/generated/docs/nifgen/html/_static/basic.css -Writing evaluated template result to /home/rahur/nimipythonmyfork/nimi-python/generated/docs/nifgen/html/_static/language_data.js -Writing evaluated template result to /home/rahur/nimipythonmyfork/nimi-python/generated/docs/nifgen/html/_static/documentation_options.js -Writing evaluated template result to /home/rahur/nimipythonmyfork/nimi-python/generated/docs/nifgen/html/_static/js/versions.js -copying static files: done -copying extra files... -copying extra files: done -copying assets: done -writing output... [ 12%] class -writing output... [ 25%] enums -writing output... [ 38%] errors -writing output... [ 50%] examples -writing output... [ 62%] grpc_session_options -writing output... [ 75%] index -writing output... [ 88%] nifgen -writing output... [100%] rep_caps - -generating indices... genindex py-modindex done -highlighting module code... -writing additional pages... search done -dumping search index in English (code: en)... done -dumping object inventory... done -build succeeded. - -The HTML pages are in ../generated/docs/nifgen/html. -py312-docs: commands[6] /home/rahur/nimipythonmyfork/nimi-python/docs> sphinx-build -b html -d .tox/64/py312-docs/tmp/doctrees ./nimodinst ../generated/docs/nimodinst/html -Running Sphinx v8.2.3 -loading translations [en]... done -Converting `source_suffix = '.rst'` to `source_suffix = {'.rst': 'restructuredtext'}`. -loading pickled environment... failed: source directory has changed -done -loading intersphinx inventory 'python' from https://docs.python.org/3/objects.inv ... -loading intersphinx inventory 'nidcpower' from https://nidcpower.readthedocs.io/en/latest/objects.inv ... -loading intersphinx inventory 'nidigital' from https://nidigital.readthedocs.io/en/latest/objects.inv ... -loading intersphinx inventory 'nidmm' from https://nidmm.readthedocs.io/en/latest/objects.inv ... -loading intersphinx inventory 'nifgen' from https://nifgen.readthedocs.io/en/latest/objects.inv ... -loading intersphinx inventory 'nirfsg' from https://nirfsg.readthedocs.io/en/latest/objects.inv ... -loading intersphinx inventory 'niscope' from https://niscope.readthedocs.io/en/latest/objects.inv ... -loading intersphinx inventory 'nise' from https://nise.readthedocs.io/en/latest/objects.inv ... -loading intersphinx inventory 'niswitch' from https://niswitch.readthedocs.io/en/latest/objects.inv ... -loading intersphinx inventory 'nitclk' from https://nitclk.readthedocs.io/en/latest/objects.inv ... -building [mo]: targets for 0 po files that are out of date -writing output... -building [html]: targets for 5 source files that are out of date -updating environment: [new config] 5 added, 0 changed, 0 removed -reading sources... [ 20%] class -reading sources... [ 40%] errors -reading sources... [ 60%] examples -reading sources... [ 80%] index -reading sources... [100%] nimodinst - -looking for now-outdated files... none found -pickling environment... done -checking consistency... done -preparing documents... done -copying assets... -copying static files... -Writing evaluated template result to /home/rahur/nimipythonmyfork/nimi-python/generated/docs/nimodinst/html/_static/basic.css -Writing evaluated template result to /home/rahur/nimipythonmyfork/nimi-python/generated/docs/nimodinst/html/_static/language_data.js -Writing evaluated template result to /home/rahur/nimipythonmyfork/nimi-python/generated/docs/nimodinst/html/_static/documentation_options.js -Writing evaluated template result to /home/rahur/nimipythonmyfork/nimi-python/generated/docs/nimodinst/html/_static/js/versions.js -copying static files: done -copying extra files... -copying extra files: done -copying assets: done -writing output... [ 20%] class -writing output... [ 40%] errors -writing output... [ 60%] examples -writing output... [ 80%] index -writing output... [100%] nimodinst - -generating indices... genindex py-modindex done -highlighting module code... -writing additional pages... search done -dumping search index in English (code: en)... done -dumping object inventory... done -build succeeded. - -The HTML pages are in ../generated/docs/nimodinst/html. -py312-docs: commands[7] /home/rahur/nimipythonmyfork/nimi-python/docs> sphinx-build -b html -d .tox/64/py312-docs/tmp/doctrees ./nirfsg ../generated/docs/nirfsg/html -Running Sphinx v8.2.3 -loading translations [en]... done -Converting `source_suffix = '.rst'` to `source_suffix = {'.rst': 'restructuredtext'}`. -loading pickled environment... failed: source directory has changed -done -loading intersphinx inventory 'python' from https://docs.python.org/3/objects.inv ... -loading intersphinx inventory 'nidcpower' from https://nidcpower.readthedocs.io/en/latest/objects.inv ... -loading intersphinx inventory 'nidigital' from https://nidigital.readthedocs.io/en/latest/objects.inv ... -loading intersphinx inventory 'nidmm' from https://nidmm.readthedocs.io/en/latest/objects.inv ... -loading intersphinx inventory 'nifgen' from https://nifgen.readthedocs.io/en/latest/objects.inv ... -loading intersphinx inventory 'nimodinst' from https://nimodinst.readthedocs.io/en/latest/objects.inv ... -loading intersphinx inventory 'niscope' from https://niscope.readthedocs.io/en/latest/objects.inv ... -loading intersphinx inventory 'nise' from https://nise.readthedocs.io/en/latest/objects.inv ... -loading intersphinx inventory 'niswitch' from https://niswitch.readthedocs.io/en/latest/objects.inv ... -loading intersphinx inventory 'nitclk' from https://nitclk.readthedocs.io/en/latest/objects.inv ... -building [mo]: targets for 0 po files that are out of date -writing output... -building [html]: targets for 7 source files that are out of date -updating environment: [new config] 7 added, 0 changed, 0 removed -reading sources... [ 14%] class -reading sources... [ 29%] enums -reading sources... [ 43%] errors -reading sources... [ 57%] examples -reading sources... [ 71%] index -reading sources... [ 86%] nirfsg -reading sources... [100%] rep_caps - -looking for now-outdated files... none found -pickling environment... done -checking consistency... done -preparing documents... done -copying assets... -copying static files... -Writing evaluated template result to /home/rahur/nimipythonmyfork/nimi-python/generated/docs/nirfsg/html/_static/basic.css -Writing evaluated template result to /home/rahur/nimipythonmyfork/nimi-python/generated/docs/nirfsg/html/_static/language_data.js -Writing evaluated template result to /home/rahur/nimipythonmyfork/nimi-python/generated/docs/nirfsg/html/_static/documentation_options.js -Writing evaluated template result to /home/rahur/nimipythonmyfork/nimi-python/generated/docs/nirfsg/html/_static/js/versions.js -copying static files: done -copying extra files... -copying extra files: done -copying assets: done -writing output... [ 14%] class -writing output... [ 29%] enums -writing output... [ 43%] errors -writing output... [ 57%] examples -writing output... [ 71%] index -writing output... [ 86%] nirfsg -writing output... [100%] rep_caps - -generating indices... genindex py-modindex done -highlighting module code... -writing additional pages... search done -dumping search index in English (code: en)... done -dumping object inventory... done -build succeeded, 17 warnings. - -The HTML pages are in ../generated/docs/nirfsg/html. -py312-docs: commands[8] /home/rahur/nimipythonmyfork/nimi-python/docs> sphinx-build -b html -d .tox/64/py312-docs/tmp/doctrees ./niscope ../generated/docs/niscope/html -Running Sphinx v8.2.3 -loading translations [en]... done -Converting `source_suffix = '.rst'` to `source_suffix = {'.rst': 'restructuredtext'}`. -loading pickled environment... failed: source directory has changed -done -loading intersphinx inventory 'python' from https://docs.python.org/3/objects.inv ... -loading intersphinx inventory 'nidcpower' from https://nidcpower.readthedocs.io/en/latest/objects.inv ... -loading intersphinx inventory 'nidigital' from https://nidigital.readthedocs.io/en/latest/objects.inv ... -loading intersphinx inventory 'nidmm' from https://nidmm.readthedocs.io/en/latest/objects.inv ... -loading intersphinx inventory 'nifgen' from https://nifgen.readthedocs.io/en/latest/objects.inv ... -loading intersphinx inventory 'nimodinst' from https://nimodinst.readthedocs.io/en/latest/objects.inv ... -loading intersphinx inventory 'nirfsg' from https://nirfsg.readthedocs.io/en/latest/objects.inv ... -loading intersphinx inventory 'nise' from https://nise.readthedocs.io/en/latest/objects.inv ... -loading intersphinx inventory 'niswitch' from https://niswitch.readthedocs.io/en/latest/objects.inv ... -loading intersphinx inventory 'nitclk' from https://nitclk.readthedocs.io/en/latest/objects.inv ... -building [mo]: targets for 0 po files that are out of date -writing output... -building [html]: targets for 8 source files that are out of date -updating environment: [new config] 8 added, 0 changed, 0 removed -reading sources... [ 12%] class -reading sources... [ 25%] enums -reading sources... [ 38%] errors -reading sources... [ 50%] examples -reading sources... [ 62%] grpc_session_options -reading sources... [ 75%] index -reading sources... [ 88%] niscope -reading sources... [100%] rep_caps - -looking for now-outdated files... none found -pickling environment... done -checking consistency... done -preparing documents... done -copying assets... -copying static files... -Writing evaluated template result to /home/rahur/nimipythonmyfork/nimi-python/generated/docs/niscope/html/_static/basic.css -Writing evaluated template result to /home/rahur/nimipythonmyfork/nimi-python/generated/docs/niscope/html/_static/language_data.js -Writing evaluated template result to /home/rahur/nimipythonmyfork/nimi-python/generated/docs/niscope/html/_static/documentation_options.js -Writing evaluated template result to /home/rahur/nimipythonmyfork/nimi-python/generated/docs/niscope/html/_static/js/versions.js -copying static files: done -copying extra files... -copying extra files: done -copying assets: done -writing output... [ 12%] class -writing output... [ 25%] enums -writing output... [ 38%] errors -writing output... [ 50%] examples -writing output... [ 62%] grpc_session_options -writing output... [ 75%] index -writing output... [ 88%] niscope -writing output... [100%] rep_caps - -generating indices... genindex py-modindex done -highlighting module code... -writing additional pages... search done -dumping search index in English (code: en)... done -dumping object inventory... done -build succeeded, 2 warnings. - -The HTML pages are in ../generated/docs/niscope/html. -py312-docs: commands[9] /home/rahur/nimipythonmyfork/nimi-python/docs> sphinx-build -b html -d .tox/64/py312-docs/tmp/doctrees ./nise ../generated/docs/nise/html -Running Sphinx v8.2.3 -loading translations [en]... done -Converting `source_suffix = '.rst'` to `source_suffix = {'.rst': 'restructuredtext'}`. -loading pickled environment... failed: source directory has changed -done -loading intersphinx inventory 'python' from https://docs.python.org/3/objects.inv ... -loading intersphinx inventory 'nidcpower' from https://nidcpower.readthedocs.io/en/latest/objects.inv ... -loading intersphinx inventory 'nidigital' from https://nidigital.readthedocs.io/en/latest/objects.inv ... -loading intersphinx inventory 'nidmm' from https://nidmm.readthedocs.io/en/latest/objects.inv ... -loading intersphinx inventory 'nifgen' from https://nifgen.readthedocs.io/en/latest/objects.inv ... -loading intersphinx inventory 'nimodinst' from https://nimodinst.readthedocs.io/en/latest/objects.inv ... -loading intersphinx inventory 'nirfsg' from https://nirfsg.readthedocs.io/en/latest/objects.inv ... -loading intersphinx inventory 'niscope' from https://niscope.readthedocs.io/en/latest/objects.inv ... -loading intersphinx inventory 'niswitch' from https://niswitch.readthedocs.io/en/latest/objects.inv ... -loading intersphinx inventory 'nitclk' from https://nitclk.readthedocs.io/en/latest/objects.inv ... -building [mo]: targets for 0 po files that are out of date -writing output... -building [html]: targets for 6 source files that are out of date -updating environment: [new config] 6 added, 0 changed, 0 removed -reading sources... [ 17%] class -reading sources... [ 33%] enums -reading sources... [ 50%] errors -reading sources... [ 67%] examples -reading sources... [ 83%] index -reading sources... [100%] nise - -looking for now-outdated files... none found -pickling environment... done -checking consistency... done -preparing documents... done -copying assets... -copying static files... -Writing evaluated template result to /home/rahur/nimipythonmyfork/nimi-python/generated/docs/nise/html/_static/basic.css -Writing evaluated template result to /home/rahur/nimipythonmyfork/nimi-python/generated/docs/nise/html/_static/language_data.js -Writing evaluated template result to /home/rahur/nimipythonmyfork/nimi-python/generated/docs/nise/html/_static/documentation_options.js -Writing evaluated template result to /home/rahur/nimipythonmyfork/nimi-python/generated/docs/nise/html/_static/js/versions.js -copying static files: done -copying extra files... -copying extra files: done -copying assets: done -writing output... [ 17%] class -writing output... [ 33%] enums -writing output... [ 50%] errors -writing output... [ 67%] examples -writing output... [ 83%] index -writing output... [100%] nise - -generating indices... genindex py-modindex done -highlighting module code... -writing additional pages... search done -dumping search index in English (code: en)... done -dumping object inventory... done -build succeeded. - -The HTML pages are in ../generated/docs/nise/html. -py312-docs: commands[10] /home/rahur/nimipythonmyfork/nimi-python/docs> sphinx-build -b html -d .tox/64/py312-docs/tmp/doctrees ./niswitch ../generated/docs/niswitch/html -Running Sphinx v8.2.3 -loading translations [en]... done -Converting `source_suffix = '.rst'` to `source_suffix = {'.rst': 'restructuredtext'}`. -loading pickled environment... failed: source directory has changed -done -loading intersphinx inventory 'python' from https://docs.python.org/3/objects.inv ... -loading intersphinx inventory 'nidcpower' from https://nidcpower.readthedocs.io/en/latest/objects.inv ... -loading intersphinx inventory 'nidigital' from https://nidigital.readthedocs.io/en/latest/objects.inv ... -loading intersphinx inventory 'nidmm' from https://nidmm.readthedocs.io/en/latest/objects.inv ... -loading intersphinx inventory 'nifgen' from https://nifgen.readthedocs.io/en/latest/objects.inv ... -loading intersphinx inventory 'nimodinst' from https://nimodinst.readthedocs.io/en/latest/objects.inv ... -loading intersphinx inventory 'nirfsg' from https://nirfsg.readthedocs.io/en/latest/objects.inv ... -loading intersphinx inventory 'niscope' from https://niscope.readthedocs.io/en/latest/objects.inv ... -loading intersphinx inventory 'nise' from https://nise.readthedocs.io/en/latest/objects.inv ... -loading intersphinx inventory 'nitclk' from https://nitclk.readthedocs.io/en/latest/objects.inv ... -building [mo]: targets for 0 po files that are out of date -writing output... -building [html]: targets for 8 source files that are out of date -updating environment: [new config] 8 added, 0 changed, 0 removed -reading sources... [ 12%] class -reading sources... [ 25%] enums -reading sources... [ 38%] errors -reading sources... [ 50%] examples -reading sources... [ 62%] grpc_session_options -reading sources... [ 75%] index -reading sources... [ 88%] niswitch -reading sources... [100%] rep_caps - -looking for now-outdated files... none found -pickling environment... done -checking consistency... done -preparing documents... done -copying assets... -copying static files... -Writing evaluated template result to /home/rahur/nimipythonmyfork/nimi-python/generated/docs/niswitch/html/_static/basic.css -Writing evaluated template result to /home/rahur/nimipythonmyfork/nimi-python/generated/docs/niswitch/html/_static/language_data.js -Writing evaluated template result to /home/rahur/nimipythonmyfork/nimi-python/generated/docs/niswitch/html/_static/documentation_options.js -Writing evaluated template result to /home/rahur/nimipythonmyfork/nimi-python/generated/docs/niswitch/html/_static/js/versions.js -copying static files: done -copying extra files... -copying extra files: done -copying assets: done -writing output... [ 12%] class -writing output... [ 25%] enums -writing output... [ 38%] errors -writing output... [ 50%] examples -writing output... [ 62%] grpc_session_options -writing output... [ 75%] index -writing output... [ 88%] niswitch -writing output... [100%] rep_caps - -generating indices... genindex py-modindex done -highlighting module code... -writing additional pages... search done -dumping search index in English (code: en)... done -dumping object inventory... done -build succeeded. - -The HTML pages are in ../generated/docs/niswitch/html. -py312-docs: commands[11] /home/rahur/nimipythonmyfork/nimi-python/docs> sphinx-build -b html -d .tox/64/py312-docs/tmp/doctrees ./nitclk ../generated/docs/nitclk/html -Running Sphinx v8.2.3 -loading translations [en]... done -Converting `source_suffix = '.rst'` to `source_suffix = {'.rst': 'restructuredtext'}`. -loading pickled environment... failed: source directory has changed -done -loading intersphinx inventory 'python' from https://docs.python.org/3/objects.inv ... -loading intersphinx inventory 'nidcpower' from https://nidcpower.readthedocs.io/en/latest/objects.inv ... -loading intersphinx inventory 'nidigital' from https://nidigital.readthedocs.io/en/latest/objects.inv ... -loading intersphinx inventory 'nidmm' from https://nidmm.readthedocs.io/en/latest/objects.inv ... -loading intersphinx inventory 'nifgen' from https://nifgen.readthedocs.io/en/latest/objects.inv ... -loading intersphinx inventory 'nimodinst' from https://nimodinst.readthedocs.io/en/latest/objects.inv ... -loading intersphinx inventory 'nirfsg' from https://nirfsg.readthedocs.io/en/latest/objects.inv ... -loading intersphinx inventory 'niscope' from https://niscope.readthedocs.io/en/latest/objects.inv ... -loading intersphinx inventory 'nise' from https://nise.readthedocs.io/en/latest/objects.inv ... -loading intersphinx inventory 'niswitch' from https://niswitch.readthedocs.io/en/latest/objects.inv ... -building [mo]: targets for 0 po files that are out of date -writing output... -building [html]: targets for 5 source files that are out of date -updating environment: [new config] 5 added, 0 changed, 0 removed -reading sources... [ 20%] class -reading sources... [ 40%] errors -reading sources... [ 60%] examples -reading sources... [ 80%] index -reading sources... [100%] nitclk - -looking for now-outdated files... none found -pickling environment... done -checking consistency... done -preparing documents... done -copying assets... -copying static files... -Writing evaluated template result to /home/rahur/nimipythonmyfork/nimi-python/generated/docs/nitclk/html/_static/basic.css -Writing evaluated template result to /home/rahur/nimipythonmyfork/nimi-python/generated/docs/nitclk/html/_static/language_data.js -Writing evaluated template result to /home/rahur/nimipythonmyfork/nimi-python/generated/docs/nitclk/html/_static/documentation_options.js -Writing evaluated template result to /home/rahur/nimipythonmyfork/nimi-python/generated/docs/nitclk/html/_static/js/versions.js -copying static files: done -copying extra files... -copying extra files: done -copying assets: done -writing output... [ 20%] class -writing output... [ 40%] errors -writing output... [ 60%] examples -writing output... [ 80%] index -writing output... [100%] nitclk - -generating indices... genindex py-modindex done -highlighting module code... -writing additional pages... search done -dumping search index in English (code: en)... done -dumping object inventory... done -build succeeded. - -The HTML pages are in ../generated/docs/nitclk/html. -py312-docs: OK ✔ in 30.64 seconds -py39-test: skipped because could not find python interpreter with spec(s): py39 -py39-test: SKIP ⚠ in 0.18 seconds -py310-test: commands[0]> python --version -Python 3.10.12 -py310-test: commands[1]> python -c 'import platform; print(platform.architecture())' -('64bit', 'ELF') -py310-test: commands[2]> python -m pip install --disable-pip-version-check --upgrade pip -Requirement already satisfied: pip in ./.tox/64/py310-test/lib/python3.10/site-packages (25.1.1) -py310-test: commands[3]> python tools/install_local_wheel.py --driver nitclk -Processing ./generated/nitclk/dist/nitclk-1.4.10.dev0-py3-none-any.whl -Requirement already satisfied: hightime>=0.2.0 in ./.tox/64/py310-test/lib/python3.10/site-packages (from nitclk==1.4.10.dev0) (0.2.2) -nitclk is already installed with the same version as the provided wheel. Use --force-reinstall to force an installation of the wheel. -py310-test: commands[4]> coverage run --rcfile=tools/coverage_unit_tests.rc --source nifake -m pytest generated/nifake/nifake -s -============================= test session starts ============================== -platform linux -- Python 3.10.12, pytest-8.3.5, pluggy-1.5.0 -- /home/rahur/nimipythonmyfork/nimi-python/.tox/64/py310-test/bin/python -cachedir: .tox/64/py310-test/.pytest_cache -rootdir: /home/rahur/nimipythonmyfork/nimi-python -configfile: tox.ini -plugins: timeout-2.4.0 -collecting ... collected 251 items - -generated/nifake/nifake/unit_tests/test_converters.py::test_convert_init_with_options_dictionary PASSED -generated/nifake/nifake/unit_tests/test_converters.py::test_convert_timedelta_to_seconds_double PASSED -generated/nifake/nifake/unit_tests/test_converters.py::test_convert_timedelta_to_milliseconds_int32 PASSED -generated/nifake/nifake/unit_tests/test_converters.py::test_convert_timedeltas_to_seconds_real64 PASSED -generated/nifake/nifake/unit_tests/test_converters.py::test_convert_seconds_real64_to_timedelta PASSED -generated/nifake/nifake/unit_tests/test_converters.py::test_convert_seconds_real64_to_timedeltas PASSED -generated/nifake/nifake/unit_tests/test_converters.py::test_repeated_capabilities_string_channel PASSED -generated/nifake/nifake/unit_tests/test_converters.py::test_repeated_capabilities_string_prefix PASSED -generated/nifake/nifake/unit_tests/test_converters.py::test_repeated_capabilities_list_channel PASSED -generated/nifake/nifake/unit_tests/test_converters.py::test_repeated_capabilities_list_prefix PASSED -generated/nifake/nifake/unit_tests/test_converters.py::test_repeated_capabilities_tuple_channel PASSED -generated/nifake/nifake/unit_tests/test_converters.py::test_repeated_capabilities_tuple_prefix PASSED -generated/nifake/nifake/unit_tests/test_converters.py::test_repeated_capabilities_unicode PASSED -generated/nifake/nifake/unit_tests/test_converters.py::test_repeated_capabilities_raw PASSED -generated/nifake/nifake/unit_tests/test_converters.py::test_repeated_capabilities_slice_channel PASSED -generated/nifake/nifake/unit_tests/test_converters.py::test_repeated_capabilities_mixed_channel PASSED -generated/nifake/nifake/unit_tests/test_converters.py::test_repeated_capabilities_mixed_prefix PASSED -generated/nifake/nifake/unit_tests/test_converters.py::test_invalid_repeated_capabilities PASSED -generated/nifake/nifake/unit_tests/test_converters.py::test_repeated_capabilities_slice_prefix PASSED -generated/nifake/nifake/unit_tests/test_converters.py::test_repeated_capabilities_without_prefix PASSED -generated/nifake/nifake/unit_tests/test_converters.py::test_repeated_capabilities_string_resource_name PASSED -generated/nifake/nifake/unit_tests/test_converters.py::test_repeated_capabilities_list_resource_name PASSED -generated/nifake/nifake/unit_tests/test_converters.py::test_repeated_capabilities_tuple_resource_name PASSED -generated/nifake/nifake/unit_tests/test_converters.py::test_repeated_capabilities_mixed_resource_name PASSED -generated/nifake/nifake/unit_tests/test_converters.py::test_repeated_capabilities_invalid_resource_names PASSED -generated/nifake/nifake/unit_tests/test_converters.py::test_expand_channel_string_non_fully_qualified_channel_names PASSED -generated/nifake/nifake/unit_tests/test_converters.py::test_expand_channel_string_fully_qualified_channel_names PASSED -generated/nifake/nifake/unit_tests/test_converters.py::test_convert_chained_repeated_capability_to_parts_three_parts PASSED -generated/nifake/nifake/unit_tests/test_converters.py::test_convert_chained_repeated_capability_to_parts_single_part PASSED -generated/nifake/nifake/unit_tests/test_converters.py::test_convert_chained_repeated_capability_to_parts_empty_string PASSED -generated/nifake/nifake/unit_tests/test_converters.py::test_string_to_list_channel PASSED -generated/nifake/nifake/unit_tests/test_converters.py::test_string_to_list_prefix PASSED -generated/nifake/nifake/unit_tests/test_converters.py::test_convert_comma_separated_string_to_list PASSED -generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_server_unavailable PASSED -generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_function_not_implemented PASSED -generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_api_key_sent_to_init PASSED -generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_new_session_already_exists PASSED -generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_attach_to_non_existent_session PASSED -generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_lock_unlock PASSED -generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_simple_function PASSED -generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_get_a_number PASSED -generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_one_input_function PASSED -generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_vi_int_64_function PASSED -generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_two_input_function PASSED -generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_get_enum_value PASSED -generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_get_a_list_enums PASSED -generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_get_a_boolean PASSED -generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_get_a_list_booleans PASSED -generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_single_point_read_nan PASSED -generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_fetch_waveform PASSED -generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_fetch_waveform_into PASSED -generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_write_waveform PASSED -generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_write_waveform_numpy PASSED -generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_return_multiple_types PASSED -generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_multiple_array_types PASSED -generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_multiple_array_types_none_input PASSED -generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_multiple_arrays_same_size PASSED -generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_multiple_arrays_same_size_none_input PASSED -generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_multiple_arrays_same_size_wrong_size PASSED -generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_parameters_are_multiple_types PASSED -generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_method_with_error PASSED -generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_call_not_enough_parameters_error PASSED -generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_invalid_method_call_wrong_type_error PASSED -generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_method_with_warning PASSED -generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_read_with_warning PASSED -generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_get_a_string_of_fixed_maximum_size PASSED -generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_return_a_number_and_a_string PASSED -generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_get_an_ivi_dance_char_array PASSED -generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_get_string_ivi_dance_error PASSED -generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_get_an_ivi_dance_with_a_twist_string PASSED -generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_get_array_using_ivi_dance PASSED -generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_get_attribute_int32 PASSED -generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_set_attribute_int32 PASSED -generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_get_attribute_real64 PASSED -generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_set_attribute_real64 PASSED -generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_get_attribute_string PASSED -generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_set_attribute_string PASSED -generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_get_attribute_boolean PASSED -generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_set_attribute_boolean PASSED -generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_get_attribute_int64 PASSED -generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_set_attribute_int64 PASSED -generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_error_message_returns_error PASSED -generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_set_custom_type PASSED -generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_get_custom_type PASSED -generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_set_custom_type_array PASSED -generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_get_custom_type_array PASSED -generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_get_custom_type_typedef PASSED -generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_get_cal_date_time PASSED -generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_import_attribute_configuration_buffer PASSED -generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_missing_function PASSED -generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_simple_function PASSED -generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_get_a_number PASSED -generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_one_input_function PASSED -generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_vi_int_64_function PASSED -generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_two_input_function PASSED -generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_get_enum_value PASSED -generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_get_a_list_enums PASSED -generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_get_a_boolean PASSED -generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_get_a_list_booleans PASSED -generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_single_point_read_nan PASSED -generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_fetch_waveform PASSED -generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_fetch_waveform_into PASSED -generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_write_waveform PASSED -generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_write_waveform_numpy PASSED -generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_return_multiple_types PASSED -generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_multiple_array_types PASSED -generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_multiple_array_types_none_input PASSED -generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_multiple_arrays_same_size PASSED -generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_multiple_arrays_same_size_none_input PASSED -generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_parameters_are_multiple_types PASSED -generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_method_with_error PASSED -generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_call_not_enough_parameters_error PASSED -generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_invalid_method_call_wrong_type_error PASSED -generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_method_with_warning PASSED -generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_read_with_warning PASSED -generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_library_interpreter_always_uses_same_library_instance PASSED -generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_set_runtime_environment_is_called_once_if_present PASSED -generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_set_runtime_environment_not_present_in_driver_runtime PASSED -generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_get_a_string_of_fixed_maximum_size PASSED -generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_get_a_string_of_size_python_code PASSED -generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_return_a_number_and_a_string PASSED -generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_get_an_ivi_dance_char_array PASSED -generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_get_string_ivi_dance_error PASSED -generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_get_an_ivi_dance_with_a_twist_string PASSED -generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_get_array_using_ivi_dance PASSED -generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_get_attribute_int32 PASSED -generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_set_attribute_int32 PASSED -generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_get_attribute_real64 PASSED -generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_set_attribute_real64 PASSED -generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_get_attribute_string PASSED -generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_set_attribute_string PASSED -generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_get_attribute_boolean PASSED -generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_set_attribute_boolean PASSED -generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_get_attribute_int64 PASSED -generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_set_attribute_int64 PASSED -generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_get_error_returns_mismatched_error_code PASSED -generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_get_error_and_error_message_returns_error PASSED -generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_get_error_description_error_message_error PASSED -generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_set_custom_type PASSED -generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_get_custom_type PASSED -generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_set_custom_type_array PASSED -generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_get_custom_type_array PASSED -generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_get_custom_type_typedef PASSED -generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_get_array_using_python_code_double PASSED -generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_get_array_using_python_code_custom_type PASSED -generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_get_cal_date_time PASSED -generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_import_attribute_configuration_buffer_list_i8 PASSED -generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_import_attribute_configuration_buffer_bytes PASSED -generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_import_attribute_configuration_buffer_bytearray PASSED -generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_import_attribute_configuration_buffer_array_bytes PASSED -generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_import_attribute_configuration_buffer_str PASSED -generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_write_numpy_complex128_valid_input PASSED -generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_write_waveform_complex_f64_invalid_input PASSED -generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_write_interleaved_complexi16_invalid_input PASSED -generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_write_interleaved_complexi16_valid_input PASSED -generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_matcher_prints PASSED -generated/nifake/nifake/unit_tests/test_library_singleton.py::test_driver_runtime_not_installed_raises_driver_not_installed_error PASSED -generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_init_with_options_and_close PASSED -generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_init_with_options_nondefault_and_close PASSED -generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_close PASSED -generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_session_context_manager PASSED -generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_init_with_error PASSED -generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_close_with_error PASSED -generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_session_context_manager_init_with_error PASSED -generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_session_context_manager_close_with_error PASSED -generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_lock_session_none PASSED -generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_unlock_session_none PASSED -generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_lock_context_manager PASSED -generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_lock_context_manager_abnormal_exit PASSED -generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_self_test PASSED -generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_self_test_fail PASSED -generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_acquisition_context_manager PASSED -generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_acquisition_no_context_manager PASSED -generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_single_point_read_timedelta PASSED -generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_enum_input_function_with_defaults PASSED -generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_string_valued_enum_input_function_with_defaults PASSED -generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_fetch_waveform_into_wrong_type PASSED -generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_parameters_are_multiple_types_error PASSED -generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_error_with_rep_cap PASSED -generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_call_not_enough_parameters_error PASSED -generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_enum_input_function_with_defaults_bad_type_error PASSED -generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_get_channel_names PASSED -generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_repeated_capability_method_on_session_timedelta PASSED -generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_repeated_capability_method_on_specific_channel PASSED -generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_device_method_not_exist_on_repeated_capability_error PASSED -generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_repeated_capabilities_list PASSED -generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_chained_repeated_capabilities_list PASSED -generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_chained_repeated_capability_method_on_specific_channel PASSED -generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_function_with_repeated_capability_type PASSED -generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_get_attribute_int32 PASSED -generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_set_attribute_int32 PASSED -generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_get_attribute_int32_with_converter PASSED -generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_set_attribute_int32_with_converter PASSED -generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_get_attribute_real64 PASSED -generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_set_attribute_real64 PASSED -generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_get_attribute_real64_with_converter PASSED -generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_set_attribute_real64_with_converter PASSED -generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_get_attribute_string PASSED -generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_set_attribute_string PASSED -generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_get_attribute_string_with_converter PASSED -generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_set_attribute_string_with_converter PASSED -generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_get_attribute_boolean PASSED -generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_set_attribute_boolean PASSED -generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_get_attribute_enum_int32 PASSED -generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_set_attribute_enum_int32 PASSED -generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_get_attribute_enum_real64 PASSED -generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_set_attribute_enum_real64 PASSED -generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_get_attribute_enum_with_converter PASSED -generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_get_attribute_enum_with_converter_invalid_value_from_driver PASSED -generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_set_attribute_enum_with_converter PASSED -generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_set_attribute_enum_with_converter_invalid_input PASSED -generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_get_attribute_channel PASSED -generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_set_attribute_channel PASSED -generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_get_attribute_int64 PASSED -generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_set_attribute_int64 PASSED -generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_get_attribute_error PASSED -generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_set_attribute_error PASSED -generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_add_properties_to_session_error_set PASSED -generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_add_properties_to_session_error_get PASSED -generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_add_properties_to_repeated_capability_error_set PASSED -generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_add_properties_to_repeated_capability_error_get PASSED -generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_set_enum_attribute_int32_error PASSED -generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_set_wrong_enum_attribute_int32_error PASSED -generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_multiple_arrays_same_size_wrong_size_2 PASSED -generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_multiple_arrays_same_size_wrong_size_3 PASSED -generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_multiple_arrays_same_size_wrong_size_4 PASSED -generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_get_cal_date_time PASSED -generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_get_cal_interval PASSED -generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_import_attribute_configuration_buffer_list_i8_big PASSED -generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_import_attribute_configuration_buffer_list_i8_float PASSED -generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_import_attribute_configuration_buffer_list_i8_big_float PASSED -generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_export_attribute_configuration_buffer PASSED -generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_channel_on_session PASSED -generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_function_name PASSED -generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_buffer_converter PASSED -generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_nitclk_integration PASSED -generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_accept_list_of_time_values_as_floats PASSED -generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_accept_array_of_time_values_as_floats PASSED -generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_accept_list_of_time_values_as_timedelta_instances PASSED -generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_return_timedelta PASSED -generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_return_timedeltas PASSED -generated/nifake/nifake/unit_tests/test_session.py::TestGrpcSession::test_init_with_options_and_close PASSED -generated/nifake/nifake/unit_tests/test_session.py::TestGrpcSession::test_lock_session_none PASSED -generated/nifake/nifake/unit_tests/test_session.py::TestGrpcSession::test_unlock_session_none PASSED -generated/nifake/nifake/unit_tests/test_session.py::TestGrpcSession::test_lock_context_manager PASSED -generated/nifake/nifake/unit_tests/test_session.py::TestGrpcSession::test_lock_context_manager_abnormal_exit PASSED -generated/nifake/nifake/unit_tests/test_session.py::TestGrpcSession::test_self_test PASSED -generated/nifake/nifake/unit_tests/test_session.py::TestGrpcSession::test_export_attribute_configuration_buffer PASSED -generated/nifake/nifake/unit_tests/test_session.py::TestGrpcSession::test_get_attribute_int32 PASSED -generated/nifake/nifake/unit_tests/test_session.py::test_diagnostic_information OS: - Name: Linux - Version: #1 SMP Tue Nov 5 00:21:55 UTC 2024 - Bits: 64 -Driver: - Name: NI-FAKE - Version: Unknown -Module: - Name: nifake - Version: 1.4.10.dev0 -Python: - Version: 3.10.12 (main, Feb 4 2025, 14:57:36) [GCC 11.4.0] - Bits: 64 - Is_Venv: True - Installed Packages: - Mako==1.3.10 - MarkupSafe==3.0.2 - coverage==7.8.0 - grpcio==1.67.0 - hightime==0.2.2 - nifake==1.4.10.dev0 - nitclk==1.4.10.dev0 - pip==25.1.1 - pluggy==1.5.0 - pytest==8.3.5 - pytest-timeout==2.4.0 - setuptools==80.3.1 -PASSED -generated/nifake/nifake/unit_tests/test_session.py::test_dunder_version Version = 1.4.10.dev0 -PASSED - -============================= 251 passed in 7.26s ============================== -py310-test: commands[5]> coverage report -Name Stmts Miss Cover ------------------------------------------------------------------------------ -generated/nifake/nifake/__init__.py 76 14 82% -generated/nifake/nifake/_attributes.py 79 3 96% -generated/nifake/nifake/_complextype.py 8 0 100% -generated/nifake/nifake/_converters.py 132 6 95% -generated/nifake/nifake/_grpc_stub_interpreter.py 244 40 84% -generated/nifake/nifake/_visatype.py 19 0 100% -generated/nifake/nifake/custom_struct.py 28 3 89% -generated/nifake/nifake/custom_struct_nested_typedef.py 26 2 92% -generated/nifake/nifake/custom_struct_typedef.py 24 2 92% -generated/nifake/nifake/enums.py 42 0 100% -generated/nifake/nifake/errors.py 61 3 95% -generated/nifake/nifake/grpc_session_options.py 16 0 100% -generated/nifake/nifake/session.py 465 107 77% ------------------------------------------------------------------------------ -TOTAL 1220 180 85% -py310-test: commands[6]> coverage xml -o nifakeunittest.xml -Wrote XML report to nifakeunittest.xml -py310-test: commands[7]> coverage html --directory=generated/htmlcov/unit_tests/nifake -Wrote HTML report to generated/htmlcov/unit_tests/nifake/index.html -py310-test: commands[8]> coverage run --rcfile=tools/coverage_unit_tests.rc --source nidcpower -m pytest generated/nidcpower/nidcpower -s -============================= test session starts ============================== -platform linux -- Python 3.10.12, pytest-8.3.5, pluggy-1.5.0 -- /home/rahur/nimipythonmyfork/nimi-python/.tox/64/py310-test/bin/python -cachedir: .tox/64/py310-test/.pytest_cache -rootdir: /home/rahur/nimipythonmyfork/nimi-python -configfile: tox.ini -plugins: timeout-2.4.0 -collecting ... collected 7 items - -generated/nidcpower/nidcpower/unit_tests/test_nidcpower.py::test_lcr_measurement[ctype_members0-Dev1/0-expected_python_members0-Channel : Dev1/0\nDC voltage : 0.1 V\nDC current : 0.001 A\nStimulus frequency : 10,000 Hz\nAC voltage : 1+0.1j V RMS\nAC current : 0.01+0.001j A RMS\nImpedance : 100+10j \u03a9\nImpedance magnitude : 100.499 \u03a9\nImpedance phase : 5.71059 \xb0\nAdmittance : 0.00990099-0.000990099j S\nAdmittance magnitude: 0.00995037 S\nAdmittance phase : -5.71059 \xb0\nSeries inductance : 10 H\nSeries capacitance : 20 F\nSeries resistance : 90 \u03a9\nParallel inductance : 30 H\nParallel capacitance: 40 F\nParallel resistance : 110 \u03a9\nDissipation factor : 10\nQuality factor : 0.1\nMeasurement mode : SMU_PS\nDC in compliance : True\nAC in compliance : True\nUnbalanced : True\n] PASSED -generated/nidcpower/nidcpower/unit_tests/test_nidcpower.py::test_lcr_measurement[ctype_members1-1-expected_python_members1-Channel : 1\nDC voltage : 0 V\nDC current : 0 A\nStimulus frequency : 0 Hz\nAC voltage : 0+0j V RMS\nAC current : 0+0j A RMS\nImpedance : 0+0j \u03a9\nImpedance magnitude : 0 \u03a9\nImpedance phase : 0 \xb0\nAdmittance : nan+nanj S\nAdmittance magnitude: nan S\nAdmittance phase : nan \xb0\nSeries inductance : 0 H\nSeries capacitance : 0 F\nSeries resistance : 0 \u03a9\nParallel inductance : 0 H\nParallel capacitance: 0 F\nParallel resistance : 0 \u03a9\nDissipation factor : 0\nQuality factor : nan\nMeasurement mode : LCR\nDC in compliance : False\nAC in compliance : False\nUnbalanced : False\n] PASSED -generated/nidcpower/nidcpower/unit_tests/test_nidcpower.py::test_lcr_load_compensation_spot[python_init_params0-nidcpower.lcr_load_compensation_spot.LCRLoadCompensationSpot(frequency=200.0, reference_value_type=nidcpower.enums.LCRReferenceValueType.IMPEDANCE, reference_value=(3+4j))-Frequency : 200 Hz\nImpedance : 3+4j \u03a9\n-expected_ctype_members0] PASSED -generated/nidcpower/nidcpower/unit_tests/test_nidcpower.py::test_lcr_load_compensation_spot[python_init_params1-nidcpower.lcr_load_compensation_spot.LCRLoadCompensationSpot(frequency=300.0, reference_value_type=nidcpower.enums.LCRReferenceValueType.IDEAL_CAPACITANCE, reference_value=5.0)-Frequency : 300 Hz\nIdeal Capacitance: 5 F\n-expected_ctype_members1] PASSED -generated/nidcpower/nidcpower/unit_tests/test_nidcpower.py::test_lcr_load_compensation_spot[python_init_params2-nidcpower.lcr_load_compensation_spot.LCRLoadCompensationSpot(frequency=400.0, reference_value_type=nidcpower.enums.LCRReferenceValueType.IDEAL_INDUCTANCE, reference_value=6.0)-Frequency : 400 Hz\nIdeal Inductance : 6 H\n-expected_ctype_members2] PASSED -generated/nidcpower/nidcpower/unit_tests/test_nidcpower.py::test_lcr_load_compensation_spot[python_init_params3-nidcpower.lcr_load_compensation_spot.LCRLoadCompensationSpot(frequency=500.0, reference_value_type=nidcpower.enums.LCRReferenceValueType.IDEAL_RESISTANCE, reference_value=7.0)-Frequency : 500 Hz\nIdeal Resistance : 7 \u03a9\n-expected_ctype_members3] PASSED -generated/nidcpower/nidcpower/unit_tests/test_nidcpower.py::test_lcr_load_compensation_spot_byte_packing_alignment PASSED - -============================== 7 passed in 0.32s =============================== -py310-test: commands[9]> coverage report -Name Stmts Miss Cover ---------------------------------------------------------------------------------- -generated/nidcpower/nidcpower/lcr_load_compensation_spot.py 33 5 85% -generated/nidcpower/nidcpower/lcr_measurement.py 53 4 92% ---------------------------------------------------------------------------------- -TOTAL 86 9 90% -py310-test: commands[10]> coverage xml -o nidcpowerunittest.xml -Wrote XML report to nidcpowerunittest.xml -py310-test: commands[11]> coverage html --directory=generated/htmlcov/unit_tests/nidcpower -Wrote HTML report to generated/htmlcov/unit_tests/nidcpower/index.html -py310-test: commands[12]> coverage run --rcfile=tools/coverage_unit_tests.rc --source nidigital -m pytest generated/nidigital/nidigital -s -============================= test session starts ============================== -platform linux -- Python 3.10.12, pytest-8.3.5, pluggy-1.5.0 -- /home/rahur/nimipythonmyfork/nimi-python/.tox/64/py310-test/bin/python -cachedir: .tox/64/py310-test/.pytest_cache -rootdir: /home/rahur/nimipythonmyfork/nimi-python -configfile: tox.ini -plugins: timeout-2.4.0 -collecting ... collected 8 items - -generated/nidigital/nidigital/unit_tests/test_nidigital.py::TestSession::test_fetch_history_ram_cycle_information_position_out_of_bound PASSED -generated/nidigital/nidigital/unit_tests/test_nidigital.py::TestSession::test_fetch_history_ram_cycle_information_position_last PASSED -generated/nidigital/nidigital/unit_tests/test_nidigital.py::TestSession::test_fetch_history_ram_cycle_information_samples_to_read_too_much PASSED -generated/nidigital/nidigital/unit_tests/test_nidigital.py::TestSession::test_fetch_history_ram_cycle_information_samples_to_read_all PASSED -generated/nidigital/nidigital/unit_tests/test_nidigital.py::TestSession::test_fetch_history_ram_cycle_information_pin_list PASSED -generated/nidigital/nidigital/unit_tests/test_nidigital.py::TestSession::test_fetch_history_ram_cycle_information_site_n PASSED -generated/nidigital/nidigital/unit_tests/test_nidigital.py::TestSession::test_pin_state_enum_print PASSED -generated/nidigital/nidigital/unit_tests/test_nidigital.py::TestSession::test_write_static_pin_state_enum_print PASSED - -============================== 8 passed in 0.46s =============================== -py310-test: commands[13]> coverage report -Name Stmts Miss Cover --------------------------------------------------------------- -generated/nidigital/nidigital/session.py 786 248 68% --------------------------------------------------------------- -TOTAL 786 248 68% -py310-test: commands[14]> coverage xml -o nidigitalunittest.xml -Wrote XML report to nidigitalunittest.xml -py310-test: commands[15]> coverage html --directory=generated/htmlcov/unit_tests/nidigital -Wrote HTML report to generated/htmlcov/unit_tests/nidigital/index.html -py310-test: commands[16]> coverage run --rcfile=tools/coverage_unit_tests.rc --source nimodinst -m pytest generated/nimodinst/nimodinst -s -============================= test session starts ============================== -platform linux -- Python 3.10.12, pytest-8.3.5, pluggy-1.5.0 -- /home/rahur/nimipythonmyfork/nimi-python/.tox/64/py310-test/bin/python -cachedir: .tox/64/py310-test/.pytest_cache -rootdir: /home/rahur/nimipythonmyfork/nimi-python -configfile: tox.ini -plugins: timeout-2.4.0 -collecting ... collected 23 items - -generated/nimodinst/nimodinst/unit_tests/test_modinst.py::TestSession::test_open_and_close PASSED -generated/nimodinst/nimodinst/unit_tests/test_modinst.py::TestSession::test_close PASSED -generated/nimodinst/nimodinst/unit_tests/test_modinst.py::TestSession::test_context_manager PASSED -generated/nimodinst/nimodinst/unit_tests/test_modinst.py::TestSession::test_iterating_for PASSED -generated/nimodinst/nimodinst/unit_tests/test_modinst.py::TestSession::test_iterating_for_empty PASSED -generated/nimodinst/nimodinst/unit_tests/test_modinst.py::TestSession::test_get_extended_error_info PASSED -generated/nimodinst/nimodinst/unit_tests/test_modinst.py::TestSession::test_get_error_description_fails PASSED -generated/nimodinst/nimodinst/unit_tests/test_modinst.py::TestSession::test_get_attribute_session PASSED -generated/nimodinst/nimodinst/unit_tests/test_modinst.py::TestSession::test_get_attribute_vi_int32_for_loop_index PASSED -generated/nimodinst/nimodinst/unit_tests/test_modinst.py::TestSession::test_get_attribute_vi_string_for_loop_index PASSED -generated/nimodinst/nimodinst/unit_tests/test_modinst.py::TestSession::test_get_attribute_session_no_index PASSED -generated/nimodinst/nimodinst/unit_tests/test_modinst.py::TestSession::test_get_attribute_vi_int32_for_loop_multiple_devices PASSED -generated/nimodinst/nimodinst/unit_tests/test_modinst.py::TestSession::test_get_attribute_vi_string_for_loop_multiple_devices PASSED -generated/nimodinst/nimodinst/unit_tests/test_modinst.py::TestSession::test_cannot_add_properties_to_session_set PASSED -generated/nimodinst/nimodinst/unit_tests/test_modinst.py::TestSession::test_cannot_add_properties_to_session_get PASSED -generated/nimodinst/nimodinst/unit_tests/test_modinst.py::TestSession::test_cannot_add_properties_to_device_set PASSED -generated/nimodinst/nimodinst/unit_tests/test_modinst.py::TestSession::test_cannot_add_properties_to_device_get PASSED -generated/nimodinst/nimodinst/unit_tests/test_modinst.py::TestSession::test_vi_int32_attribute_read_only PASSED -generated/nimodinst/nimodinst/unit_tests/test_modinst.py::TestSession::test_vi_string_attribute_read_only PASSED -generated/nimodinst/nimodinst/unit_tests/test_modinst.py::TestSession::test_int_attribute_error PASSED -generated/nimodinst/nimodinst/unit_tests/test_modinst.py::TestSession::test_int_attribute_warning PASSED -generated/nimodinst/nimodinst/unit_tests/test_modinst.py::TestSession::test_repr_and_str nimodinst.Session(driver=''): -nimodinst._Device(owner=nimodinst.Session(driver=''), index=0): - bus_number = 42 - chassis_number = 42 - device_model = 'fourty two' - device_name = 'fourty two' - max_pciexpress_link_width = 42 - pciexpress_link_width = 42 - serial_number = 'fourty two' - slot_number = 42 - socket_number = 42 - -nimodinst._Device(owner=nimodinst.Session(driver=''), index=1): - bus_number = 42 - chassis_number = 42 - device_model = 'fourty two' - device_name = 'fourty two' - max_pciexpress_link_width = 42 - pciexpress_link_width = 42 - serial_number = 'fourty two' - slot_number = 42 - socket_number = 42 - - -nimodinst._Device(owner=nimodinst.Session(driver=''), index=0): - bus_number = 42 - chassis_number = 42 - device_model = 'fourty two' - device_name = 'fourty two' - max_pciexpress_link_width = 42 - pciexpress_link_width = 42 - serial_number = 'fourty two' - slot_number = 42 - socket_number = 42 - -nimodinst._Device(owner=nimodinst.Session(driver=''), index=1): - bus_number = 42 - chassis_number = 42 - device_model = 'fourty two' - device_name = 'fourty two' - max_pciexpress_link_width = 42 - pciexpress_link_width = 42 - serial_number = 'fourty two' - slot_number = 42 - socket_number = 42 - -PASSED -generated/nimodinst/nimodinst/unit_tests/test_modinst.py::test_diagnostic_information OS: - Name: Linux - Version: #1 SMP Tue Nov 5 00:21:55 UTC 2024 - Bits: 64 -Driver: - Name: NI-ModInst - Version: Unknown -Module: - Name: nimodinst - Version: 1.4.10.dev0 -Python: - Version: 3.10.12 (main, Feb 4 2025, 14:57:36) [GCC 11.4.0] - Bits: 64 - Is_Venv: True - Installed Packages: - Mako==1.3.10 - MarkupSafe==3.0.2 - coverage==7.8.0 - grpcio==1.67.0 - hightime==0.2.2 - nimodinst==1.4.10.dev0 - nitclk==1.4.10.dev0 - pip==25.1.1 - pluggy==1.5.0 - pytest==8.3.5 - pytest-timeout==2.4.0 - setuptools==80.3.1 -PASSED - -============================== 23 passed in 0.29s ============================== -py310-test: commands[17]> coverage report -Name Stmts Miss Cover --------------------------------------------------------------- -generated/nimodinst/nimodinst/session.py 138 8 94% --------------------------------------------------------------- -TOTAL 138 8 94% -py310-test: commands[18]> coverage xml -o nimodinstunittest.xml -Wrote XML report to nimodinstunittest.xml -py310-test: commands[19]> coverage html --directory=generated/htmlcov/unit_tests/nimodinst -Wrote HTML report to generated/htmlcov/unit_tests/nimodinst/index.html -py310-test: commands[20]> coverage run --rcfile=tools/coverage_unit_tests.rc --source niscope -m pytest generated/niscope/niscope -s -============================= test session starts ============================== -platform linux -- Python 3.10.12, pytest-8.3.5, pluggy-1.5.0 -- /home/rahur/nimipythonmyfork/nimi-python/.tox/64/py310-test/bin/python -cachedir: .tox/64/py310-test/.pytest_cache -rootdir: /home/rahur/nimipythonmyfork/nimi-python -configfile: tox.ini -plugins: timeout-2.4.0 -collecting ... collected 2 items - -generated/niscope/niscope/unit_tests/test_niscope.py::test_populate_samples_info PASSED -generated/niscope/niscope/unit_tests/test_niscope.py::test_populate_channel_and_record_info PASSED - -============================== 2 passed in 0.32s =============================== -py310-test: commands[21]> coverage report -Name Stmts Miss Cover ----------------------------------------------------------------- -generated/niscope/niscope/waveform_info.py 81 46 43% ----------------------------------------------------------------- -TOTAL 81 46 43% -py310-test: commands[22]> coverage xml -o niscopeunittest.xml -Wrote XML report to niscopeunittest.xml -py310-test: commands[23]> coverage html --directory=generated/htmlcov/unit_tests/niscope -Wrote HTML report to generated/htmlcov/unit_tests/niscope/index.html -py310-test: commands[24]> coverage run --rcfile=tools/coverage_unit_tests.rc --source nitclk -m pytest generated/nitclk/nitclk -s -============================= test session starts ============================== -platform linux -- Python 3.10.12, pytest-8.3.5, pluggy-1.5.0 -- /home/rahur/nimipythonmyfork/nimi-python/.tox/64/py310-test/bin/python -cachedir: .tox/64/py310-test/.pytest_cache -rootdir: /home/rahur/nimipythonmyfork/nimi-python -configfile: tox.ini -plugins: timeout-2.4.0 -collecting ... collected 25 items - -generated/nitclk/nitclk/unit_tests/test_nitclk.py::TestNitclkApi::test_initialize_one_session PASSED -generated/nitclk/nitclk/unit_tests/test_nitclk.py::TestNitclkApi::test_initialize_multiple_sessions PASSED -generated/nitclk/nitclk/unit_tests/test_nitclk.py::TestNitclkApi::test_configure_for_homogeneous_triggers PASSED -generated/nitclk/nitclk/unit_tests/test_nitclk.py::TestNitclkApi::test_finish_sync_pulse_sender_synchronize PASSED -generated/nitclk/nitclk/unit_tests/test_nitclk.py::TestNitclkApi::test_is_done PASSED -generated/nitclk/nitclk/unit_tests/test_nitclk.py::TestNitclkApi::test_setup_for_sync_pulse_sender_synchronize PASSED -generated/nitclk/nitclk/unit_tests/test_nitclk.py::TestNitclkApi::test_synchronize PASSED -generated/nitclk/nitclk/unit_tests/test_nitclk.py::TestNitclkApi::test_synchronize_timedelta PASSED -generated/nitclk/nitclk/unit_tests/test_nitclk.py::TestNitclkApi::test_synchronize_to_sync_pulse_sender PASSED -generated/nitclk/nitclk/unit_tests/test_nitclk.py::TestNitclkApi::test_wait_until_done PASSED -generated/nitclk/nitclk/unit_tests/test_nitclk.py::TestNitclkApi::test_api_error PASSED -generated/nitclk/nitclk/unit_tests/test_nitclk.py::TestNitclkApi::test_api_get_error_description_fails PASSED -generated/nitclk/nitclk/unit_tests/test_nitclk.py::TestNitclkApi::test_session_reference_error PASSED -generated/nitclk/nitclk/unit_tests/test_nitclk.py::TestNitclkApi::test_session_reference_get_error_description_fails PASSED -generated/nitclk/nitclk/unit_tests/test_nitclk.py::TestNitclkApi::test_set_vi_real64 PASSED -generated/nitclk/nitclk/unit_tests/test_nitclk.py::TestNitclkApi::test_get_vi_real64 PASSED -generated/nitclk/nitclk/unit_tests/test_nitclk.py::TestNitclkApi::test_set_timedelta_as_vi_real64 PASSED -generated/nitclk/nitclk/unit_tests/test_nitclk.py::TestNitclkApi::test_set_timedelta_as_timedelta PASSED -generated/nitclk/nitclk/unit_tests/test_nitclk.py::TestNitclkApi::test_get_timedelta PASSED -generated/nitclk/nitclk/unit_tests/test_nitclk.py::TestNitclkApi::test_set_vi_string PASSED -generated/nitclk/nitclk/unit_tests/test_nitclk.py::TestNitclkApi::test_get_vi_string PASSED -generated/nitclk/nitclk/unit_tests/test_nitclk.py::TestNitclkApi::test_set_vi_session_with_int PASSED -generated/nitclk/nitclk/unit_tests/test_nitclk.py::TestNitclkApi::test_set_vi_session_with_session_reference PASSED -generated/nitclk/nitclk/unit_tests/test_nitclk.py::TestNitclkApi::test_set_vi_session_with_session PASSED -generated/nitclk/nitclk/unit_tests/test_nitclk.py::TestNitclkApi::test_get_tclk_session_reference PASSED - -============================== 25 passed in 0.32s ============================== -py310-test: commands[25]> coverage report -Name Stmts Miss Cover --------------------------------------------------------- -generated/nitclk/nitclk/session.py 115 2 98% --------------------------------------------------------- -TOTAL 115 2 98% -py310-test: commands[26]> coverage xml -o nitclkunittest.xml -Wrote XML report to nitclkunittest.xml -py310-test: commands[27]> coverage html --directory=generated/htmlcov/unit_tests/nitclk -Wrote HTML report to generated/htmlcov/unit_tests/nitclk/index.html -py310-test: OK ✔ in 13.43 seconds -py311-test: skipped because could not find python interpreter with spec(s): py311 -py311-test: SKIP ⚠ in 0.21 seconds -py312-test: commands[0]> python --version -Python 3.12.10 -py312-test: commands[1]> python -c 'import platform; print(platform.architecture())' -('64bit', 'ELF') -py312-test: commands[2]> python -m pip install --disable-pip-version-check --upgrade pip -Requirement already satisfied: pip in ./.tox/64/py312-test/lib/python3.12/site-packages (25.1.1) -py312-test: commands[3]> python tools/install_local_wheel.py --driver nitclk -Processing ./generated/nitclk/dist/nitclk-1.4.10.dev0-py3-none-any.whl -Requirement already satisfied: hightime>=0.2.0 in ./.tox/64/py312-test/lib/python3.12/site-packages (from nitclk==1.4.10.dev0) (0.2.2) -nitclk is already installed with the same version as the provided wheel. Use --force-reinstall to force an installation of the wheel. -py312-test: commands[4]> coverage run --rcfile=tools/coverage_unit_tests.rc --source nifake -m pytest generated/nifake/nifake -s -============================= test session starts ============================== -platform linux -- Python 3.12.10, pytest-8.3.5, pluggy-1.5.0 -- /home/rahur/nimipythonmyfork/nimi-python/.tox/64/py312-test/bin/python -cachedir: .tox/64/py312-test/.pytest_cache -rootdir: /home/rahur/nimipythonmyfork/nimi-python -configfile: tox.ini -plugins: timeout-2.4.0 -collecting ... collected 251 items - -generated/nifake/nifake/unit_tests/test_converters.py::test_convert_init_with_options_dictionary PASSED -generated/nifake/nifake/unit_tests/test_converters.py::test_convert_timedelta_to_seconds_double PASSED -generated/nifake/nifake/unit_tests/test_converters.py::test_convert_timedelta_to_milliseconds_int32 PASSED -generated/nifake/nifake/unit_tests/test_converters.py::test_convert_timedeltas_to_seconds_real64 PASSED -generated/nifake/nifake/unit_tests/test_converters.py::test_convert_seconds_real64_to_timedelta PASSED -generated/nifake/nifake/unit_tests/test_converters.py::test_convert_seconds_real64_to_timedeltas PASSED -generated/nifake/nifake/unit_tests/test_converters.py::test_repeated_capabilities_string_channel PASSED -generated/nifake/nifake/unit_tests/test_converters.py::test_repeated_capabilities_string_prefix PASSED -generated/nifake/nifake/unit_tests/test_converters.py::test_repeated_capabilities_list_channel PASSED -generated/nifake/nifake/unit_tests/test_converters.py::test_repeated_capabilities_list_prefix PASSED -generated/nifake/nifake/unit_tests/test_converters.py::test_repeated_capabilities_tuple_channel PASSED -generated/nifake/nifake/unit_tests/test_converters.py::test_repeated_capabilities_tuple_prefix PASSED -generated/nifake/nifake/unit_tests/test_converters.py::test_repeated_capabilities_unicode PASSED -generated/nifake/nifake/unit_tests/test_converters.py::test_repeated_capabilities_raw PASSED -generated/nifake/nifake/unit_tests/test_converters.py::test_repeated_capabilities_slice_channel PASSED -generated/nifake/nifake/unit_tests/test_converters.py::test_repeated_capabilities_mixed_channel PASSED -generated/nifake/nifake/unit_tests/test_converters.py::test_repeated_capabilities_mixed_prefix PASSED -generated/nifake/nifake/unit_tests/test_converters.py::test_invalid_repeated_capabilities PASSED -generated/nifake/nifake/unit_tests/test_converters.py::test_repeated_capabilities_slice_prefix PASSED -generated/nifake/nifake/unit_tests/test_converters.py::test_repeated_capabilities_without_prefix PASSED -generated/nifake/nifake/unit_tests/test_converters.py::test_repeated_capabilities_string_resource_name PASSED -generated/nifake/nifake/unit_tests/test_converters.py::test_repeated_capabilities_list_resource_name PASSED -generated/nifake/nifake/unit_tests/test_converters.py::test_repeated_capabilities_tuple_resource_name PASSED -generated/nifake/nifake/unit_tests/test_converters.py::test_repeated_capabilities_mixed_resource_name PASSED -generated/nifake/nifake/unit_tests/test_converters.py::test_repeated_capabilities_invalid_resource_names PASSED -generated/nifake/nifake/unit_tests/test_converters.py::test_expand_channel_string_non_fully_qualified_channel_names PASSED -generated/nifake/nifake/unit_tests/test_converters.py::test_expand_channel_string_fully_qualified_channel_names PASSED -generated/nifake/nifake/unit_tests/test_converters.py::test_convert_chained_repeated_capability_to_parts_three_parts PASSED -generated/nifake/nifake/unit_tests/test_converters.py::test_convert_chained_repeated_capability_to_parts_single_part PASSED -generated/nifake/nifake/unit_tests/test_converters.py::test_convert_chained_repeated_capability_to_parts_empty_string PASSED -generated/nifake/nifake/unit_tests/test_converters.py::test_string_to_list_channel PASSED -generated/nifake/nifake/unit_tests/test_converters.py::test_string_to_list_prefix PASSED -generated/nifake/nifake/unit_tests/test_converters.py::test_convert_comma_separated_string_to_list PASSED -generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_server_unavailable PASSED -generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_function_not_implemented PASSED -generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_api_key_sent_to_init PASSED -generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_new_session_already_exists PASSED -generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_attach_to_non_existent_session PASSED -generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_lock_unlock PASSED -generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_simple_function PASSED -generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_get_a_number PASSED -generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_one_input_function PASSED -generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_vi_int_64_function PASSED -generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_two_input_function PASSED -generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_get_enum_value PASSED -generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_get_a_list_enums PASSED -generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_get_a_boolean PASSED -generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_get_a_list_booleans PASSED -generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_single_point_read_nan PASSED -generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_fetch_waveform PASSED -generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_fetch_waveform_into PASSED -generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_write_waveform PASSED -generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_write_waveform_numpy PASSED -generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_return_multiple_types PASSED -generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_multiple_array_types PASSED -generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_multiple_array_types_none_input PASSED -generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_multiple_arrays_same_size PASSED -generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_multiple_arrays_same_size_none_input PASSED -generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_multiple_arrays_same_size_wrong_size PASSED -generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_parameters_are_multiple_types PASSED -generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_method_with_error PASSED -generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_call_not_enough_parameters_error PASSED -generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_invalid_method_call_wrong_type_error PASSED -generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_method_with_warning PASSED -generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_read_with_warning PASSED -generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_get_a_string_of_fixed_maximum_size PASSED -generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_return_a_number_and_a_string PASSED -generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_get_an_ivi_dance_char_array PASSED -generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_get_string_ivi_dance_error PASSED -generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_get_an_ivi_dance_with_a_twist_string PASSED -generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_get_array_using_ivi_dance PASSED -generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_get_attribute_int32 PASSED -generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_set_attribute_int32 PASSED -generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_get_attribute_real64 PASSED -generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_set_attribute_real64 PASSED -generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_get_attribute_string PASSED -generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_set_attribute_string PASSED -generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_get_attribute_boolean PASSED -generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_set_attribute_boolean PASSED -generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_get_attribute_int64 PASSED -generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_set_attribute_int64 PASSED -generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_error_message_returns_error PASSED -generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_set_custom_type PASSED -generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_get_custom_type PASSED -generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_set_custom_type_array PASSED -generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_get_custom_type_array PASSED -generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_get_custom_type_typedef PASSED -generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_get_cal_date_time PASSED -generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_import_attribute_configuration_buffer PASSED -generated/nifake/nifake/unit_tests/test_grpc.py::TestGrpcStubInterpreter::test_missing_function PASSED -generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_simple_function PASSED -generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_get_a_number PASSED -generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_one_input_function PASSED -generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_vi_int_64_function PASSED -generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_two_input_function PASSED -generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_get_enum_value PASSED -generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_get_a_list_enums PASSED -generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_get_a_boolean PASSED -generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_get_a_list_booleans PASSED -generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_single_point_read_nan PASSED -generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_fetch_waveform PASSED -generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_fetch_waveform_into PASSED -generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_write_waveform PASSED -generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_write_waveform_numpy PASSED -generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_return_multiple_types PASSED -generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_multiple_array_types PASSED -generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_multiple_array_types_none_input PASSED -generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_multiple_arrays_same_size PASSED -generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_multiple_arrays_same_size_none_input PASSED -generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_parameters_are_multiple_types PASSED -generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_method_with_error PASSED -generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_call_not_enough_parameters_error PASSED -generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_invalid_method_call_wrong_type_error PASSED -generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_method_with_warning PASSED -generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_read_with_warning PASSED -generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_library_interpreter_always_uses_same_library_instance PASSED -generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_set_runtime_environment_is_called_once_if_present PASSED -generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_set_runtime_environment_not_present_in_driver_runtime PASSED -generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_get_a_string_of_fixed_maximum_size PASSED -generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_get_a_string_of_size_python_code PASSED -generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_return_a_number_and_a_string PASSED -generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_get_an_ivi_dance_char_array PASSED -generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_get_string_ivi_dance_error PASSED -generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_get_an_ivi_dance_with_a_twist_string PASSED -generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_get_array_using_ivi_dance PASSED -generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_get_attribute_int32 PASSED -generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_set_attribute_int32 PASSED -generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_get_attribute_real64 PASSED -generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_set_attribute_real64 PASSED -generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_get_attribute_string PASSED -generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_set_attribute_string PASSED -generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_get_attribute_boolean PASSED -generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_set_attribute_boolean PASSED -generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_get_attribute_int64 PASSED -generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_set_attribute_int64 PASSED -generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_get_error_returns_mismatched_error_code PASSED -generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_get_error_and_error_message_returns_error PASSED -generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_get_error_description_error_message_error PASSED -generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_set_custom_type PASSED -generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_get_custom_type PASSED -generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_set_custom_type_array PASSED -generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_get_custom_type_array PASSED -generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_get_custom_type_typedef PASSED -generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_get_array_using_python_code_double PASSED -generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_get_array_using_python_code_custom_type PASSED -generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_get_cal_date_time PASSED -generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_import_attribute_configuration_buffer_list_i8 PASSED -generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_import_attribute_configuration_buffer_bytes PASSED -generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_import_attribute_configuration_buffer_bytearray PASSED -generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_import_attribute_configuration_buffer_array_bytes PASSED -generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_import_attribute_configuration_buffer_str PASSED -generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_write_numpy_complex128_valid_input PASSED -generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_write_waveform_complex_f64_invalid_input PASSED -generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_write_interleaved_complexi16_invalid_input PASSED -generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_write_interleaved_complexi16_valid_input PASSED -generated/nifake/nifake/unit_tests/test_library_interpreter.py::TestLibraryInterpreter::test_matcher_prints PASSED -generated/nifake/nifake/unit_tests/test_library_singleton.py::test_driver_runtime_not_installed_raises_driver_not_installed_error PASSED -generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_init_with_options_and_close PASSED -generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_init_with_options_nondefault_and_close PASSED -generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_close PASSED -generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_session_context_manager PASSED -generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_init_with_error PASSED -generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_close_with_error PASSED -generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_session_context_manager_init_with_error PASSED -generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_session_context_manager_close_with_error PASSED -generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_lock_session_none PASSED -generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_unlock_session_none PASSED -generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_lock_context_manager PASSED -generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_lock_context_manager_abnormal_exit PASSED -generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_self_test PASSED -generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_self_test_fail PASSED -generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_acquisition_context_manager PASSED -generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_acquisition_no_context_manager PASSED -generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_single_point_read_timedelta PASSED -generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_enum_input_function_with_defaults PASSED -generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_string_valued_enum_input_function_with_defaults PASSED -generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_fetch_waveform_into_wrong_type PASSED -generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_parameters_are_multiple_types_error PASSED -generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_error_with_rep_cap PASSED -generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_call_not_enough_parameters_error PASSED -generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_enum_input_function_with_defaults_bad_type_error PASSED -generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_get_channel_names PASSED -generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_repeated_capability_method_on_session_timedelta PASSED -generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_repeated_capability_method_on_specific_channel PASSED -generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_device_method_not_exist_on_repeated_capability_error PASSED -generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_repeated_capabilities_list PASSED -generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_chained_repeated_capabilities_list PASSED -generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_chained_repeated_capability_method_on_specific_channel PASSED -generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_function_with_repeated_capability_type PASSED -generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_get_attribute_int32 PASSED -generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_set_attribute_int32 PASSED -generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_get_attribute_int32_with_converter PASSED -generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_set_attribute_int32_with_converter PASSED -generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_get_attribute_real64 PASSED -generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_set_attribute_real64 PASSED -generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_get_attribute_real64_with_converter PASSED -generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_set_attribute_real64_with_converter PASSED -generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_get_attribute_string PASSED -generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_set_attribute_string PASSED -generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_get_attribute_string_with_converter PASSED -generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_set_attribute_string_with_converter PASSED -generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_get_attribute_boolean PASSED -generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_set_attribute_boolean PASSED -generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_get_attribute_enum_int32 PASSED -generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_set_attribute_enum_int32 PASSED -generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_get_attribute_enum_real64 PASSED -generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_set_attribute_enum_real64 PASSED -generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_get_attribute_enum_with_converter PASSED -generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_get_attribute_enum_with_converter_invalid_value_from_driver PASSED -generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_set_attribute_enum_with_converter PASSED -generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_set_attribute_enum_with_converter_invalid_input PASSED -generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_get_attribute_channel PASSED -generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_set_attribute_channel PASSED -generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_get_attribute_int64 PASSED -generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_set_attribute_int64 PASSED -generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_get_attribute_error PASSED -generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_set_attribute_error PASSED -generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_add_properties_to_session_error_set PASSED -generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_add_properties_to_session_error_get PASSED -generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_add_properties_to_repeated_capability_error_set PASSED -generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_add_properties_to_repeated_capability_error_get PASSED -generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_set_enum_attribute_int32_error PASSED -generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_set_wrong_enum_attribute_int32_error PASSED -generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_multiple_arrays_same_size_wrong_size_2 PASSED -generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_multiple_arrays_same_size_wrong_size_3 PASSED -generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_multiple_arrays_same_size_wrong_size_4 PASSED -generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_get_cal_date_time PASSED -generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_get_cal_interval PASSED -generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_import_attribute_configuration_buffer_list_i8_big PASSED -generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_import_attribute_configuration_buffer_list_i8_float PASSED -generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_import_attribute_configuration_buffer_list_i8_big_float PASSED -generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_export_attribute_configuration_buffer PASSED -generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_channel_on_session PASSED -generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_function_name PASSED -generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_buffer_converter PASSED -generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_nitclk_integration PASSED -generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_accept_list_of_time_values_as_floats PASSED -generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_accept_array_of_time_values_as_floats PASSED -generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_accept_list_of_time_values_as_timedelta_instances PASSED -generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_return_timedelta PASSED -generated/nifake/nifake/unit_tests/test_session.py::TestSession::test_return_timedeltas PASSED -generated/nifake/nifake/unit_tests/test_session.py::TestGrpcSession::test_init_with_options_and_close PASSED -generated/nifake/nifake/unit_tests/test_session.py::TestGrpcSession::test_lock_session_none PASSED -generated/nifake/nifake/unit_tests/test_session.py::TestGrpcSession::test_unlock_session_none PASSED -generated/nifake/nifake/unit_tests/test_session.py::TestGrpcSession::test_lock_context_manager PASSED -generated/nifake/nifake/unit_tests/test_session.py::TestGrpcSession::test_lock_context_manager_abnormal_exit PASSED -generated/nifake/nifake/unit_tests/test_session.py::TestGrpcSession::test_self_test PASSED -generated/nifake/nifake/unit_tests/test_session.py::TestGrpcSession::test_export_attribute_configuration_buffer PASSED -generated/nifake/nifake/unit_tests/test_session.py::TestGrpcSession::test_get_attribute_int32 PASSED -generated/nifake/nifake/unit_tests/test_session.py::test_diagnostic_information OS: - Name: Linux - Version: #1 SMP Tue Nov 5 00:21:55 UTC 2024 - Bits: 64 -Driver: - Name: NI-FAKE - Version: Unknown -Module: - Name: nifake - Version: 1.4.10.dev0 -Python: - Version: 3.12.10 (main, Apr 9 2025, 08:55:05) [GCC 11.4.0] - Bits: 64 - Is_Venv: True - Installed Packages: - Mako==1.3.10 - MarkupSafe==3.0.2 - coverage==7.8.0 - grpcio==1.67.0 - hightime==0.2.2 - iniconfig==2.1.0 - nifake==1.4.10.dev0 - nitclk==1.4.10.dev0 - numpy==2.2.5 - packaging==25.0 - pip==25.1.1 - pluggy==1.5.0 - protobuf==5.27.2 - pytest==8.3.5 - pytest-timeout==2.4.0 -PASSED -generated/nifake/nifake/unit_tests/test_session.py::test_dunder_version Version = 1.4.10.dev0 -PASSED - -============================= 251 passed in 6.55s ============================== -py312-test: commands[5]> coverage report -Name Stmts Miss Cover ------------------------------------------------------------------------------ -generated/nifake/nifake/__init__.py 76 14 82% -generated/nifake/nifake/_attributes.py 79 3 96% -generated/nifake/nifake/_complextype.py 8 0 100% -generated/nifake/nifake/_converters.py 132 6 95% -generated/nifake/nifake/_grpc_stub_interpreter.py 244 40 84% -generated/nifake/nifake/_visatype.py 19 0 100% -generated/nifake/nifake/custom_struct.py 28 3 89% -generated/nifake/nifake/custom_struct_nested_typedef.py 26 2 92% -generated/nifake/nifake/custom_struct_typedef.py 24 2 92% -generated/nifake/nifake/enums.py 42 0 100% -generated/nifake/nifake/errors.py 61 3 95% -generated/nifake/nifake/grpc_session_options.py 16 0 100% -generated/nifake/nifake/session.py 465 107 77% ------------------------------------------------------------------------------ -TOTAL 1220 180 85% -py312-test: commands[6]> coverage xml -o nifakeunittest.xml -Wrote XML report to nifakeunittest.xml -py312-test: commands[7]> coverage html --directory=generated/htmlcov/unit_tests/nifake -Wrote HTML report to generated/htmlcov/unit_tests/nifake/index.html -py312-test: commands[8]> coverage run --rcfile=tools/coverage_unit_tests.rc --source nidcpower -m pytest generated/nidcpower/nidcpower -s -============================= test session starts ============================== -platform linux -- Python 3.12.10, pytest-8.3.5, pluggy-1.5.0 -- /home/rahur/nimipythonmyfork/nimi-python/.tox/64/py312-test/bin/python -cachedir: .tox/64/py312-test/.pytest_cache -rootdir: /home/rahur/nimipythonmyfork/nimi-python -configfile: tox.ini -plugins: timeout-2.4.0 -collecting ... collected 7 items - -generated/nidcpower/nidcpower/unit_tests/test_nidcpower.py::test_lcr_measurement[ctype_members0-Dev1/0-expected_python_members0-Channel : Dev1/0\nDC voltage : 0.1 V\nDC current : 0.001 A\nStimulus frequency : 10,000 Hz\nAC voltage : 1+0.1j V RMS\nAC current : 0.01+0.001j A RMS\nImpedance : 100+10j \u03a9\nImpedance magnitude : 100.499 \u03a9\nImpedance phase : 5.71059 \xb0\nAdmittance : 0.00990099-0.000990099j S\nAdmittance magnitude: 0.00995037 S\nAdmittance phase : -5.71059 \xb0\nSeries inductance : 10 H\nSeries capacitance : 20 F\nSeries resistance : 90 \u03a9\nParallel inductance : 30 H\nParallel capacitance: 40 F\nParallel resistance : 110 \u03a9\nDissipation factor : 10\nQuality factor : 0.1\nMeasurement mode : SMU_PS\nDC in compliance : True\nAC in compliance : True\nUnbalanced : True\n] PASSED -generated/nidcpower/nidcpower/unit_tests/test_nidcpower.py::test_lcr_measurement[ctype_members1-1-expected_python_members1-Channel : 1\nDC voltage : 0 V\nDC current : 0 A\nStimulus frequency : 0 Hz\nAC voltage : 0+0j V RMS\nAC current : 0+0j A RMS\nImpedance : 0+0j \u03a9\nImpedance magnitude : 0 \u03a9\nImpedance phase : 0 \xb0\nAdmittance : nan+nanj S\nAdmittance magnitude: nan S\nAdmittance phase : nan \xb0\nSeries inductance : 0 H\nSeries capacitance : 0 F\nSeries resistance : 0 \u03a9\nParallel inductance : 0 H\nParallel capacitance: 0 F\nParallel resistance : 0 \u03a9\nDissipation factor : 0\nQuality factor : nan\nMeasurement mode : LCR\nDC in compliance : False\nAC in compliance : False\nUnbalanced : False\n] PASSED -generated/nidcpower/nidcpower/unit_tests/test_nidcpower.py::test_lcr_load_compensation_spot[python_init_params0-nidcpower.lcr_load_compensation_spot.LCRLoadCompensationSpot(frequency=200.0, reference_value_type=nidcpower.enums.LCRReferenceValueType.IMPEDANCE, reference_value=(3+4j))-Frequency : 200 Hz\nImpedance : 3+4j \u03a9\n-expected_ctype_members0] PASSED -generated/nidcpower/nidcpower/unit_tests/test_nidcpower.py::test_lcr_load_compensation_spot[python_init_params1-nidcpower.lcr_load_compensation_spot.LCRLoadCompensationSpot(frequency=300.0, reference_value_type=nidcpower.enums.LCRReferenceValueType.IDEAL_CAPACITANCE, reference_value=5.0)-Frequency : 300 Hz\nIdeal Capacitance: 5 F\n-expected_ctype_members1] PASSED -generated/nidcpower/nidcpower/unit_tests/test_nidcpower.py::test_lcr_load_compensation_spot[python_init_params2-nidcpower.lcr_load_compensation_spot.LCRLoadCompensationSpot(frequency=400.0, reference_value_type=nidcpower.enums.LCRReferenceValueType.IDEAL_INDUCTANCE, reference_value=6.0)-Frequency : 400 Hz\nIdeal Inductance : 6 H\n-expected_ctype_members2] PASSED -generated/nidcpower/nidcpower/unit_tests/test_nidcpower.py::test_lcr_load_compensation_spot[python_init_params3-nidcpower.lcr_load_compensation_spot.LCRLoadCompensationSpot(frequency=500.0, reference_value_type=nidcpower.enums.LCRReferenceValueType.IDEAL_RESISTANCE, reference_value=7.0)-Frequency : 500 Hz\nIdeal Resistance : 7 \u03a9\n-expected_ctype_members3] PASSED -generated/nidcpower/nidcpower/unit_tests/test_nidcpower.py::test_lcr_load_compensation_spot_byte_packing_alignment PASSED - -============================== 7 passed in 0.37s =============================== -py312-test: commands[9]> coverage report -Name Stmts Miss Cover ---------------------------------------------------------------------------------- -generated/nidcpower/nidcpower/lcr_load_compensation_spot.py 33 5 85% -generated/nidcpower/nidcpower/lcr_measurement.py 53 4 92% ---------------------------------------------------------------------------------- -TOTAL 86 9 90% -py312-test: commands[10]> coverage xml -o nidcpowerunittest.xml -Wrote XML report to nidcpowerunittest.xml -py312-test: commands[11]> coverage html --directory=generated/htmlcov/unit_tests/nidcpower -Wrote HTML report to generated/htmlcov/unit_tests/nidcpower/index.html -py312-test: commands[12]> coverage run --rcfile=tools/coverage_unit_tests.rc --source nidigital -m pytest generated/nidigital/nidigital -s -============================= test session starts ============================== -platform linux -- Python 3.12.10, pytest-8.3.5, pluggy-1.5.0 -- /home/rahur/nimipythonmyfork/nimi-python/.tox/64/py312-test/bin/python -cachedir: .tox/64/py312-test/.pytest_cache -rootdir: /home/rahur/nimipythonmyfork/nimi-python -configfile: tox.ini -plugins: timeout-2.4.0 -collecting ... collected 8 items - -generated/nidigital/nidigital/unit_tests/test_nidigital.py::TestSession::test_fetch_history_ram_cycle_information_position_out_of_bound PASSED -generated/nidigital/nidigital/unit_tests/test_nidigital.py::TestSession::test_fetch_history_ram_cycle_information_position_last PASSED -generated/nidigital/nidigital/unit_tests/test_nidigital.py::TestSession::test_fetch_history_ram_cycle_information_samples_to_read_too_much PASSED -generated/nidigital/nidigital/unit_tests/test_nidigital.py::TestSession::test_fetch_history_ram_cycle_information_samples_to_read_all PASSED -generated/nidigital/nidigital/unit_tests/test_nidigital.py::TestSession::test_fetch_history_ram_cycle_information_pin_list PASSED -generated/nidigital/nidigital/unit_tests/test_nidigital.py::TestSession::test_fetch_history_ram_cycle_information_site_n PASSED -generated/nidigital/nidigital/unit_tests/test_nidigital.py::TestSession::test_pin_state_enum_print PASSED -generated/nidigital/nidigital/unit_tests/test_nidigital.py::TestSession::test_write_static_pin_state_enum_print PASSED - -============================== 8 passed in 0.46s =============================== -py312-test: commands[13]> coverage report -Name Stmts Miss Cover --------------------------------------------------------------- -generated/nidigital/nidigital/session.py 786 248 68% --------------------------------------------------------------- -TOTAL 786 248 68% -py312-test: commands[14]> coverage xml -o nidigitalunittest.xml -Wrote XML report to nidigitalunittest.xml -py312-test: commands[15]> coverage html --directory=generated/htmlcov/unit_tests/nidigital -Wrote HTML report to generated/htmlcov/unit_tests/nidigital/index.html -py312-test: commands[16]> coverage run --rcfile=tools/coverage_unit_tests.rc --source nimodinst -m pytest generated/nimodinst/nimodinst -s -============================= test session starts ============================== -platform linux -- Python 3.12.10, pytest-8.3.5, pluggy-1.5.0 -- /home/rahur/nimipythonmyfork/nimi-python/.tox/64/py312-test/bin/python -cachedir: .tox/64/py312-test/.pytest_cache -rootdir: /home/rahur/nimipythonmyfork/nimi-python -configfile: tox.ini -plugins: timeout-2.4.0 -collecting ... collected 23 items - -generated/nimodinst/nimodinst/unit_tests/test_modinst.py::TestSession::test_open_and_close PASSED -generated/nimodinst/nimodinst/unit_tests/test_modinst.py::TestSession::test_close PASSED -generated/nimodinst/nimodinst/unit_tests/test_modinst.py::TestSession::test_context_manager PASSED -generated/nimodinst/nimodinst/unit_tests/test_modinst.py::TestSession::test_iterating_for PASSED -generated/nimodinst/nimodinst/unit_tests/test_modinst.py::TestSession::test_iterating_for_empty PASSED -generated/nimodinst/nimodinst/unit_tests/test_modinst.py::TestSession::test_get_extended_error_info PASSED -generated/nimodinst/nimodinst/unit_tests/test_modinst.py::TestSession::test_get_error_description_fails PASSED -generated/nimodinst/nimodinst/unit_tests/test_modinst.py::TestSession::test_get_attribute_session PASSED -generated/nimodinst/nimodinst/unit_tests/test_modinst.py::TestSession::test_get_attribute_vi_int32_for_loop_index PASSED -generated/nimodinst/nimodinst/unit_tests/test_modinst.py::TestSession::test_get_attribute_vi_string_for_loop_index PASSED -generated/nimodinst/nimodinst/unit_tests/test_modinst.py::TestSession::test_get_attribute_session_no_index PASSED -generated/nimodinst/nimodinst/unit_tests/test_modinst.py::TestSession::test_get_attribute_vi_int32_for_loop_multiple_devices PASSED -generated/nimodinst/nimodinst/unit_tests/test_modinst.py::TestSession::test_get_attribute_vi_string_for_loop_multiple_devices PASSED -generated/nimodinst/nimodinst/unit_tests/test_modinst.py::TestSession::test_cannot_add_properties_to_session_set PASSED -generated/nimodinst/nimodinst/unit_tests/test_modinst.py::TestSession::test_cannot_add_properties_to_session_get PASSED -generated/nimodinst/nimodinst/unit_tests/test_modinst.py::TestSession::test_cannot_add_properties_to_device_set PASSED -generated/nimodinst/nimodinst/unit_tests/test_modinst.py::TestSession::test_cannot_add_properties_to_device_get PASSED -generated/nimodinst/nimodinst/unit_tests/test_modinst.py::TestSession::test_vi_int32_attribute_read_only PASSED -generated/nimodinst/nimodinst/unit_tests/test_modinst.py::TestSession::test_vi_string_attribute_read_only PASSED -generated/nimodinst/nimodinst/unit_tests/test_modinst.py::TestSession::test_int_attribute_error PASSED -generated/nimodinst/nimodinst/unit_tests/test_modinst.py::TestSession::test_int_attribute_warning PASSED -generated/nimodinst/nimodinst/unit_tests/test_modinst.py::TestSession::test_repr_and_str nimodinst.Session(driver=''): -nimodinst._Device(owner=nimodinst.Session(driver=''), index=0): - bus_number = 42 - chassis_number = 42 - device_model = 'fourty two' - device_name = 'fourty two' - max_pciexpress_link_width = 42 - pciexpress_link_width = 42 - serial_number = 'fourty two' - slot_number = 42 - socket_number = 42 - -nimodinst._Device(owner=nimodinst.Session(driver=''), index=1): - bus_number = 42 - chassis_number = 42 - device_model = 'fourty two' - device_name = 'fourty two' - max_pciexpress_link_width = 42 - pciexpress_link_width = 42 - serial_number = 'fourty two' - slot_number = 42 - socket_number = 42 - - -nimodinst._Device(owner=nimodinst.Session(driver=''), index=0): - bus_number = 42 - chassis_number = 42 - device_model = 'fourty two' - device_name = 'fourty two' - max_pciexpress_link_width = 42 - pciexpress_link_width = 42 - serial_number = 'fourty two' - slot_number = 42 - socket_number = 42 - -nimodinst._Device(owner=nimodinst.Session(driver=''), index=1): - bus_number = 42 - chassis_number = 42 - device_model = 'fourty two' - device_name = 'fourty two' - max_pciexpress_link_width = 42 - pciexpress_link_width = 42 - serial_number = 'fourty two' - slot_number = 42 - socket_number = 42 - -PASSED -generated/nimodinst/nimodinst/unit_tests/test_modinst.py::test_diagnostic_information OS: - Name: Linux - Version: #1 SMP Tue Nov 5 00:21:55 UTC 2024 - Bits: 64 -Driver: - Name: NI-ModInst - Version: Unknown -Module: - Name: nimodinst - Version: 1.4.10.dev0 -Python: - Version: 3.12.10 (main, Apr 9 2025, 08:55:05) [GCC 11.4.0] - Bits: 64 - Is_Venv: True - Installed Packages: - Mako==1.3.10 - MarkupSafe==3.0.2 - coverage==7.8.0 - grpcio==1.67.0 - hightime==0.2.2 - iniconfig==2.1.0 - nimodinst==1.4.10.dev0 - nitclk==1.4.10.dev0 - numpy==2.2.5 - packaging==25.0 - pip==25.1.1 - pluggy==1.5.0 - protobuf==5.27.2 - pytest==8.3.5 - pytest-timeout==2.4.0 -PASSED - -============================== 23 passed in 0.34s ============================== -py312-test: commands[17]> coverage report -Name Stmts Miss Cover --------------------------------------------------------------- -generated/nimodinst/nimodinst/session.py 138 8 94% --------------------------------------------------------------- -TOTAL 138 8 94% -py312-test: commands[18]> coverage xml -o nimodinstunittest.xml -Wrote XML report to nimodinstunittest.xml -py312-test: commands[19]> coverage html --directory=generated/htmlcov/unit_tests/nimodinst -Wrote HTML report to generated/htmlcov/unit_tests/nimodinst/index.html -py312-test: commands[20]> coverage run --rcfile=tools/coverage_unit_tests.rc --source niscope -m pytest generated/niscope/niscope -s -============================= test session starts ============================== -platform linux -- Python 3.12.10, pytest-8.3.5, pluggy-1.5.0 -- /home/rahur/nimipythonmyfork/nimi-python/.tox/64/py312-test/bin/python -cachedir: .tox/64/py312-test/.pytest_cache -rootdir: /home/rahur/nimipythonmyfork/nimi-python -configfile: tox.ini -plugins: timeout-2.4.0 -collecting ... collected 2 items - -generated/niscope/niscope/unit_tests/test_niscope.py::test_populate_samples_info PASSED -generated/niscope/niscope/unit_tests/test_niscope.py::test_populate_channel_and_record_info PASSED - -============================== 2 passed in 0.36s =============================== -py312-test: commands[21]> coverage report -Name Stmts Miss Cover ----------------------------------------------------------------- -generated/niscope/niscope/waveform_info.py 81 46 43% ----------------------------------------------------------------- -TOTAL 81 46 43% -py312-test: commands[22]> coverage xml -o niscopeunittest.xml -Wrote XML report to niscopeunittest.xml -py312-test: commands[23]> coverage html --directory=generated/htmlcov/unit_tests/niscope -Wrote HTML report to generated/htmlcov/unit_tests/niscope/index.html -py312-test: commands[24]> coverage run --rcfile=tools/coverage_unit_tests.rc --source nitclk -m pytest generated/nitclk/nitclk -s -============================= test session starts ============================== -platform linux -- Python 3.12.10, pytest-8.3.5, pluggy-1.5.0 -- /home/rahur/nimipythonmyfork/nimi-python/.tox/64/py312-test/bin/python -cachedir: .tox/64/py312-test/.pytest_cache -rootdir: /home/rahur/nimipythonmyfork/nimi-python -configfile: tox.ini -plugins: timeout-2.4.0 -collecting ... collected 25 items - -generated/nitclk/nitclk/unit_tests/test_nitclk.py::TestNitclkApi::test_initialize_one_session PASSED -generated/nitclk/nitclk/unit_tests/test_nitclk.py::TestNitclkApi::test_initialize_multiple_sessions PASSED -generated/nitclk/nitclk/unit_tests/test_nitclk.py::TestNitclkApi::test_configure_for_homogeneous_triggers PASSED -generated/nitclk/nitclk/unit_tests/test_nitclk.py::TestNitclkApi::test_finish_sync_pulse_sender_synchronize PASSED -generated/nitclk/nitclk/unit_tests/test_nitclk.py::TestNitclkApi::test_is_done PASSED -generated/nitclk/nitclk/unit_tests/test_nitclk.py::TestNitclkApi::test_setup_for_sync_pulse_sender_synchronize PASSED -generated/nitclk/nitclk/unit_tests/test_nitclk.py::TestNitclkApi::test_synchronize PASSED -generated/nitclk/nitclk/unit_tests/test_nitclk.py::TestNitclkApi::test_synchronize_timedelta PASSED -generated/nitclk/nitclk/unit_tests/test_nitclk.py::TestNitclkApi::test_synchronize_to_sync_pulse_sender PASSED -generated/nitclk/nitclk/unit_tests/test_nitclk.py::TestNitclkApi::test_wait_until_done PASSED -generated/nitclk/nitclk/unit_tests/test_nitclk.py::TestNitclkApi::test_api_error PASSED -generated/nitclk/nitclk/unit_tests/test_nitclk.py::TestNitclkApi::test_api_get_error_description_fails PASSED -generated/nitclk/nitclk/unit_tests/test_nitclk.py::TestNitclkApi::test_session_reference_error PASSED -generated/nitclk/nitclk/unit_tests/test_nitclk.py::TestNitclkApi::test_session_reference_get_error_description_fails PASSED -generated/nitclk/nitclk/unit_tests/test_nitclk.py::TestNitclkApi::test_set_vi_real64 PASSED -generated/nitclk/nitclk/unit_tests/test_nitclk.py::TestNitclkApi::test_get_vi_real64 PASSED -generated/nitclk/nitclk/unit_tests/test_nitclk.py::TestNitclkApi::test_set_timedelta_as_vi_real64 PASSED -generated/nitclk/nitclk/unit_tests/test_nitclk.py::TestNitclkApi::test_set_timedelta_as_timedelta PASSED -generated/nitclk/nitclk/unit_tests/test_nitclk.py::TestNitclkApi::test_get_timedelta PASSED -generated/nitclk/nitclk/unit_tests/test_nitclk.py::TestNitclkApi::test_set_vi_string PASSED -generated/nitclk/nitclk/unit_tests/test_nitclk.py::TestNitclkApi::test_get_vi_string PASSED -generated/nitclk/nitclk/unit_tests/test_nitclk.py::TestNitclkApi::test_set_vi_session_with_int PASSED -generated/nitclk/nitclk/unit_tests/test_nitclk.py::TestNitclkApi::test_set_vi_session_with_session_reference PASSED -generated/nitclk/nitclk/unit_tests/test_nitclk.py::TestNitclkApi::test_set_vi_session_with_session PASSED -generated/nitclk/nitclk/unit_tests/test_nitclk.py::TestNitclkApi::test_get_tclk_session_reference PASSED - -============================== 25 passed in 0.33s ============================== -py312-test: commands[25]> coverage report -Name Stmts Miss Cover --------------------------------------------------------- -generated/nitclk/nitclk/session.py 115 2 98% --------------------------------------------------------- -TOTAL 115 2 98% -py312-test: commands[26]> coverage xml -o nitclkunittest.xml -Wrote XML report to nitclkunittest.xml -py312-test: commands[27]> coverage html --directory=generated/htmlcov/unit_tests/nitclk -Wrote HTML report to generated/htmlcov/unit_tests/nitclk/index.html -py312-test: OK ✔ in 12.51 seconds -py313-test: skipped because could not find python interpreter with spec(s): py313 -py313-test: SKIP ⚠ in 0.17 seconds -py312-pkg: commands[0]> python --version -Python 3.12.10 -py312-pkg: commands[1]> python -c 'import platform; print(platform.architecture())' -('64bit', 'ELF') -py312-pkg: commands[2]> python -m twine --version -twine version 6.1.0 (keyring: 25.6.0, packaging: 25.0, requests: 2.32.3, -requests-toolbelt: 1.0.0, urllib3: 2.4.0, id: 1.5.0) -py312-pkg: commands[3]> python -m twine check 'generated/nifake/dist/*' -Checking generated/nifake/dist/nifake-1.4.10.dev0-py3-none-any.whl: PASSED -Checking generated/nifake/dist/nifake-1.4.10.dev0.tar.gz: PASSED -py312-pkg: commands[4]> python -m twine check 'generated/nidcpower/dist/*' -Checking generated/nidcpower/dist/nidcpower-1.4.10.dev0-py3-none-any.whl: PASSED -Checking generated/nidcpower/dist/nidcpower-1.4.10.dev0.tar.gz: PASSED -py312-pkg: commands[5]> python -m twine check 'generated/nidigital/dist/*' -Checking generated/nidigital/dist/nidigital-1.4.10.dev0-py3-none-any.whl: PASSED -Checking generated/nidigital/dist/nidigital-1.4.10.dev0.tar.gz: PASSED -py312-pkg: commands[6]> python -m twine check 'generated/nidmm/dist/*' -Checking generated/nidmm/dist/nidmm-1.4.10.dev0-py3-none-any.whl: PASSED -Checking generated/nidmm/dist/nidmm-1.4.10.dev0.tar.gz: PASSED -py312-pkg: commands[7]> python -m twine check 'generated/nifgen/dist/*' -Checking generated/nifgen/dist/nifgen-1.4.10.dev0-py3-none-any.whl: PASSED -Checking generated/nifgen/dist/nifgen-1.4.10.dev0.tar.gz: PASSED -py312-pkg: commands[8]> python -m twine check 'generated/nirfsg/dist/*' -Checking generated/nirfsg/dist/nirfsg-0.2.0-py3-none-any.whl: PASSED -Checking generated/nirfsg/dist/nirfsg-0.2.0.tar.gz: PASSED -py312-pkg: commands[9]> python -m twine check 'generated/niscope/dist/*' -Checking generated/niscope/dist/niscope-1.4.10.dev0-py3-none-any.whl: PASSED -Checking generated/niscope/dist/niscope-1.4.10.dev0.tar.gz: PASSED -py312-pkg: commands[10]> python -m twine check 'generated/nise/dist/*' -Checking generated/nise/dist/nise-1.4.10.dev0-py3-none-any.whl: PASSED -Checking generated/nise/dist/nise-1.4.10.dev0.tar.gz: PASSED -py312-pkg: commands[11]> python -m twine check 'generated/niswitch/dist/*' -Checking generated/niswitch/dist/niswitch-1.4.10.dev0-py3-none-any.whl: PASSED -Checking generated/niswitch/dist/niswitch-1.4.10.dev0.tar.gz: PASSED - py312-build_test: OK (2.39=setup[0.06]+cmd[0.01,0.04,0.51,0.12,0.50,0.51,0.10,0.12,0.13,0.31] seconds) - py312-codegen: OK (8.14=setup[0.01]+cmd[0.00,0.02,0.53,7.58] seconds) - py312-installers: OK (0.60=setup[0.01]+cmd[0.00,0.02,0.46,0.11] seconds) - py39-test: SKIP (0.18 seconds) - py310-test: OK (13.43=setup[0.02]+cmd[0.00,0.02,0.53,0.35,8.42,0.11,0.12,0.17,0.49,0.06,0.06,0.07,0.68,0.09,0.10,0.11,0.46,0.06,0.06,0.07,0.50,0.06,0.06,0.07,0.51,0.06,0.06,0.07] seconds) - py311-test: SKIP (0.21 seconds) - py312-test: OK (12.51=setup[0.02]+cmd[0.00,0.02,0.46,0.33,7.38,0.10,0.10,0.12,0.59,0.06,0.06,0.07,0.69,0.08,0.09,0.10,0.54,0.06,0.06,0.07,0.57,0.06,0.06,0.07,0.55,0.06,0.06,0.07] seconds) - py313-test: SKIP (0.17 seconds) - py312-flake8: OK (2.73=setup[0.01]+cmd[0.00,0.02,0.50,0.95,0.09,0.18,0.21,0.12,0.14,0.09,0.15,0.08,0.10,0.09] seconds) - py312-docs: OK (30.64=setup[0.02]+cmd[0.00,0.02,4.03,2.66,2.10,2.59,1.37,10.20,2.67,1.73,1.41,1.86] seconds) - py312-pkg: OK (2.39=setup[0.01]+cmd[0.00,0.02,0.19,0.22,0.26,0.25,0.24,0.25,0.24,0.25,0.23,0.23] seconds) - congratulations :) (73.46 seconds) From aceaa16369a0b8e06ff91c951c194e134c807c3c Mon Sep 17 00:00:00 2001 From: Rahul R Date: Thu, 15 May 2025 14:37:59 +0530 Subject: [PATCH 07/33] Updated functions.py file and few minor cahnges --- docs/nirfsg/class.rst | 78 ++-- generated/nifake/nifake/session.py | 8 +- generated/nirfsg/nirfsg/_library.py | 60 +-- .../nirfsg/nirfsg/_library_interpreter.py | 69 ++-- generated/nirfsg/nirfsg/session.py | 389 +++++++++++------- .../nirfsg/nirfsg/unit_tests/_mock_helper.py | 72 ++-- src/nifake/metadata/functions.py | 328 +++++++-------- src/nirfsg/metadata/functions.py | 381 +++++++++-------- tox-travis.ini | 2 +- tox.ini | 2 +- 10 files changed, 722 insertions(+), 667 deletions(-) diff --git a/docs/nirfsg/class.rst b/docs/nirfsg/class.rst index 5663227a65..1c95152500 100644 --- a/docs/nirfsg/class.rst +++ b/docs/nirfsg/class.rst @@ -3,7 +3,7 @@ Session ======= -.. py:class:: Session(self, resource_name, id_query, reset_device, options={}) +.. py:class:: Session(self, resource_name, options={}, id_query=False, reset_device=False) @@ -41,6 +41,40 @@ Session :type resource_name: str + :param options: + + + Specifies the initial value of certain properties for the session. The + syntax for **options** is a dictionary of properties with an assigned + value. For example: + + { 'simulate': False } + + You do not have to specify a value for all the properties. If you do not + specify a value for a property, the default value is used. + + Advanced Example: + { 'simulate': True, 'driver_setup': { 'Model': '', 'BoardType': '' } } + + +-------------------------+---------+ + | Property | Default | + +=========================+=========+ + | range_check | True | + +-------------------------+---------+ + | query_instrument_status | False | + +-------------------------+---------+ + | cache | True | + +-------------------------+---------+ + | simulate | False | + +-------------------------+---------+ + | record_value_coersions | False | + +-------------------------+---------+ + | driver_setup | {} | + +-------------------------+---------+ + + + :type options: str + :param id_query: @@ -77,40 +111,6 @@ Session :type reset_device: bool - :param options: - - - Specifies the initial value of certain properties for the session. The - syntax for **options** is a dictionary of properties with an assigned - value. For example: - - { 'simulate': False } - - You do not have to specify a value for all the properties. If you do not - specify a value for a property, the default value is used. - - Advanced Example: - { 'simulate': True, 'driver_setup': { 'Model': '', 'BoardType': '' } } - - +-------------------------+---------+ - | Property | Default | - +=========================+=========+ - | range_check | True | - +-------------------------+---------+ - | query_instrument_status | False | - +-------------------------+---------+ - | cache | True | - +-------------------------+---------+ - | simulate | False | - +-------------------------+---------+ - | record_value_coersions | False | - +-------------------------+---------+ - | driver_setup | {} | - +-------------------------+---------+ - - - :type options: str - Methods ======= @@ -2699,9 +2699,9 @@ write_arb_waveform Writes an arbitrary waveform to the NI-RFSG device starting at the position of the last data written in onboard memory. - This method accepts the complex baseband data in the form of numpy array of numpy.complex64 or numpy.complex128 or interleaved numpy array of numpy.int16. If the waveform to write is already allocated using the :py:meth:`nirfsg.Session.allocate_arb_waveform` method, the **:py:attr:`nirfsg.Session.MORE_DATA_PENDING`** parameter is ignored. The PXI-5670/5671 must be in the Configuration state before you call this method. When streaming is enabled, you can call this method when the PXIe-5672/5673/5673E or PXIe-5820/5830/5831/5832/5840/5841/5842/5860 is in the Generation state. - ---- - **Supported Devices** : PXIe-5644/5645/5646, PXI-5670/5671, PXIe-5672/5673/5673E, PXIe-5820/5830/5831/5832/5840/5841/5842/5860 + This method accepts the complex baseband data in the form of numpy array of numpy.complex64 or numpy.complex128 or interleaved numpy array of numpy.int16. If the waveform to write is already allocated using the :py:meth:`nirfsg.Session.allocate_arb_waveform` method, the **:py:attr:`nirfsg.Session.MORE_DATA_PENDING`** parameter is ignored. The PXI-5670/5671 must be in the Configuration state before you call this method. When streaming is enabled, this method can be called when the PXIe-5672/5673/5673E or PXIe-5820/5830/5831/5832/5840/5841/5842/5860 is in the Generation state. + + **Supported Devices** : PXIe-5644/5645/5646, PXIe-5672/5673/5673E, PXIe-5820/5830/5831/5832/5840/5841/5842/5860 **Related Topics** @@ -2711,6 +2711,8 @@ write_arb_waveform + .. note:: This method only supports :py:data:`~nirfsg.PowerLevelType.PEAK` mode as specified in the :py:attr:`nirfsg.Session.power_level_type` property. If you download a waveform when using this method, you cannot set the :py:attr:`nirfsg.Session.power_level_type` to :py:data:`~nirfsg.PowerLevelType.AVERAGE` without causing error in the output. + .. note:: One or more of the referenced properties are not in the Python API for this driver. diff --git a/generated/nifake/nifake/session.py b/generated/nifake/nifake/session.py index d13d8e1eca..9493019052 100644 --- a/generated/nifake/nifake/session.py +++ b/generated/nifake/nifake/session.py @@ -1677,7 +1677,7 @@ def _write_waveform_complex_f32(self, waveform_data_array): A method that writes a waveform of complex64 numbers. Args: - waveform_data_array (numpy.array(dtype=numpy.complex64)): + waveform_data_array (numpy.array(dtype=numpy.complex64)): Specifies the array of data to load into the waveform. Array should be numberOfSamples big. ''' import numpy @@ -1694,10 +1694,10 @@ def _write_waveform_complex_f32(self, waveform_data_array): def _write_waveform_complex_f64(self, waveform_data_array): r'''_write_waveform_complex_f64 - A method that writes a waveform of complex128 numbers. + A method that writes a waveform of complex128 numbers Args: - waveform_data_array (numpy.array(dtype=numpy.complex128)): + waveform_data_array (numpy.array(dtype=numpy.complex128)): Specifies the array of data to load into the waveform. Array should be numberOfSamples big. ''' import numpy @@ -1717,7 +1717,7 @@ def _write_waveform_complex_i16(self, waveform_data_array): A method that writes a waveform of i16 numbers. Args: - waveform_data_array (numpy.array(dtype=numpy.int16)): + waveform_data_array (numpy.array(dtype=numpy.int16)): Specifies the array of data to load into the waveform. Array should be numberOfSamples big. ''' import numpy diff --git a/generated/nirfsg/nirfsg/_library.py b/generated/nirfsg/nirfsg/_library.py index f40a365ffc..8cf649cf15 100644 --- a/generated/nirfsg/nirfsg/_library.py +++ b/generated/nirfsg/nirfsg/_library.py @@ -106,11 +106,11 @@ def __init__(self, ctypes_library): self.niRFSG_SetWaveformMarkerEventLocations_cfunc = None self.niRFSG_UnlockSession_cfunc = None self.niRFSG_WaitUntilSettled_cfunc = None + self.niRFSG_WriteArbWaveformComplexF32_cfunc = None + self.niRFSG_WriteArbWaveformComplexF64_cfunc = None + self.niRFSG_WriteArbWaveformComplexI16_cfunc = None self.niRFSG_WriteP2PEndpointI16_cfunc = None self.niRFSG_WriteScript_cfunc = None - self.niRFSG_WriteWaveformComplexF32_cfunc = None - self.niRFSG_WriteWaveformComplexF64_cfunc = None - self.niRFSG_WriteWaveformComplexI16_cfunc = None self.niRFSG_close_cfunc = None def _get_library_function(self, name): @@ -772,7 +772,7 @@ def niRFSG_SetWaveformBurstStartLocations(self, vi, channel_name, number_of_loca with self._func_lock: if self.niRFSG_SetWaveformBurstStartLocations_cfunc is None: self.niRFSG_SetWaveformBurstStartLocations_cfunc = self._get_library_function('niRFSG_SetWaveformBurstStartLocations') - self.niRFSG_SetWaveformBurstStartLocations_cfunc.argtypes = [ViSession, ctypes.POINTER(ViChar), ViInt32, ctypes.POINTER(ViReal64)] # noqa: F405 + self.niRFSG_SetWaveformBurstStartLocations_cfunc.argtypes = [ViSession, ctypes.POINTER(ViChar), ViInt32, ViReal64] # noqa: F405 self.niRFSG_SetWaveformBurstStartLocations_cfunc.restype = ViStatus # noqa: F405 return self.niRFSG_SetWaveformBurstStartLocations_cfunc(vi, channel_name, number_of_locations, locations) @@ -780,7 +780,7 @@ def niRFSG_SetWaveformBurstStopLocations(self, vi, channel_name, number_of_locat with self._func_lock: if self.niRFSG_SetWaveformBurstStopLocations_cfunc is None: self.niRFSG_SetWaveformBurstStopLocations_cfunc = self._get_library_function('niRFSG_SetWaveformBurstStopLocations') - self.niRFSG_SetWaveformBurstStopLocations_cfunc.argtypes = [ViSession, ctypes.POINTER(ViChar), ViInt32, ctypes.POINTER(ViReal64)] # noqa: F405 + self.niRFSG_SetWaveformBurstStopLocations_cfunc.argtypes = [ViSession, ctypes.POINTER(ViChar), ViInt32, ViReal64] # noqa: F405 self.niRFSG_SetWaveformBurstStopLocations_cfunc.restype = ViStatus # noqa: F405 return self.niRFSG_SetWaveformBurstStopLocations_cfunc(vi, channel_name, number_of_locations, locations) @@ -788,7 +788,7 @@ def niRFSG_SetWaveformMarkerEventLocations(self, vi, channel_name, number_of_loc with self._func_lock: if self.niRFSG_SetWaveformMarkerEventLocations_cfunc is None: self.niRFSG_SetWaveformMarkerEventLocations_cfunc = self._get_library_function('niRFSG_SetWaveformMarkerEventLocations') - self.niRFSG_SetWaveformMarkerEventLocations_cfunc.argtypes = [ViSession, ctypes.POINTER(ViChar), ViInt32, ctypes.POINTER(ViReal64)] # noqa: F405 + self.niRFSG_SetWaveformMarkerEventLocations_cfunc.argtypes = [ViSession, ctypes.POINTER(ViChar), ViInt32, ViReal64] # noqa: F405 self.niRFSG_SetWaveformMarkerEventLocations_cfunc.restype = ViStatus # noqa: F405 return self.niRFSG_SetWaveformMarkerEventLocations_cfunc(vi, channel_name, number_of_locations, locations) @@ -808,6 +808,30 @@ def niRFSG_WaitUntilSettled(self, vi, max_time_milliseconds): # noqa: N802 self.niRFSG_WaitUntilSettled_cfunc.restype = ViStatus # noqa: F405 return self.niRFSG_WaitUntilSettled_cfunc(vi, max_time_milliseconds) + def niRFSG_WriteArbWaveformComplexF32(self, vi, waveform_name, number_of_samples, waveform_data_array, more_data_pending): # noqa: N802 + with self._func_lock: + if self.niRFSG_WriteArbWaveformComplexF32_cfunc is None: + self.niRFSG_WriteArbWaveformComplexF32_cfunc = self._get_library_function('niRFSG_WriteArbWaveformComplexF32') + self.niRFSG_WriteArbWaveformComplexF32_cfunc.argtypes = [ViSession, ctypes.POINTER(ViChar), ViInt32, ctypes.POINTER(ComplexViReal32), ViBoolean] # noqa: F405 + self.niRFSG_WriteArbWaveformComplexF32_cfunc.restype = ViStatus # noqa: F405 + return self.niRFSG_WriteArbWaveformComplexF32_cfunc(vi, waveform_name, number_of_samples, waveform_data_array, more_data_pending) + + def niRFSG_WriteArbWaveformComplexF64(self, vi, waveform_name, number_of_samples, waveform_data_array, more_data_pending): # noqa: N802 + with self._func_lock: + if self.niRFSG_WriteArbWaveformComplexF64_cfunc is None: + self.niRFSG_WriteArbWaveformComplexF64_cfunc = self._get_library_function('niRFSG_WriteArbWaveformComplexF64') + self.niRFSG_WriteArbWaveformComplexF64_cfunc.argtypes = [ViSession, ctypes.POINTER(ViChar), ViInt32, ctypes.POINTER(ComplexViReal64), ViBoolean] # noqa: F405 + self.niRFSG_WriteArbWaveformComplexF64_cfunc.restype = ViStatus # noqa: F405 + return self.niRFSG_WriteArbWaveformComplexF64_cfunc(vi, waveform_name, number_of_samples, waveform_data_array, more_data_pending) + + def niRFSG_WriteArbWaveformComplexI16(self, vi, waveform_name, number_of_samples, waveform_data_array): # noqa: N802 + with self._func_lock: + if self.niRFSG_WriteArbWaveformComplexI16_cfunc is None: + self.niRFSG_WriteArbWaveformComplexI16_cfunc = self._get_library_function('niRFSG_WriteArbWaveformComplexI16') + self.niRFSG_WriteArbWaveformComplexI16_cfunc.argtypes = [ViSession, ctypes.POINTER(ViChar), ViInt32, ctypes.POINTER(ComplexViInt16)] # noqa: F405 + self.niRFSG_WriteArbWaveformComplexI16_cfunc.restype = ViStatus # noqa: F405 + return self.niRFSG_WriteArbWaveformComplexI16_cfunc(vi, waveform_name, number_of_samples, waveform_data_array) + def niRFSG_WriteP2PEndpointI16(self, vi, stream_endpoint, number_of_samples, endpoint_data): # noqa: N802 with self._func_lock: if self.niRFSG_WriteP2PEndpointI16_cfunc is None: @@ -824,30 +848,6 @@ def niRFSG_WriteScript(self, vi, script): # noqa: N802 self.niRFSG_WriteScript_cfunc.restype = ViStatus # noqa: F405 return self.niRFSG_WriteScript_cfunc(vi, script) - def niRFSG_WriteWaveformComplexF32(self, vi, waveform_name, number_of_samples, waveform_data_array, more_data_pending): # noqa: N802 - with self._func_lock: - if self.niRFSG_WriteWaveformComplexF32_cfunc is None: - self.niRFSG_WriteWaveformComplexF32_cfunc = self._get_library_function('niRFSG_WriteWaveformComplexF32') - self.niRFSG_WriteWaveformComplexF32_cfunc.argtypes = [ViSession, ctypes.POINTER(ViChar), ViInt32, ctypes.POINTER(ComplexViReal32), ViBoolean] # noqa: F405 - self.niRFSG_WriteWaveformComplexF32_cfunc.restype = ViStatus # noqa: F405 - return self.niRFSG_WriteWaveformComplexF32_cfunc(vi, waveform_name, number_of_samples, waveform_data_array, more_data_pending) - - def niRFSG_WriteWaveformComplexF64(self, vi, waveform_name, number_of_samples, waveform_data_array, more_data_pending): # noqa: N802 - with self._func_lock: - if self.niRFSG_WriteWaveformComplexF64_cfunc is None: - self.niRFSG_WriteWaveformComplexF64_cfunc = self._get_library_function('niRFSG_WriteWaveformComplexF64') - self.niRFSG_WriteWaveformComplexF64_cfunc.argtypes = [ViSession, ctypes.POINTER(ViChar), ViInt32, ctypes.POINTER(ComplexViReal64), ViBoolean] # noqa: F405 - self.niRFSG_WriteWaveformComplexF64_cfunc.restype = ViStatus # noqa: F405 - return self.niRFSG_WriteWaveformComplexF64_cfunc(vi, waveform_name, number_of_samples, waveform_data_array, more_data_pending) - - def niRFSG_WriteWaveformComplexI16(self, vi, waveform_name, number_of_samples, waveform_data_array, more_data_pending): # noqa: N802 - with self._func_lock: - if self.niRFSG_WriteWaveformComplexI16_cfunc is None: - self.niRFSG_WriteWaveformComplexI16_cfunc = self._get_library_function('niRFSG_WriteWaveformComplexI16') - self.niRFSG_WriteWaveformComplexI16_cfunc.argtypes = [ViSession, ctypes.POINTER(ViChar), ViInt32, ctypes.POINTER(ComplexViInt16), ViBoolean] # noqa: F405 - self.niRFSG_WriteWaveformComplexI16_cfunc.restype = ViStatus # noqa: F405 - return self.niRFSG_WriteWaveformComplexI16_cfunc(vi, waveform_name, number_of_samples, waveform_data_array, more_data_pending) - def niRFSG_close(self, vi): # noqa: N802 with self._func_lock: if self.niRFSG_close_cfunc is None: diff --git a/generated/nirfsg/nirfsg/_library_interpreter.py b/generated/nirfsg/nirfsg/_library_interpreter.py index bc952fb416..53324c5c33 100644 --- a/generated/nirfsg/nirfsg/_library_interpreter.py +++ b/generated/nirfsg/nirfsg/_library_interpreter.py @@ -746,32 +746,32 @@ def set_attribute_vi_string(self, channel_name, attribute, value): # noqa: N802 errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) return - def set_waveform_burst_start_locations(self, channel_name, number_of_locations): # noqa: N802 + def set_waveform_burst_start_locations(self, channel_name, number_of_locations, locations): # noqa: N802 vi_ctype = _visatype.ViSession(self._vi) # case S110 channel_name_ctype = ctypes.create_string_buffer(channel_name.encode(self._encoding)) # case C010 number_of_locations_ctype = _visatype.ViInt32(number_of_locations) # case S150 - locations_ctype = _visatype.ViReal64() # case S220 - error_code = self._library.niRFSG_SetWaveformBurstStartLocations(vi_ctype, channel_name_ctype, number_of_locations_ctype, None if locations_ctype is None else (ctypes.pointer(locations_ctype))) + locations_ctype = _visatype.ViReal64(locations) # case S150 + error_code = self._library.niRFSG_SetWaveformBurstStartLocations(vi_ctype, channel_name_ctype, number_of_locations_ctype, locations_ctype) errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) - return float(locations_ctype.value) + return - def set_waveform_burst_stop_locations(self, channel_name, number_of_locations): # noqa: N802 + def set_waveform_burst_stop_locations(self, channel_name, number_of_locations, locations): # noqa: N802 vi_ctype = _visatype.ViSession(self._vi) # case S110 channel_name_ctype = ctypes.create_string_buffer(channel_name.encode(self._encoding)) # case C010 number_of_locations_ctype = _visatype.ViInt32(number_of_locations) # case S150 - locations_ctype = _visatype.ViReal64() # case S220 - error_code = self._library.niRFSG_SetWaveformBurstStopLocations(vi_ctype, channel_name_ctype, number_of_locations_ctype, None if locations_ctype is None else (ctypes.pointer(locations_ctype))) + locations_ctype = _visatype.ViReal64(locations) # case S150 + error_code = self._library.niRFSG_SetWaveformBurstStopLocations(vi_ctype, channel_name_ctype, number_of_locations_ctype, locations_ctype) errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) - return float(locations_ctype.value) + return - def set_waveform_marker_event_locations(self, channel_name, number_of_locations): # noqa: N802 + def set_waveform_marker_event_locations(self, channel_name, number_of_locations, locations): # noqa: N802 vi_ctype = _visatype.ViSession(self._vi) # case S110 channel_name_ctype = ctypes.create_string_buffer(channel_name.encode(self._encoding)) # case C010 number_of_locations_ctype = _visatype.ViInt32(number_of_locations) # case S150 - locations_ctype = _visatype.ViReal64() # case S220 - error_code = self._library.niRFSG_SetWaveformMarkerEventLocations(vi_ctype, channel_name_ctype, number_of_locations_ctype, None if locations_ctype is None else (ctypes.pointer(locations_ctype))) + locations_ctype = _visatype.ViReal64(locations) # case S150 + error_code = self._library.niRFSG_SetWaveformMarkerEventLocations(vi_ctype, channel_name_ctype, number_of_locations_ctype, locations_ctype) errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) - return float(locations_ctype.value) + return def unlock(self): # noqa: N802 vi_ctype = _visatype.ViSession(self._vi) # case S110 @@ -786,49 +786,48 @@ def wait_until_settled(self, max_time_milliseconds): # noqa: N802 errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) return - def write_p2_p_endpoint_i16(self, stream_endpoint, number_of_samples, endpoint_data): # noqa: N802 - vi_ctype = _visatype.ViSession(self._vi) # case S110 - stream_endpoint_ctype = ctypes.create_string_buffer(stream_endpoint.encode(self._encoding)) # case C020 - number_of_samples_ctype = _visatype.ViInt32(0 if endpoint_data is None else len(endpoint_data)) # case S160 - endpoint_data_ctype = _get_ctypes_pointer_for_buffer(value=endpoint_data, library_type=_visatype.ViInt16) # case B550 - error_code = self._library.niRFSG_WriteP2PEndpointI16(vi_ctype, stream_endpoint_ctype, number_of_samples_ctype, endpoint_data_ctype) - errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) - return - - def write_script(self, script): # noqa: N802 - vi_ctype = _visatype.ViSession(self._vi) # case S110 - script_ctype = ctypes.create_string_buffer(script.encode(self._encoding)) # case C020 - error_code = self._library.niRFSG_WriteScript(vi_ctype, script_ctype) - errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) - return - - def write_waveform_complex_f32(self, waveform_name, waveform_data_array, more_data_pending): # noqa: N802 + def write_arb_waveform_complex_f32(self, waveform_name, waveform_data_array, more_data_pending): # noqa: N802 vi_ctype = _visatype.ViSession(self._vi) # case S110 waveform_name_ctype = ctypes.create_string_buffer(waveform_name.encode(self._encoding)) # case C020 number_of_samples_ctype = _visatype.ViInt32(0 if waveform_data_array is None else len(waveform_data_array)) # case S160 waveform_data_array_ctype = _get_ctypes_pointer_for_buffer(value=waveform_data_array, library_type=_complextype.ComplexViReal32, complex_type='numpy') # case B510 more_data_pending_ctype = _visatype.ViBoolean(more_data_pending) # case S150 - error_code = self._library.niRFSG_WriteWaveformComplexF32(vi_ctype, waveform_name_ctype, number_of_samples_ctype, waveform_data_array_ctype, more_data_pending_ctype) + error_code = self._library.niRFSG_WriteArbWaveformComplexF32(vi_ctype, waveform_name_ctype, number_of_samples_ctype, waveform_data_array_ctype, more_data_pending_ctype) errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) return - def write_waveform_complex_f64(self, waveform_name, waveform_data_array, more_data_pending): # noqa: N802 + def write_arb_waveform_complex_f64(self, waveform_name, waveform_data_array, more_data_pending): # noqa: N802 vi_ctype = _visatype.ViSession(self._vi) # case S110 waveform_name_ctype = ctypes.create_string_buffer(waveform_name.encode(self._encoding)) # case C020 number_of_samples_ctype = _visatype.ViInt32(0 if waveform_data_array is None else len(waveform_data_array)) # case S160 waveform_data_array_ctype = _get_ctypes_pointer_for_buffer(value=waveform_data_array, library_type=_complextype.ComplexViReal64, complex_type='numpy') # case B510 more_data_pending_ctype = _visatype.ViBoolean(more_data_pending) # case S150 - error_code = self._library.niRFSG_WriteWaveformComplexF64(vi_ctype, waveform_name_ctype, number_of_samples_ctype, waveform_data_array_ctype, more_data_pending_ctype) + error_code = self._library.niRFSG_WriteArbWaveformComplexF64(vi_ctype, waveform_name_ctype, number_of_samples_ctype, waveform_data_array_ctype, more_data_pending_ctype) errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) return - def write_waveform_complex_i16(self, waveform_name, waveform_data_array, more_data_pending): # noqa: N802 + def write_arb_waveform_complex_i16(self, waveform_name, waveform_data_array): # noqa: N802 vi_ctype = _visatype.ViSession(self._vi) # case S110 waveform_name_ctype = ctypes.create_string_buffer(waveform_name.encode(self._encoding)) # case C020 number_of_samples_ctype = _visatype.ViInt32(0 if waveform_data_array is None else len(waveform_data_array) // 2) # case S160 waveform_data_array_ctype = _get_ctypes_pointer_for_buffer(value=waveform_data_array, library_type=_complextype.ComplexViInt16, complex_type='interleaved') # case B510 - more_data_pending_ctype = _visatype.ViBoolean(more_data_pending) # case S150 - error_code = self._library.niRFSG_WriteWaveformComplexI16(vi_ctype, waveform_name_ctype, number_of_samples_ctype, waveform_data_array_ctype, more_data_pending_ctype) + error_code = self._library.niRFSG_WriteArbWaveformComplexI16(vi_ctype, waveform_name_ctype, number_of_samples_ctype, waveform_data_array_ctype) + errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) + return + + def write_p2_p_endpoint_i16(self, stream_endpoint, number_of_samples, endpoint_data): # noqa: N802 + vi_ctype = _visatype.ViSession(self._vi) # case S110 + stream_endpoint_ctype = ctypes.create_string_buffer(stream_endpoint.encode(self._encoding)) # case C020 + number_of_samples_ctype = _visatype.ViInt32(0 if endpoint_data is None else len(endpoint_data)) # case S160 + endpoint_data_ctype = _get_ctypes_pointer_for_buffer(value=endpoint_data, library_type=_visatype.ViInt16) # case B550 + error_code = self._library.niRFSG_WriteP2PEndpointI16(vi_ctype, stream_endpoint_ctype, number_of_samples_ctype, endpoint_data_ctype) + errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) + return + + def write_script(self, script): # noqa: N802 + vi_ctype = _visatype.ViSession(self._vi) # case S110 + script_ctype = ctypes.create_string_buffer(script.encode(self._encoding)) # case C020 + error_code = self._library.niRFSG_WriteScript(vi_ctype, script_ctype) errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) return diff --git a/generated/nirfsg/nirfsg/session.py b/generated/nirfsg/nirfsg/session.py index d977796c33..257978f699 100644 --- a/generated/nirfsg/nirfsg/session.py +++ b/generated/nirfsg/nirfsg/session.py @@ -5434,6 +5434,7 @@ def __setattr__(self, key, value): ''' These are code-generated ''' + @ivi_synchronized def check_attribute_vi_boolean(self, attribute, value): r'''check_attribute_vi_boolean @@ -5460,6 +5461,7 @@ def check_attribute_vi_boolean(self, attribute, value): ''' self._interpreter.check_attribute_vi_boolean(self._repeated_capability, attribute, value) + @ivi_synchronized def check_attribute_vi_int32(self, attribute, value): r'''check_attribute_vi_int32 @@ -5486,6 +5488,7 @@ def check_attribute_vi_int32(self, attribute, value): ''' self._interpreter.check_attribute_vi_int32(self._repeated_capability, attribute, value) + @ivi_synchronized def check_attribute_vi_int64(self, attribute, value): r'''check_attribute_vi_int64 @@ -5512,6 +5515,7 @@ def check_attribute_vi_int64(self, attribute, value): ''' self._interpreter.check_attribute_vi_int64(self._repeated_capability, attribute, value) + @ivi_synchronized def check_attribute_vi_real64(self, attribute, value): r'''check_attribute_vi_real64 @@ -5538,6 +5542,7 @@ def check_attribute_vi_real64(self, attribute, value): ''' self._interpreter.check_attribute_vi_real64(self._repeated_capability, attribute, value) + @ivi_synchronized def check_attribute_vi_session(self, attribute): r'''check_attribute_vi_session @@ -5560,6 +5565,7 @@ def check_attribute_vi_session(self, attribute): ''' self._interpreter.check_attribute_vi_session(self._repeated_capability, attribute) + @ivi_synchronized def check_attribute_vi_string(self, attribute, value): r'''check_attribute_vi_string @@ -5586,6 +5592,7 @@ def check_attribute_vi_string(self, attribute, value): ''' self._interpreter.check_attribute_vi_string(self._repeated_capability, attribute, value) + @ivi_synchronized def _get_attribute_vi_boolean(self, attribute): r'''_get_attribute_vi_boolean @@ -5618,6 +5625,7 @@ def _get_attribute_vi_boolean(self, attribute): value = self._interpreter.get_attribute_vi_boolean(self._repeated_capability, attribute) return value + @ivi_synchronized def _get_attribute_vi_int32(self, attribute): r'''_get_attribute_vi_int32 @@ -5650,6 +5658,7 @@ def _get_attribute_vi_int32(self, attribute): value = self._interpreter.get_attribute_vi_int32(self._repeated_capability, attribute) return value + @ivi_synchronized def _get_attribute_vi_int64(self, attribute): r'''_get_attribute_vi_int64 @@ -5682,6 +5691,7 @@ def _get_attribute_vi_int64(self, attribute): value = self._interpreter.get_attribute_vi_int64(self._repeated_capability, attribute) return value + @ivi_synchronized def _get_attribute_vi_real64(self, attribute): r'''_get_attribute_vi_real64 @@ -5714,6 +5724,7 @@ def _get_attribute_vi_real64(self, attribute): value = self._interpreter.get_attribute_vi_real64(self._repeated_capability, attribute) return value + @ivi_synchronized def _get_attribute_vi_session(self, attribute): r'''_get_attribute_vi_session @@ -5746,6 +5757,7 @@ def _get_attribute_vi_session(self, attribute): value = self._interpreter.get_attribute_vi_session(self._repeated_capability, attribute) return value + @ivi_synchronized def _get_attribute_vi_string(self, attribute): r'''_get_attribute_vi_string @@ -5784,6 +5796,7 @@ def _get_attribute_vi_string(self, attribute): value = self._interpreter.get_attribute_vi_string(self._repeated_capability, attribute) return value + @ivi_synchronized def _get_waveform_burst_start_locations(self, number_of_locations): r'''_get_waveform_burst_start_locations @@ -5821,6 +5834,7 @@ def _get_waveform_burst_start_locations(self, number_of_locations): locations, required_size = self._interpreter.get_waveform_burst_start_locations(self._repeated_capability, number_of_locations) return locations, required_size + @ivi_synchronized def _get_waveform_burst_stop_locations(self, number_of_locations): r'''_get_waveform_burst_stop_locations @@ -5858,6 +5872,7 @@ def _get_waveform_burst_stop_locations(self, number_of_locations): locations, required_size = self._interpreter.get_waveform_burst_stop_locations(self._repeated_capability, number_of_locations) return locations, required_size + @ivi_synchronized def _get_waveform_marker_event_locations(self, number_of_locations): r'''_get_waveform_marker_event_locations @@ -5892,6 +5907,7 @@ def _get_waveform_marker_event_locations(self, number_of_locations): locations, required_size = self._interpreter.get_waveform_marker_event_locations(self._repeated_capability, number_of_locations) return locations, required_size + @ivi_synchronized def load_configurations_from_file(self, file_path): r'''load_configurations_from_file @@ -5953,6 +5969,7 @@ def lock(self): # that will handle the unlock for them return _Lock(self) + @ivi_synchronized def reset_attribute(self, attribute_id): r'''reset_attribute @@ -5977,6 +5994,7 @@ def reset_attribute(self, attribute_id): ''' self._interpreter.reset_attribute(self._repeated_capability, attribute_id) + @ivi_synchronized def save_configurations_to_file(self, file_path): r'''save_configurations_to_file @@ -6001,6 +6019,7 @@ def save_configurations_to_file(self, file_path): ''' self._interpreter.save_configurations_to_file(self._repeated_capability, file_path) + @ivi_synchronized def send_software_edge_trigger(self, trigger, trigger_identifier): r'''send_software_edge_trigger @@ -6065,6 +6084,7 @@ def send_software_edge_trigger(self, trigger, trigger_identifier): raise TypeError('Parameter trigger_identifier must be of type ' + str(enums.TriggerIdentifier)) self._interpreter.send_software_edge_trigger(trigger, trigger_identifier) + @ivi_synchronized def _set_attribute_vi_boolean(self, attribute, value): r'''_set_attribute_vi_boolean @@ -6100,6 +6120,7 @@ def _set_attribute_vi_boolean(self, attribute, value): ''' self._interpreter.set_attribute_vi_boolean(self._repeated_capability, attribute, value) + @ivi_synchronized def _set_attribute_vi_int32(self, attribute, value): r'''_set_attribute_vi_int32 @@ -6135,6 +6156,7 @@ def _set_attribute_vi_int32(self, attribute, value): ''' self._interpreter.set_attribute_vi_int32(self._repeated_capability, attribute, value) + @ivi_synchronized def _set_attribute_vi_int64(self, attribute, value): r'''_set_attribute_vi_int64 @@ -6172,6 +6194,7 @@ def _set_attribute_vi_int64(self, attribute, value): ''' self._interpreter.set_attribute_vi_int64(self._repeated_capability, attribute, value) + @ivi_synchronized def _set_attribute_vi_real64(self, attribute, value): r'''_set_attribute_vi_real64 @@ -6207,6 +6230,7 @@ def _set_attribute_vi_real64(self, attribute, value): ''' self._interpreter.set_attribute_vi_real64(self._repeated_capability, attribute, value) + @ivi_synchronized def _set_attribute_vi_session(self, attribute): r'''_set_attribute_vi_session @@ -6238,6 +6262,7 @@ def _set_attribute_vi_session(self, attribute): ''' self._interpreter.set_attribute_vi_session(self._repeated_capability, attribute) + @ivi_synchronized def _set_attribute_vi_string(self, attribute, value): r'''_set_attribute_vi_string @@ -6273,7 +6298,8 @@ def _set_attribute_vi_string(self, attribute, value): ''' self._interpreter.set_attribute_vi_string(self._repeated_capability, attribute, value) - def _set_waveform_burst_start_locations(self, number_of_locations): + @ivi_synchronized + def _set_waveform_burst_start_locations(self, number_of_locations, locations): r'''_set_waveform_burst_start_locations Configures the start location of the burst in samples where the burst refers to the active portion of a waveform. @@ -6294,18 +6320,16 @@ def _set_waveform_burst_start_locations(self, number_of_locations): Args: number_of_locations (int): Specifies the size of the burst start locations array. - - Returns: locations (float): Returns the burst start locations stored in the NI-RFSG session for the waveform that you specified in the **CHANNEL_NAME** parameter. This value is expressed in samples. Note: One or more of the referenced properties are not in the Python API for this driver. ''' - locations = self._interpreter.set_waveform_burst_start_locations(self._repeated_capability, number_of_locations) - return locations + self._interpreter.set_waveform_burst_start_locations(self._repeated_capability, number_of_locations, locations) - def _set_waveform_burst_stop_locations(self, number_of_locations): + @ivi_synchronized + def _set_waveform_burst_stop_locations(self, number_of_locations, locations): r'''_set_waveform_burst_stop_locations Configures the stop location of the burst in samples where the burst refers to the active portion of a waveform. @@ -6326,15 +6350,13 @@ def _set_waveform_burst_stop_locations(self, number_of_locations): Args: number_of_locations (int): Specifies the size of the burst stop locations array. - - Returns: locations (float): Specifies the burst stop locations, in samples, to store in the NI-RFSG session. ''' - locations = self._interpreter.set_waveform_burst_stop_locations(self._repeated_capability, number_of_locations) - return locations + self._interpreter.set_waveform_burst_stop_locations(self._repeated_capability, number_of_locations, locations) - def _set_waveform_marker_event_locations(self, number_of_locations): + @ivi_synchronized + def _set_waveform_marker_event_locations(self, number_of_locations, locations): r'''_set_waveform_marker_event_locations Configures the marker locations associated with waveform and marker in the NI-RFSG session. @@ -6355,13 +6377,10 @@ def _set_waveform_marker_event_locations(self, number_of_locations): Args: number_of_locations (int): Specifies the size of the locations array. - - Returns: locations (float): Specifies the marker location, in samples, to store in the NI-RFSG database. ''' - locations = self._interpreter.set_waveform_marker_event_locations(self._repeated_capability, number_of_locations) - return locations + self._interpreter.set_waveform_marker_event_locations(self._repeated_capability, number_of_locations, locations) def unlock(self): '''unlock @@ -6376,7 +6395,7 @@ def unlock(self): class Session(_SessionBase): '''An NI-RFSG session to the NI-RFSG driver''' - def __init__(self, resource_name, id_query, reset_device, options={}): + def __init__(self, resource_name, options={}, id_query=False, reset_device=False): r'''An NI-RFSG session to the NI-RFSG driver Opens a session to the device you specify as the **RESOURCE_NAME** and returns a ViSession handle that you use to identify the NI-RFSG device in all subsequent NI-RFSG method calls. @@ -6403,30 +6422,6 @@ def __init__(self, resource_name, id_query, reset_device, options={}): Note: NI-RFSG device names are not case-sensitive. However, all IVI names, such as logical names, are case-sensitive. If you use an IVI logical name, make sure the name is identical to the name shown in the IVI Configuration Utility. - id_query (bool): Specifies whether you want NI-RFSG to perform an ID query. - - **Defined Values** : - - +-----------+--------------------------+ - | Value | Description | - +===========+==========================+ - | True (1) | Perform ID query. | - +-----------+--------------------------+ - | False (0) | Do not perform ID query. | - +-----------+--------------------------+ - - reset_device (bool): Specifies whether you want to reset the NI-RFSG device during the initialization procedure. - - **Defined Values** : - - +-----------+----------------------+ - | Value | Description | - +===========+======================+ - | True (1) | Reset device. | - +-----------+----------------------+ - | False (0) | Do not reset device. | - +-----------+----------------------+ - options (str): Specifies the initial value of certain properties for the session. The syntax for **options** is a dictionary of properties with an assigned value. For example: @@ -6455,6 +6450,30 @@ def __init__(self, resource_name, id_query, reset_device, options={}): | driver_setup | {} | +-------------------------+---------+ + id_query (bool): Specifies whether you want NI-RFSG to perform an ID query. + + **Defined Values** : + + +-----------+--------------------------+ + | Value | Description | + +===========+==========================+ + | True (1) | Perform ID query. | + +-----------+--------------------------+ + | False (0) | Do not perform ID query. | + +-----------+--------------------------+ + + reset_device (bool): Specifies whether you want to reset the NI-RFSG device during the initialization procedure. + + **Defined Values** : + + +-----------+----------------------+ + | Value | Description | + +===========+======================+ + | True (1) | Reset device. | + +-----------+----------------------+ + | False (0) | Do not reset device. | + +-----------+----------------------+ + Returns: new_vi (int): Returns a ViSession handle that you use to identify the NI-RFSG device in all subsequent NI-RFSG method calls. @@ -6475,16 +6494,16 @@ def __init__(self, resource_name, id_query, reset_device, options={}): # if _init_with_options fails, the error handler can reference it. # And then here, once _init_with_options succeeds, we call set_session_handle # with the actual session handle. - self._interpreter.set_session_handle(self._init_with_options(resource_name, id_query, reset_device, options)) + self._interpreter.set_session_handle(self._init_with_options(resource_name, options, id_query, reset_device)) self.tclk = nitclk.SessionReference(self._interpreter.get_session_handle()) # Store the parameter list for later printing in __repr__ param_list = [] param_list.append("resource_name=" + pp.pformat(resource_name)) + param_list.append("options=" + pp.pformat(options)) param_list.append("id_query=" + pp.pformat(id_query)) param_list.append("reset_device=" + pp.pformat(reset_device)) - param_list.append("options=" + pp.pformat(options)) self._param_list = ', '.join(param_list) # Store the list of channels in the Session which is needed by some nimi-python modules. @@ -6549,6 +6568,7 @@ def close(self): ''' These are code-generated ''' + @ivi_synchronized def abort(self): r'''abort @@ -6562,6 +6582,7 @@ def abort(self): ''' self._interpreter.abort() + @ivi_synchronized def allocate_arb_waveform(self, waveform_name, size_in_samples): r'''allocate_arb_waveform @@ -6585,6 +6606,7 @@ def allocate_arb_waveform(self, waveform_name, size_in_samples): ''' self._interpreter.allocate_arb_waveform(waveform_name, size_in_samples) + @ivi_synchronized def change_external_calibration_password(self, old_password, new_password): r'''change_external_calibration_password @@ -6600,6 +6622,7 @@ def change_external_calibration_password(self, old_password, new_password): ''' self._interpreter.change_external_calibration_password(old_password, new_password) + @ivi_synchronized def check_generation_status(self): r'''check_generation_status @@ -6632,6 +6655,7 @@ def check_generation_status(self): is_done = self._interpreter.check_generation_status() return is_done + @ivi_synchronized def check_if_script_exists(self, script_name): r'''check_if_script_exists @@ -6663,6 +6687,7 @@ def check_if_script_exists(self, script_name): script_exists = self._interpreter.check_if_script_exists(script_name) return script_exists + @ivi_synchronized def check_if_waveform_exists(self, waveform_name): r'''check_if_waveform_exists @@ -6694,6 +6719,7 @@ def check_if_waveform_exists(self, waveform_name): waveform_exists = self._interpreter.check_if_waveform_exists(waveform_name) return waveform_exists + @ivi_synchronized def clear_all_arb_waveforms(self): r'''clear_all_arb_waveforms @@ -6705,6 +6731,7 @@ def clear_all_arb_waveforms(self): ''' self._interpreter.clear_all_arb_waveforms() + @ivi_synchronized def clear_arb_waveform(self, name): r'''clear_arb_waveform @@ -6720,6 +6747,7 @@ def clear_arb_waveform(self, name): ''' self._interpreter.clear_arb_waveform(name) + @ivi_synchronized def clear_error(self): r'''clear_error @@ -6738,6 +6766,7 @@ def clear_error(self): ''' self._interpreter.clear_error() + @ivi_synchronized def clear_self_calibrate_range(self): r'''clear_self_calibrate_range @@ -6747,6 +6776,7 @@ def clear_self_calibrate_range(self): ''' self._interpreter.clear_self_calibrate_range() + @ivi_synchronized def commit(self): r'''commit @@ -6762,6 +6792,7 @@ def commit(self): ''' self._interpreter.commit() + @ivi_synchronized def configure_deembedding_table_interpolation_linear(self, port, table_name, format): r'''configure_deembedding_table_interpolation_linear @@ -6793,6 +6824,7 @@ def configure_deembedding_table_interpolation_linear(self, port, table_name, for raise TypeError('Parameter format must be of type ' + str(enums.Format)) self._interpreter.configure_deembedding_table_interpolation_linear(port, table_name, format) + @ivi_synchronized def configure_deembedding_table_interpolation_nearest(self, port, table_name): r'''configure_deembedding_table_interpolation_nearest @@ -6810,6 +6842,7 @@ def configure_deembedding_table_interpolation_nearest(self, port, table_name): ''' self._interpreter.configure_deembedding_table_interpolation_nearest(port, table_name) + @ivi_synchronized def configure_deembedding_table_interpolation_spline(self, port, table_name): r'''configure_deembedding_table_interpolation_spline @@ -6827,6 +6860,7 @@ def configure_deembedding_table_interpolation_spline(self, port, table_name): ''' self._interpreter.configure_deembedding_table_interpolation_spline(port, table_name) + @ivi_synchronized def configure_digital_edge_script_trigger(self, trigger_id, source, edge): r'''configure_digital_edge_script_trigger @@ -6854,6 +6888,7 @@ def configure_digital_edge_script_trigger(self, trigger_id, source, edge): ''' self._interpreter.configure_digital_edge_script_trigger(trigger_id, source, edge) + @ivi_synchronized def configure_digital_edge_start_trigger(self, source, edge): r'''configure_digital_edge_start_trigger @@ -6879,6 +6914,7 @@ def configure_digital_edge_start_trigger(self, source, edge): ''' self._interpreter.configure_digital_edge_start_trigger(source, edge) + @ivi_synchronized def configure_digital_level_script_trigger(self, trigger_id, source, level): r'''configure_digital_level_script_trigger @@ -6904,6 +6940,7 @@ def configure_digital_level_script_trigger(self, trigger_id, source, level): ''' self._interpreter.configure_digital_level_script_trigger(trigger_id, source, level) + @ivi_synchronized def configure_digital_modulation_user_defined_waveform(self, number_of_samples, user_defined_waveform): r'''configure_digital_modulation_user_defined_waveform @@ -6922,6 +6959,7 @@ def configure_digital_modulation_user_defined_waveform(self, number_of_samples, ''' self._interpreter.configure_digital_modulation_user_defined_waveform(number_of_samples, user_defined_waveform) + @ivi_synchronized def configure_generation_mode(self, generation_mode): r'''configure_generation_mode @@ -6963,6 +7001,7 @@ def configure_generation_mode(self, generation_mode): raise TypeError('Parameter generation_mode must be of type ' + str(enums.GenerationMode)) self._interpreter.configure_generation_mode(generation_mode) + @ivi_synchronized def configure_output_enabled(self, output_enabled): r'''configure_output_enabled @@ -6986,6 +7025,7 @@ def configure_output_enabled(self, output_enabled): ''' self._interpreter.configure_output_enabled(output_enabled) + @ivi_synchronized def configure_p2_p_endpoint_fullness_start_trigger(self, p2p_endpoint_fullness_level): r'''configure_p2_p_endpoint_fullness_start_trigger @@ -7010,6 +7050,7 @@ def configure_p2_p_endpoint_fullness_start_trigger(self, p2p_endpoint_fullness_l ''' self._interpreter.configure_p2_p_endpoint_fullness_start_trigger(p2p_endpoint_fullness_level) + @ivi_synchronized def configure_power_level_type(self, power_level_type): r'''configure_power_level_type @@ -7039,6 +7080,7 @@ def configure_power_level_type(self, power_level_type): ''' self._interpreter.configure_power_level_type(power_level_type) + @ivi_synchronized def configure_pxi_chassis_clk10(self, pxi_clk10_source): r'''configure_pxi_chassis_clk10 @@ -7060,6 +7102,7 @@ def configure_pxi_chassis_clk10(self, pxi_clk10_source): ''' self._interpreter.configure_pxi_chassis_clk10(pxi_clk10_source) + @ivi_synchronized def configure_rf(self, frequency, power_level): r'''configure_rf @@ -7085,6 +7128,7 @@ def configure_rf(self, frequency, power_level): ''' self._interpreter.configure_rf(frequency, power_level) + @ivi_synchronized def configure_ref_clock(self, ref_clock_source, ref_clock_rate): r'''configure_ref_clock @@ -7136,6 +7180,7 @@ def configure_ref_clock(self, ref_clock_source, ref_clock_rate): ''' self._interpreter.configure_ref_clock(ref_clock_source, ref_clock_rate) + @ivi_synchronized def configure_signal_bandwidth(self, signal_bandwidth): r'''configure_signal_bandwidth @@ -7155,6 +7200,7 @@ def configure_signal_bandwidth(self, signal_bandwidth): ''' self._interpreter.configure_signal_bandwidth(signal_bandwidth) + @ivi_synchronized def configure_software_script_trigger(self, trigger_id): r'''configure_software_script_trigger @@ -7176,6 +7222,7 @@ def configure_software_script_trigger(self, trigger_id): ''' self._interpreter.configure_software_script_trigger(trigger_id) + @ivi_synchronized def configure_software_start_trigger(self): r'''configure_software_start_trigger @@ -7195,6 +7242,7 @@ def configure_software_start_trigger(self): ''' self._interpreter.configure_software_start_trigger() + @ivi_synchronized def create_deembedding_sparameter_table_s2_p_file(self, port, table_name, s2p_file_path, sparameter_orientation): r'''create_deembedding_sparameter_table_s2_p_file @@ -7232,6 +7280,7 @@ def create_deembedding_sparameter_table_s2_p_file(self, port, table_name, s2p_fi raise TypeError('Parameter sparameter_orientation must be of type ' + str(enums.SparameterOrientation)) self._interpreter.create_deembedding_sparameter_table_s2_p_file(port, table_name, s2p_file_path, sparameter_orientation) + @ivi_synchronized def delete_all_deembedding_tables(self): r'''delete_all_deembedding_tables @@ -7241,6 +7290,7 @@ def delete_all_deembedding_tables(self): ''' self._interpreter.delete_all_deembedding_tables() + @ivi_synchronized def delete_deembedding_table(self, port, table_name): r'''delete_deembedding_table @@ -7256,6 +7306,7 @@ def delete_deembedding_table(self, port, table_name): ''' self._interpreter.delete_deembedding_table(port, table_name) + @ivi_synchronized def disable(self): r'''disable @@ -7265,6 +7316,7 @@ def disable(self): ''' self._interpreter.disable() + @ivi_synchronized def disable_script_trigger(self, trigger_id): r'''disable_script_trigger @@ -7284,6 +7336,7 @@ def disable_script_trigger(self, trigger_id): ''' self._interpreter.disable_script_trigger(trigger_id) + @ivi_synchronized def disable_start_trigger(self): r'''disable_start_trigger @@ -7299,6 +7352,7 @@ def disable_start_trigger(self): ''' self._interpreter.disable_start_trigger() + @ivi_synchronized def export_signal(self, signal, signal_identifier, output_terminal): r'''export_signal @@ -7400,6 +7454,7 @@ def export_signal(self, signal, signal_identifier, output_terminal): raise TypeError('Parameter output_terminal must be of type ' + str(enums.ReferenceClockExportOutputTerminal)) self._interpreter.export_signal(signal, signal_identifier, output_terminal) + @ivi_synchronized def _get_external_calibration_last_date_and_time(self): r'''_get_external_calibration_last_date_and_time @@ -7430,6 +7485,7 @@ def _get_external_calibration_last_date_and_time(self): year, month, day, hour, minute, second = self._interpreter.get_external_calibration_last_date_and_time() return year, month, day, hour, minute, second + @ivi_synchronized def get_external_calibration_last_date_and_time(self): '''get_external_calibration_last_date_and_time @@ -7442,6 +7498,7 @@ def get_external_calibration_last_date_and_time(self): year, month, day, hour, minute, second = self._get_external_calibration_last_date_and_time() return hightime.datetime(year, month, day, hour, minute) + @ivi_synchronized def get_self_calibration_last_date_and_time(self): '''get_self_calibration_last_date_and_time @@ -7454,6 +7511,7 @@ def get_self_calibration_last_date_and_time(self): year, month, day, hour, minute, second = self._get_self_calibration_date_and_time() return hightime.datetime(year, month, day, hour, minute) + @ivi_synchronized def get_max_settable_power(self): r'''get_max_settable_power @@ -7468,6 +7526,7 @@ def get_max_settable_power(self): value = self._interpreter.get_max_settable_power() return value + @ivi_synchronized def _get_self_calibration_date_and_time(self, module): r'''_get_self_calibration_date_and_time @@ -7502,6 +7561,7 @@ def _get_self_calibration_date_and_time(self, module): year, month, day, hour, minute, second = self._interpreter.get_self_calibration_date_and_time(module) return year, month, day, hour, minute, second + @ivi_synchronized def get_self_calibration_temperature(self, module): r'''get_self_calibration_temperature @@ -7534,6 +7594,7 @@ def get_self_calibration_temperature(self, module): temperature = self._interpreter.get_self_calibration_temperature(module) return temperature + @ivi_synchronized def get_stream_endpoint_handle(self, stream_endpoint): r'''get_stream_endpoint_handle @@ -7558,7 +7619,7 @@ def get_stream_endpoint_handle(self, stream_endpoint): reader_handle = self._interpreter.get_stream_endpoint_handle(stream_endpoint) return reader_handle - def _init_with_options(self, resource_name, id_query, reset_device, option_string): + def _init_with_options(self, resource_name, option_string, id_query=False, reset_device=False): r'''_init_with_options Opens a session to the device you specify as the **RESOURCE_NAME** and returns a ViSession handle that you use to identify the NI-RFSG device in all subsequent NI-RFSG method calls. @@ -7585,30 +7646,6 @@ def _init_with_options(self, resource_name, id_query, reset_device, option_strin Note: NI-RFSG device names are not case-sensitive. However, all IVI names, such as logical names, are case-sensitive. If you use an IVI logical name, make sure the name is identical to the name shown in the IVI Configuration Utility. - id_query (bool): Specifies whether you want NI-RFSG to perform an ID query. - - **Defined Values** : - - +-----------+--------------------------+ - | Value | Description | - +===========+==========================+ - | True (1) | Perform ID query. | - +-----------+--------------------------+ - | False (0) | Do not perform ID query. | - +-----------+--------------------------+ - - reset_device (bool): Specifies whether you want to reset the NI-RFSG device during the initialization procedure. - - **Defined Values** : - - +-----------+----------------------+ - | Value | Description | - +===========+======================+ - | True (1) | Reset device. | - +-----------+----------------------+ - | False (0) | Do not reset device. | - +-----------+----------------------+ - option_string (str): Specifies the initial value of certain properties for the session. The following table lists the properties and the name you pass in this parameter to identify the property. The format of this string consists of the following relations: @@ -7635,6 +7672,30 @@ def _init_with_options(self, resource_name, id_query, reset_device, option_strin | Simulate | simulate | +------------------+-------------------------+ + id_query (bool): Specifies whether you want NI-RFSG to perform an ID query. + + **Defined Values** : + + +-----------+--------------------------+ + | Value | Description | + +===========+==========================+ + | True (1) | Perform ID query. | + +-----------+--------------------------+ + | False (0) | Do not perform ID query. | + +-----------+--------------------------+ + + reset_device (bool): Specifies whether you want to reset the NI-RFSG device during the initialization procedure. + + **Defined Values** : + + +-----------+----------------------+ + | Value | Description | + +===========+======================+ + | True (1) | Reset device. | + +-----------+----------------------+ + | False (0) | Do not reset device. | + +-----------+----------------------+ + Returns: new_vi (int): Returns a ViSession handle that you use to identify the NI-RFSG device in all subsequent NI-RFSG method calls. @@ -7643,6 +7704,7 @@ def _init_with_options(self, resource_name, id_query, reset_device, option_strin new_vi = self._interpreter.init_with_options(resource_name, id_query, reset_device, option_string) return new_vi + @ivi_synchronized def _initiate(self): r'''_initiate @@ -7658,6 +7720,7 @@ def _initiate(self): ''' self._interpreter.initiate() + @ivi_synchronized def perform_power_search(self): r'''perform_power_search @@ -7675,6 +7738,7 @@ def perform_power_search(self): ''' self._interpreter.perform_power_search() + @ivi_synchronized def perform_thermal_correction(self): r'''perform_thermal_correction @@ -7694,6 +7758,7 @@ def perform_thermal_correction(self): ''' self._interpreter.perform_thermal_correction() + @ivi_synchronized def query_arb_waveform_capabilities(self): r'''query_arb_waveform_capabilities @@ -7716,6 +7781,7 @@ def query_arb_waveform_capabilities(self): max_number_waveforms, waveform_quantum, min_waveform_size, max_waveform_size = self._interpreter.query_arb_waveform_capabilities() return max_number_waveforms, waveform_quantum, min_waveform_size, max_waveform_size + @ivi_synchronized def read_and_download_waveform_from_file_tdms(self, waveform_name, file_path, waveform_index): r'''read_and_download_waveform_from_file_tdms @@ -7752,6 +7818,7 @@ def read_and_download_waveform_from_file_tdms(self, waveform_name, file_path, wa ''' self._interpreter.read_and_download_waveform_from_file_tdms(waveform_name, file_path, waveform_index) + @ivi_synchronized def reset(self): r'''reset @@ -7769,6 +7836,7 @@ def reset(self): ''' self._interpreter.reset() + @ivi_synchronized def reset_device(self): r'''reset_device @@ -7795,6 +7863,7 @@ def reset_device(self): ''' self._interpreter.reset_device() + @ivi_synchronized def reset_with_defaults(self): r'''reset_with_defaults @@ -7804,6 +7873,7 @@ def reset_with_defaults(self): ''' self._interpreter.reset_with_defaults() + @ivi_synchronized def select_arb_waveform(self, name): r'''select_arb_waveform @@ -7826,6 +7896,7 @@ def select_arb_waveform(self, name): ''' self._interpreter.select_arb_waveform(name) + @ivi_synchronized def self_cal(self): r'''self_cal @@ -7841,6 +7912,7 @@ def self_cal(self): ''' self._interpreter.self_cal() + @ivi_synchronized def self_calibrate_range(self, steps_to_omit, min_frequency, max_frequency, min_power_level, max_power_level): r'''self_calibrate_range @@ -7899,6 +7971,7 @@ def self_calibrate_range(self, steps_to_omit, min_frequency, max_frequency, min_ raise TypeError('Parameter steps_to_omit must be of type ' + str(enums.SelfCalibrateRangeStepsToOmit)) self._interpreter.self_calibrate_range(steps_to_omit, min_frequency, max_frequency, min_power_level, max_power_level) + @ivi_synchronized def self_test(self, self_test_message): r'''self_test @@ -7935,6 +8008,7 @@ def self_test(self, self_test_message): self_test_result = self._interpreter.self_test(self_test_message) return self_test_result + @ivi_synchronized def set_arb_waveform_next_write_position(self, waveform_name, relative_to, offset): r'''set_arb_waveform_next_write_position @@ -7971,6 +8045,7 @@ def set_arb_waveform_next_write_position(self, waveform_name, relative_to, offse raise TypeError('Parameter relative_to must be of type ' + str(enums.RelativeTo)) self._interpreter.set_arb_waveform_next_write_position(waveform_name, relative_to, offset) + @ivi_synchronized def wait_until_settled(self, max_time_milliseconds): r'''wait_until_settled @@ -7990,84 +8065,33 @@ def wait_until_settled(self, max_time_milliseconds): ''' self._interpreter.wait_until_settled(max_time_milliseconds) - def write_p2_p_endpoint_i16(self, stream_endpoint, number_of_samples, endpoint_data): - r'''write_p2_p_endpoint_i16 - - Writes an array of 16-bit integer data to the peer-to-peer endpoint. - - Use this method to write initial data from the host to the endpoint before starting generation to avoid an underflow when you start the generation. - - **Supported Devices** : PXIe-5673E - - **Related Topics** - - `Peer-to-Peer Data Streaming `_--Refer to this topic for more information about configuring a stream. - - `Configuring Flow Control `_ - - `Starting Peer-to-Peer Generation `_ - - `Reconfiguring a Stream `_ - - Args: - stream_endpoint (str): Specifies the stream endpoint FIFO to configure. - - number_of_samples (int): Specifies the number of samples to write into the endpoint FIFO. - - endpoint_data (list of int): Specifies the array of data to write into the endpoint FIFO. The binary data is left-justified. - - ''' - self._interpreter.write_p2_p_endpoint_i16(stream_endpoint, number_of_samples, endpoint_data) - - def write_script(self, script): - r'''write_script + @ivi_synchronized + def _write_arb_waveform_complex_f32(self, waveform_name, waveform_data_array, more_data_pending): + r'''_write_arb_waveform_complex_f32 - Writes a script to the device to control waveform generation in Script mode. + Writes an arbitrary waveform to the NI-RFSG device starting at the position of the last data written in onboard memory. - First, configure your device for Script mode by calling the configure_generation_mode method. The NI-RFSG device must be in the Configuration state before calling the write_script method. + This method accepts the complex baseband data in the form of complex singles. If the waveform to write is already allocated using the allocate_arb_waveform method, the **MORE_DATA_PENDING** parameter is ignored. The PXI-5670/5671 must be in the Configuration state before you call this method. When streaming is enabled, you can call this method when the PXIe-5672/5673/5673E or PXIe-5820/5830/5831/5832/5840/5841/5842/5860 is in the Generation state. **Supported Devices** : PXIe-5644/5645/5646, PXI-5670/5671, PXIe-5672/5673/5673E, PXIe-5820/5830/5831/5832/5840/5841/5842/5860 **Related Topics** - `Scripting Instructions `_--Refer to this topic for more information about VST restrictions on scripts. - - `Common Scripting Use Cases `_ - - Note: If you are using an RF vector signal transceiver (VST) device, some script instructions may not be supported. - - Args: - script (str): Specifies a string containing a syntactically correct script. NI-RFSG supports multiple scripts that are selected with the selected_script property. Refer to `Scripting Instructions `_ for more information about using scripts. - - ''' - self._interpreter.write_script(script) - - @ivi_synchronized - def _write_waveform_complex_f32(self, waveform_name, waveform_data_array, more_data_pending): - r'''_write_waveform_complex_f32 - - Writes an arbitrary waveform to the NI-RFSG device starting at the position of the last data written in onboard memory. - - This method accepts the complex baseband data in the form of complex singles. If the waveform to write is already allocated using the %method{allocate arb waveform} method, the **%parameter{more data pending}** parameter is ignored. The PXI-5670/5671 must be in the Configuration state before you call this method. When streaming is enabled, you can call this method when the PXIe-5672/5673/5673E or PXIe-5820/5830/5831/5832/5840/5841/5842/5860 is in the Generation state. - ---- - **Note** - On the PXIe-5644/5645/5646, PXIe-5672/5673/5673E, and PXIe-5820/5830/5831/5832/5840/5841/5842/5860, the **%parameter{more data pending}** parameter is always ignored. To write data in blocks on these devices, you must allocate the waveform before writing it. - ---- - - **Supported Devices**: PXIe-5644/5645/5646, PXI-5670/5671, PXIe-5672/5673/5673E, PXIe-5820/5830/5831/5832/5840/5841/5842/5860 + `Streaming `_ - **Related Topics** + `Assigning Properties or Properties to a Waveform `_ - [Streaming](https://www.ni.com/docs/en-US/bundle/ni-rfsg/page/streaming.html) + Note: On the PXIe-5644/5645/5646, PXIe-5672/5673/5673E, and PXIe-5820/5830/5831/5832/5840/5841/5842/5860, the **MORE_DATA_PENDING** parameter is always ignored. To write data in blocks on these devices, you must allocate the waveform before writing it. - [Assigning Properties or Properties to a Waveform](https://www.ni.com/docs/en-US/bundle/ni-rfsg/page/assigning-properties-or-properties-to-a-wavef.html) + Note: + One or more of the referenced properties are not in the Python API for this driver. Args: waveform_name (str): Specifies the name used to identify the waveform. This string is case-insensitive and alphanumeric, and it does not use reserved words. waveform_data_array (numpy.array(dtype=numpy.complex64)): Specifies the array of data to load into the waveform. The array must have at least as many elements as the value in the **size_in_samples** parameter in the allocate_arb_waveform method. - more_data_pending (bool): Specifies whether or not the data block contains the end of the waveform. Set this parameter to True to allow data to be appended later to the waveform. Splitting the waveform into multiple data blocks can reduce the memory requirements of the write operation. Append data to a previously written waveform by using the same waveform in the **name** parameter. Set **MORE_DATA_PENDING** to False to indicate that this data block contains the end of the waveform. If the waveform is already allocated, this parameter is ignored. + more_data_pending (bool): Specifies whether or not the data block contains the end of the waveform. Set this parameter to True to allow data to be appended later to the waveform. Splitting the waveform into multiple data blocks can reduce the memory requirements of the write operation. Append data to a previously written waveform by using the same waveform in the WAVEFORM_NAME parameter. Set **MORE_DATA_PENDING** to False to indicate that this data block contains the end of the waveform. If the waveform is already allocated, this parameter is ignored. Note: One or more of the referenced properties are not in the Python API for this driver. @@ -8081,27 +8105,25 @@ def _write_waveform_complex_f32(self, waveform_name, waveform_data_array, more_d raise TypeError('waveform_data_array must be in C-order') if waveform_data_array.dtype is not numpy.dtype('complex64'): raise TypeError('waveform_data_array must be numpy.ndarray of dtype=complex64, is ' + str(waveform_data_array.dtype)) - self._interpreter.write_waveform_complex_f32(waveform_name, waveform_data_array, more_data_pending) + self._interpreter.write_arb_waveform_complex_f32(waveform_name, waveform_data_array, more_data_pending) @ivi_synchronized - def _write_waveform_complex_f64(self, waveform_name, waveform_data_array, more_data_pending): - r'''_write_waveform_complex_f64 + def _write_arb_waveform_complex_f64(self, waveform_name, waveform_data_array, more_data_pending): + r'''_write_arb_waveform_complex_f64 Writes an arbitrary waveform to the NI-RFSG device starting at the position of the last data written in onboard memory. - This method accepts the complex baseband data in the form of complex doubles. If the waveform to write is already allocated using the %method{allocate arb waveform}, the moreDataPending parameter is ignored. The PXI-5670/5671 must be in the Configuration state before you call this method. When streaming is enabled, you can call this method when the PXIe-5672/5673/5673E or PXIe-5820/5830/5831/5832/5840/5841/5842 is in the Generation state. - ---- - **Note** - On the PXIe-5644/5645/5646, PXIe-5672/5673/5673E, and PXIe-5820/5830/5831/5832/5840/5841/5842, the moreDataPending parameter is always ignored. To write data in blocks on these devices, you must allocate the waveform before writing it. - ---- + This method accepts the complex baseband data in the form of complex doubles. If the waveform to write is already allocated using the allocate_arb_waveform, the moreDataPending parameter is ignored. The PXI-5670/5671 must be in the Configuration state before you call this method. When streaming is enabled, you can call this method when the PXIe-5672/5673/5673E or PXIe-5820/5830/5831/5832/5840/5841/5842 is in the Generation state. - **Supported Devices**: PXIe-5644/5645/5646, PXI-5670/5671, PXIe-5672/5673/5673E, PXIe-5820/5830/5831/5832/5840/5841/5842 + **Supported Devices** : PXIe-5644/5645/5646, PXI-5670/5671, PXIe-5672/5673/5673E, PXIe-5820/5830/5831/5832/5840/5841/5842 **Related Topics** - [Streaming](https://www.ni.com/docs/en-US/bundle/ni-rfsg/page/streaming.html) + `Streaming `_ + + `Assigning Properties or Properties to a Waveform `_ - [Assigning Properties or Properties to a Waveform](https://www.ni.com/docs/en-US/bundle/ni-rfsg/page/assigning-properties-or-properties-to-a-wavef.html) + Note: On the PXIe-5644/5645/5646, PXIe-5672/5673/5673E, and PXIe-5820/5830/5831/5832/5840/5841/5842, the moreDataPending parameter is always ignored. To write data in blocks on these devices, you must allocate the waveform before writing it. Args: waveform_name (str): Specifies the name used to identify the waveform. This string is case-insensitive and alphanumeric, and it does not use reserved words. @@ -8122,39 +8144,31 @@ def _write_waveform_complex_f64(self, waveform_name, waveform_data_array, more_d raise TypeError('waveform_data_array must be in C-order') if waveform_data_array.dtype is not numpy.dtype('complex128'): raise TypeError('waveform_data_array must be numpy.ndarray of dtype=complex128, is ' + str(waveform_data_array.dtype)) - self._interpreter.write_waveform_complex_f64(waveform_name, waveform_data_array, more_data_pending) + self._interpreter.write_arb_waveform_complex_f64(waveform_name, waveform_data_array, more_data_pending) @ivi_synchronized - def _write_waveform_complex_i16(self, waveform_name, waveform_data_array, more_data_pending): - r'''_write_waveform_complex_i16 + def _write_arb_waveform_complex_i16(self, waveform_name, waveform_data_array): + r'''_write_arb_waveform_complex_i16 Writes an arbitrary waveform to the NI-RFSG device starting at the position of the last data written in onboard memory. This method accepts the interleaved I/Q data of a complex baseband signal. The PXI-5670/5671 must be in the Configuration state before you call this method. When streaming is enabled, this method can be called when the PXIe-5672/5673/5673E or PXIe-5820/5830/5831/5832/5840/5841/5842/5860 is in the Generation state. - ---- - **Note** - This method only supports %enum_value{power level type.peak power} mode as specified in the %property{power level type} property. If you download a waveform when using this method, you cannot set the %property{power level type} to %enum_value{power level type.average power} without causing error in the output. - ---- - - **Supported Devices**: PXIe-5644/5645/5646, PXIe-5672/5673/5673E, PXIe-5820/5830/5831/5832/5840/5841/5842/5860 + **Supported Devices** : PXIe-5644/5645/5646, PXIe-5672/5673/5673E, PXIe-5820/5830/5831/5832/5840/5841/5842/5860 **Related Topics** - [Streaming](https://www.ni.com/docs/en-US/bundle/ni-rfsg/page/streaming.html) + `Streaming `_ + + `Assigning Properties or Properties to a Waveform `_ - [Assigning Properties or Properties to a Waveform](https://www.ni.com/docs/en-US/bundle/ni-rfsg/page/assigning-properties-or-properties-to-a-wavef.html) + Note: This method only supports PowerLevelType.PEAK mode as specified in the power_level_type property. If you download a waveform when using this method, you cannot set the power_level_type to PowerLevelType.AVERAGE without causing error in the output. Args: waveform_name (str): Specifies the name used to identify the waveform. This string is case-insensitive and alphanumeric, and it does not use reserved words. waveform_data_array (numpy.array(dtype=numpy.int16)): Specifies the array of data to load into the waveform. The array must have at least as many elements as the value in the **size_in_samples** parameter in the allocate_arb_waveform method. - more_data_pending (bool): Specifies whether or not the data block contains the end of the waveform. Set this parameter to True to allow data to be appended later to the waveform. Splitting the waveform into multiple data blocks can reduce the memory requirements of the write operation. Append data to a previously written waveform by using the same waveform in the **name** parameter. Set **MORE_DATA_PENDING** to False to indicate that this data block contains the end of the waveform. If the waveform is already allocated, this parameter is ignored. - - Note: - One or more of the referenced properties are not in the Python API for this driver. - ''' import numpy @@ -8164,17 +8178,70 @@ def _write_waveform_complex_i16(self, waveform_name, waveform_data_array, more_d raise TypeError('waveform_data_array must be in C-order') if waveform_data_array.dtype is not numpy.dtype('int16'): raise TypeError('waveform_data_array must be numpy.ndarray of dtype=int16, is ' + str(waveform_data_array.dtype)) - self._interpreter.write_waveform_complex_i16(waveform_name, waveform_data_array, more_data_pending) + self._interpreter.write_arb_waveform_complex_i16(waveform_name, waveform_data_array) + + @ivi_synchronized + def write_p2_p_endpoint_i16(self, stream_endpoint, number_of_samples, endpoint_data): + r'''write_p2_p_endpoint_i16 + + Writes an array of 16-bit integer data to the peer-to-peer endpoint. + + Use this method to write initial data from the host to the endpoint before starting generation to avoid an underflow when you start the generation. + + **Supported Devices** : PXIe-5673E + + **Related Topics** + + `Peer-to-Peer Data Streaming `_--Refer to this topic for more information about configuring a stream. + + `Configuring Flow Control `_ + + `Starting Peer-to-Peer Generation `_ + + `Reconfiguring a Stream `_ + + Args: + stream_endpoint (str): Specifies the stream endpoint FIFO to configure. + + number_of_samples (int): Specifies the number of samples to write into the endpoint FIFO. + + endpoint_data (list of int): Specifies the array of data to write into the endpoint FIFO. The binary data is left-justified. + + ''' + self._interpreter.write_p2_p_endpoint_i16(stream_endpoint, number_of_samples, endpoint_data) @ivi_synchronized + def write_script(self, script): + r'''write_script + + Writes a script to the device to control waveform generation in Script mode. + + First, configure your device for Script mode by calling the configure_generation_mode method. The NI-RFSG device must be in the Configuration state before calling the write_script method. + + **Supported Devices** : PXIe-5644/5645/5646, PXI-5670/5671, PXIe-5672/5673/5673E, PXIe-5820/5830/5831/5832/5840/5841/5842/5860 + + **Related Topics** + + `Scripting Instructions `_--Refer to this topic for more information about VST restrictions on scripts. + + `Common Scripting Use Cases `_ + + Note: If you are using an RF vector signal transceiver (VST) device, some script instructions may not be supported. + + Args: + script (str): Specifies a string containing a syntactically correct script. NI-RFSG supports multiple scripts that are selected with the selected_script property. Refer to `Scripting Instructions `_ for more information about using scripts. + + ''' + self._interpreter.write_script(script) + def write_arb_waveform(self, waveform_name, waveform_data_array, more_data_pending): '''write_arb_waveform Writes an arbitrary waveform to the NI-RFSG device starting at the position of the last data written in onboard memory. - This method accepts the complex baseband data in the form of numpy array of numpy.complex64 or numpy.complex128 or interleaved numpy array of numpy.int16. If the waveform to write is already allocated using the allocate_arb_waveform method, the **MORE_DATA_PENDING** parameter is ignored. The PXI-5670/5671 must be in the Configuration state before you call this method. When streaming is enabled, you can call this method when the PXIe-5672/5673/5673E or PXIe-5820/5830/5831/5832/5840/5841/5842/5860 is in the Generation state. - ---- - **Supported Devices** : PXIe-5644/5645/5646, PXI-5670/5671, PXIe-5672/5673/5673E, PXIe-5820/5830/5831/5832/5840/5841/5842/5860 + This method accepts the complex baseband data in the form of numpy array of numpy.complex64 or numpy.complex128 or interleaved numpy array of numpy.int16. If the waveform to write is already allocated using the allocate_arb_waveform method, the **MORE_DATA_PENDING** parameter is ignored. The PXI-5670/5671 must be in the Configuration state before you call this method. When streaming is enabled, this method can be called when the PXIe-5672/5673/5673E or PXIe-5820/5830/5831/5832/5840/5841/5842/5860 is in the Generation state. + + **Supported Devices** : PXIe-5644/5645/5646, PXIe-5672/5673/5673E, PXIe-5820/5830/5831/5832/5840/5841/5842/5860 **Related Topics** @@ -8182,6 +8249,8 @@ def write_arb_waveform(self, waveform_name, waveform_data_array, more_data_pendi `Assigning Properties or Properties to a Waveform `_ + Note: This method only supports PowerLevelType.PEAK mode as specified in the power_level_type property. If you download a waveform when using this method, you cannot set the power_level_type to PowerLevelType.AVERAGE without causing error in the output. + Note: One or more of the referenced properties are not in the Python API for this driver. diff --git a/generated/nirfsg/nirfsg/unit_tests/_mock_helper.py b/generated/nirfsg/nirfsg/unit_tests/_mock_helper.py index 465a9b7295..ebe26d5930 100644 --- a/generated/nirfsg/nirfsg/unit_tests/_mock_helper.py +++ b/generated/nirfsg/nirfsg/unit_tests/_mock_helper.py @@ -219,28 +219,25 @@ def __init__(self): self._defaults['SetAttributeViString']['return'] = 0 self._defaults['SetWaveformBurstStartLocations'] = {} self._defaults['SetWaveformBurstStartLocations']['return'] = 0 - self._defaults['SetWaveformBurstStartLocations']['locations'] = None self._defaults['SetWaveformBurstStopLocations'] = {} self._defaults['SetWaveformBurstStopLocations']['return'] = 0 - self._defaults['SetWaveformBurstStopLocations']['locations'] = None self._defaults['SetWaveformMarkerEventLocations'] = {} self._defaults['SetWaveformMarkerEventLocations']['return'] = 0 - self._defaults['SetWaveformMarkerEventLocations']['locations'] = None self._defaults['UnlockSession'] = {} self._defaults['UnlockSession']['return'] = 0 self._defaults['UnlockSession']['callerHasLock'] = None self._defaults['WaitUntilSettled'] = {} self._defaults['WaitUntilSettled']['return'] = 0 + self._defaults['WriteArbWaveformComplexF32'] = {} + self._defaults['WriteArbWaveformComplexF32']['return'] = 0 + self._defaults['WriteArbWaveformComplexF64'] = {} + self._defaults['WriteArbWaveformComplexF64']['return'] = 0 + self._defaults['WriteArbWaveformComplexI16'] = {} + self._defaults['WriteArbWaveformComplexI16']['return'] = 0 self._defaults['WriteP2PEndpointI16'] = {} self._defaults['WriteP2PEndpointI16']['return'] = 0 self._defaults['WriteScript'] = {} self._defaults['WriteScript']['return'] = 0 - self._defaults['WriteWaveformComplexF32'] = {} - self._defaults['WriteWaveformComplexF32']['return'] = 0 - self._defaults['WriteWaveformComplexF64'] = {} - self._defaults['WriteWaveformComplexF64']['return'] = 0 - self._defaults['WriteWaveformComplexI16'] = {} - self._defaults['WriteWaveformComplexI16']['return'] = 0 self._defaults['close'] = {} self._defaults['close']['return'] = 0 @@ -855,31 +852,16 @@ def niRFSG_SetAttributeViString(self, vi, channel_name, attribute, value): # no def niRFSG_SetWaveformBurstStartLocations(self, vi, channel_name, number_of_locations, locations): # noqa: N802 if self._defaults['SetWaveformBurstStartLocations']['return'] != 0: return self._defaults['SetWaveformBurstStartLocations']['return'] - # locations - if self._defaults['SetWaveformBurstStartLocations']['locations'] is None: - raise MockFunctionCallError("niRFSG_SetWaveformBurstStartLocations", param='locations') - if locations is not None: - locations.contents.value = self._defaults['SetWaveformBurstStartLocations']['locations'] return self._defaults['SetWaveformBurstStartLocations']['return'] def niRFSG_SetWaveformBurstStopLocations(self, vi, channel_name, number_of_locations, locations): # noqa: N802 if self._defaults['SetWaveformBurstStopLocations']['return'] != 0: return self._defaults['SetWaveformBurstStopLocations']['return'] - # locations - if self._defaults['SetWaveformBurstStopLocations']['locations'] is None: - raise MockFunctionCallError("niRFSG_SetWaveformBurstStopLocations", param='locations') - if locations is not None: - locations.contents.value = self._defaults['SetWaveformBurstStopLocations']['locations'] return self._defaults['SetWaveformBurstStopLocations']['return'] def niRFSG_SetWaveformMarkerEventLocations(self, vi, channel_name, number_of_locations, locations): # noqa: N802 if self._defaults['SetWaveformMarkerEventLocations']['return'] != 0: return self._defaults['SetWaveformMarkerEventLocations']['return'] - # locations - if self._defaults['SetWaveformMarkerEventLocations']['locations'] is None: - raise MockFunctionCallError("niRFSG_SetWaveformMarkerEventLocations", param='locations') - if locations is not None: - locations.contents.value = self._defaults['SetWaveformMarkerEventLocations']['locations'] return self._defaults['SetWaveformMarkerEventLocations']['return'] def niRFSG_UnlockSession(self, vi, caller_has_lock): # noqa: N802 @@ -897,6 +879,21 @@ def niRFSG_WaitUntilSettled(self, vi, max_time_milliseconds): # noqa: N802 return self._defaults['WaitUntilSettled']['return'] return self._defaults['WaitUntilSettled']['return'] + def niRFSG_WriteArbWaveformComplexF32(self, vi, waveform_name, number_of_samples, waveform_data_array, more_data_pending): # noqa: N802 + if self._defaults['WriteArbWaveformComplexF32']['return'] != 0: + return self._defaults['WriteArbWaveformComplexF32']['return'] + return self._defaults['WriteArbWaveformComplexF32']['return'] + + def niRFSG_WriteArbWaveformComplexF64(self, vi, waveform_name, number_of_samples, waveform_data_array, more_data_pending): # noqa: N802 + if self._defaults['WriteArbWaveformComplexF64']['return'] != 0: + return self._defaults['WriteArbWaveformComplexF64']['return'] + return self._defaults['WriteArbWaveformComplexF64']['return'] + + def niRFSG_WriteArbWaveformComplexI16(self, vi, waveform_name, number_of_samples, waveform_data_array): # noqa: N802 + if self._defaults['WriteArbWaveformComplexI16']['return'] != 0: + return self._defaults['WriteArbWaveformComplexI16']['return'] + return self._defaults['WriteArbWaveformComplexI16']['return'] + def niRFSG_WriteP2PEndpointI16(self, vi, stream_endpoint, number_of_samples, endpoint_data): # noqa: N802 if self._defaults['WriteP2PEndpointI16']['return'] != 0: return self._defaults['WriteP2PEndpointI16']['return'] @@ -907,21 +904,6 @@ def niRFSG_WriteScript(self, vi, script): # noqa: N802 return self._defaults['WriteScript']['return'] return self._defaults['WriteScript']['return'] - def niRFSG_WriteWaveformComplexF32(self, vi, waveform_name, number_of_samples, waveform_data_array, more_data_pending): # noqa: N802 - if self._defaults['WriteWaveformComplexF32']['return'] != 0: - return self._defaults['WriteWaveformComplexF32']['return'] - return self._defaults['WriteWaveformComplexF32']['return'] - - def niRFSG_WriteWaveformComplexF64(self, vi, waveform_name, number_of_samples, waveform_data_array, more_data_pending): # noqa: N802 - if self._defaults['WriteWaveformComplexF64']['return'] != 0: - return self._defaults['WriteWaveformComplexF64']['return'] - return self._defaults['WriteWaveformComplexF64']['return'] - - def niRFSG_WriteWaveformComplexI16(self, vi, waveform_name, number_of_samples, waveform_data_array, more_data_pending): # noqa: N802 - if self._defaults['WriteWaveformComplexI16']['return'] != 0: - return self._defaults['WriteWaveformComplexI16']['return'] - return self._defaults['WriteWaveformComplexI16']['return'] - def niRFSG_close(self, vi): # noqa: N802 if self._defaults['close']['return'] != 0: return self._defaults['close']['return'] @@ -1101,15 +1083,15 @@ def set_side_effects_and_return_values(self, mock_library): mock_library.niRFSG_UnlockSession.return_value = 0 mock_library.niRFSG_WaitUntilSettled.side_effect = MockFunctionCallError("niRFSG_WaitUntilSettled") mock_library.niRFSG_WaitUntilSettled.return_value = 0 + mock_library.niRFSG_WriteArbWaveformComplexF32.side_effect = MockFunctionCallError("niRFSG_WriteArbWaveformComplexF32") + mock_library.niRFSG_WriteArbWaveformComplexF32.return_value = 0 + mock_library.niRFSG_WriteArbWaveformComplexF64.side_effect = MockFunctionCallError("niRFSG_WriteArbWaveformComplexF64") + mock_library.niRFSG_WriteArbWaveformComplexF64.return_value = 0 + mock_library.niRFSG_WriteArbWaveformComplexI16.side_effect = MockFunctionCallError("niRFSG_WriteArbWaveformComplexI16") + mock_library.niRFSG_WriteArbWaveformComplexI16.return_value = 0 mock_library.niRFSG_WriteP2PEndpointI16.side_effect = MockFunctionCallError("niRFSG_WriteP2PEndpointI16") mock_library.niRFSG_WriteP2PEndpointI16.return_value = 0 mock_library.niRFSG_WriteScript.side_effect = MockFunctionCallError("niRFSG_WriteScript") mock_library.niRFSG_WriteScript.return_value = 0 - mock_library.niRFSG_WriteWaveformComplexF32.side_effect = MockFunctionCallError("niRFSG_WriteWaveformComplexF32") - mock_library.niRFSG_WriteWaveformComplexF32.return_value = 0 - mock_library.niRFSG_WriteWaveformComplexF64.side_effect = MockFunctionCallError("niRFSG_WriteWaveformComplexF64") - mock_library.niRFSG_WriteWaveformComplexF64.return_value = 0 - mock_library.niRFSG_WriteWaveformComplexI16.side_effect = MockFunctionCallError("niRFSG_WriteWaveformComplexI16") - mock_library.niRFSG_WriteWaveformComplexI16.return_value = 0 mock_library.niRFSG_close.side_effect = MockFunctionCallError("niRFSG_close") mock_library.niRFSG_close.return_value = 0 diff --git a/src/nifake/metadata/functions.py b/src/nifake/metadata/functions.py index 8d1c2b83ad..4edb4fcbff 100644 --- a/src/nifake/metadata/functions.py +++ b/src/nifake/metadata/functions.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# This file is generated from NI-FAKE API metadata version 24.8.0f100 +# This file is generated from NI-FAKE API metadata version 25.5.0d9999 functions = { 'Abort': { 'codegen_method': 'public', @@ -377,167 +377,6 @@ 'repeated_capability_type': 'sites', 'returns': 'ViStatus' }, - 'WriteWaveformComplexF64': { - 'codegen_method': 'private', - 'documentation': { - 'description': 'A function that writes a waveform of complex128 numbers.' - }, - 'included_in_proto': False, - 'is_error_handling': False, - 'method_templates': [ - { - 'documentation_filename': 'numpy_method', - 'library_interpreter_filename': 'numpy_write_method', - 'method_python_name_suffix': '', - 'session_filename': 'numpy_write_method' - } - ], - 'parameters': [ - { - 'direction': 'in', - 'documentation': { - 'description': 'Identifies a particular instrument session.' - }, - 'name': 'vi', - 'type': 'ViSession' - }, - { - 'direction': 'in', - 'documentation': { - 'description': 'Specifies the number of samples in the message signal.' - }, - 'name': 'numberOfSamples', - 'type': 'ViInt32', - 'use_array': False, - 'use_in_python_api': False - }, - { - 'direction': 'in', - 'documentation': { - 'description': 'Specifies the array of data to load into the waveform. Array should be numberOfSamples big.' - }, - 'name': 'waveformDataArray', - 'numpy': True, - 'size': { - 'mechanism': 'len', - 'value': 'numberOfSamples' - }, - 'type': 'ComplexViReal64[]', - 'complex_type': 'numpy', - 'use_numpy_array': True, - 'use_in_python_api': True - }, - ], - 'returns': 'ViStatus' - }, - 'WriteWaveformComplexI16': { - 'codegen_method': 'private', - 'documentation': { - 'description': 'A function that writes a waveform of i16 numbers.' - }, - 'included_in_proto': False, - 'is_error_handling': False, - 'method_templates': [ - { - 'documentation_filename': 'numpy_method', - 'library_interpreter_filename': 'numpy_write_method', - 'method_python_name_suffix': '', - 'session_filename': 'numpy_write_method' - } - ], - 'parameters': [ - { - 'direction': 'in', - 'documentation': { - 'description': 'Identifies a particular instrument session.' - }, - 'name': 'vi', - 'type': 'ViSession' - }, - { - 'direction': 'in', - 'documentation': { - 'description': 'Specifies the number of samples in the message signal.' - }, - 'name': 'numberOfSamples', - 'type': 'ViInt32', - 'use_array': False, - 'use_in_python_api': False - }, - { - 'direction': 'in', - 'documentation': { - 'description': 'Specifies the array of data to load into the waveform. Array should be numberOfSamples big.' - }, - 'name': 'waveformDataArray', - 'numpy': True, - 'size': { - 'mechanism': 'len', - 'value': 'numberOfSamples' - }, - 'type': 'ComplexViInt16[]', - 'use_numpy_array': True, - 'complex_type': 'interleaved', - 'use_in_python_api': True - } - ], - 'returns': 'ViStatus', - }, - 'WriteWaveformComplexF32': { - 'codegen_method': 'private', - 'documentation': { - 'description': 'A function that writes a waveform of complex64 numbers.' - }, - 'included_in_proto': False, - 'is_error_handling': False, - 'method_templates': [ - { - 'documentation_filename': 'numpy_method', - 'library_interpreter_filename': 'numpy_write_method', - 'method_python_name_suffix': '', - 'session_filename': 'numpy_write_method' - } - ], - 'parameters': [ - { - 'direction': 'in', - 'documentation': { - 'description': 'Identifies a particular instrument session.' - }, - 'name': 'vi', - 'type': 'ViSession' - 'use_array': False, - 'use_in_python_api': True - }, - { - 'direction': 'in', - 'documentation': { - 'description': 'Specifies the number of samples in the message signal.' - }, - 'name': 'numberOfSamples', - 'type': 'ViInt32', - 'use_array': False, - 'use_in_python_api': False - }, - { - 'direction': 'in', - 'documentation': { - 'description': 'Specifies the array of data to load into the waveform. Array should be numberOfSamples big.' - }, - 'name': 'waveformDataArray', - 'numpy': True, - 'size': { - 'mechanism': 'len', - 'value': 'numberOfSamples' - }, - 'type': 'ComplexViReal32[]', - 'complex_type': 'numpy', - 'use_numpy_array': True, - 'use_in_python_api': True - } - ], - 'returns': 'ViStatus', - }, 'GetABoolean': { 'codegen_method': 'public', 'documentation': { @@ -2958,6 +2797,171 @@ ], 'returns': 'ViStatus' }, + 'WriteWaveformComplexF32': { + 'codegen_method': 'private', + 'documentation': { + 'description': 'A function that writes a waveform of complex64 numbers.' + }, + 'included_in_proto': False, + 'is_error_handling': False, + 'method_templates': [ + { + 'documentation_filename': 'numpy_method', + 'library_interpreter_filename': 'numpy_write_method', + 'method_python_name_suffix': '', + 'session_filename': 'numpy_write_method' + } + ], + 'parameters': [ + { + 'direction': 'in', + 'documentation': { + 'description': 'Identifies a particular instrument session.' + }, + 'name': 'vi', + 'type': 'ViSession', + 'use_array': False, + 'use_in_python_api': True + }, + { + 'direction': 'in', + 'documentation': { + 'description': 'Specifies the number of samples in the message signal.' + }, + 'name': 'numberOfSamples', + 'type': 'ViInt32', + 'use_array': False, + 'use_in_python_api': False + }, + { + 'complex_type': 'numpy', + 'direction': 'in', + 'documentation': { + 'description': 'Specifies the array of data to load into the waveform. Array should be numberOfSamples big.' + }, + 'name': 'waveformDataArray', + 'numpy': True, + 'size': { + 'mechanism': 'len', + 'value': 'numberOfSamples' + }, + 'type': 'ComplexViReal32[]', + 'use_in_python_api': True, + 'use_numpy_array': True + } + ], + 'returns': 'ViStatus' + }, + 'WriteWaveformComplexF64': { + 'codegen_method': 'private', + 'documentation': { + 'description': 'A function that writes a waveform of complex128 numbers' + }, + 'included_in_proto': False, + 'is_error_handling': False, + 'method_templates': [ + { + 'documentation_filename': 'numpy_method', + 'library_interpreter_filename': 'numpy_write_method', + 'method_python_name_suffix': '', + 'session_filename': 'numpy_write_method' + } + ], + 'parameters': [ + { + 'direction': 'in', + 'documentation': { + 'description': 'Identifies a particular instrument session.' + }, + 'name': 'vi', + 'type': 'ViSession', + 'use_array': False, + 'use_in_python_api': True + }, + { + 'direction': 'in', + 'documentation': { + 'description': 'Specifies the number of samples in the message signal.' + }, + 'name': 'numberOfSamples', + 'type': 'ViInt32', + 'use_array': False, + 'use_in_python_api': False + }, + { + 'complex_type': 'numpy', + 'direction': 'in', + 'documentation': { + 'description': 'Specifies the array of data to load into the waveform. Array should be numberOfSamples big.' + }, + 'name': 'waveformDataArray', + 'numpy': True, + 'size': { + 'mechanism': 'len', + 'value': 'numberOfSamples' + }, + 'type': 'ComplexViReal64[]', + 'use_in_python_api': True, + 'use_numpy_array': True + } + ], + 'returns': 'ViStatus' + }, + 'WriteWaveformComplexI16': { + 'codegen_method': 'private', + 'documentation': { + 'description': 'A function that writes a waveform of i16 numbers.' + }, + 'included_in_proto': False, + 'is_error_handling': False, + 'method_templates': [ + { + 'documentation_filename': 'numpy_method', + 'library_interpreter_filename': 'numpy_write_method', + 'method_python_name_suffix': '', + 'session_filename': 'numpy_write_method' + } + ], + 'parameters': [ + { + 'direction': 'in', + 'documentation': { + 'description': 'Identifies a particular instrument session.' + }, + 'name': 'vi', + 'type': 'ViSession', + 'use_array': False, + 'use_in_python_api': True + }, + { + 'direction': 'in', + 'documentation': { + 'description': 'Specifies the number of samples in the message signal.' + }, + 'name': 'numberOfSamples', + 'type': 'ViInt32', + 'use_array': False, + 'use_in_python_api': False + }, + { + 'complex_type': 'interleaved', + 'direction': 'in', + 'documentation': { + 'description': 'Specifies the array of data to load into the waveform. Array should be numberOfSamples big.' + }, + 'name': 'waveformDataArray', + 'numpy': True, + 'size': { + 'mechanism': 'len', + 'value': 'numberOfSamples' + }, + 'type': 'ComplexViInt16[]', + 'use_in_python_api': True, + 'use_numpy_array': True + } + ], + 'returns': 'ViStatus' + }, 'close': { 'codegen_method': 'private', 'documentation': { diff --git a/src/nirfsg/metadata/functions.py b/src/nirfsg/metadata/functions.py index 189702c295..9fc03c560e 100644 --- a/src/nirfsg/metadata/functions.py +++ b/src/nirfsg/metadata/functions.py @@ -29,7 +29,7 @@ } ], 'returns': 'ViStatus', - 'use_session_lock': False + 'use_session_lock': True }, 'AllocateArbWaveform': { 'codegen_method': 'public', @@ -79,7 +79,7 @@ } ], 'returns': 'ViStatus', - 'use_session_lock': False + 'use_session_lock': True }, 'ChangeExternalCalibrationPassword': { 'codegen_method': 'public', @@ -129,7 +129,7 @@ } ], 'returns': 'ViStatus', - 'use_session_lock': False + 'use_session_lock': True }, 'CheckAttributeViBoolean': { 'codegen_method': 'public', @@ -190,7 +190,7 @@ } ], 'returns': 'ViStatus', - 'use_session_lock': False + 'use_session_lock': True }, 'CheckAttributeViInt32': { 'codegen_method': 'public', @@ -252,7 +252,7 @@ } ], 'returns': 'ViStatus', - 'use_session_lock': False + 'use_session_lock': True }, 'CheckAttributeViInt64': { 'codegen_method': 'public', @@ -314,7 +314,7 @@ } ], 'returns': 'ViStatus', - 'use_session_lock': False + 'use_session_lock': True }, 'CheckAttributeViReal64': { 'codegen_method': 'public', @@ -376,7 +376,7 @@ } ], 'returns': 'ViStatus', - 'use_session_lock': False + 'use_session_lock': True }, 'CheckAttributeViSession': { 'codegen_method': 'public', @@ -437,7 +437,7 @@ } ], 'returns': 'ViStatus', - 'use_session_lock': False + 'use_session_lock': True }, 'CheckAttributeViString': { 'codegen_method': 'public', @@ -499,7 +499,7 @@ } ], 'returns': 'ViStatus', - 'use_session_lock': False + 'use_session_lock': True }, 'CheckGenerationStatus': { 'codegen_method': 'public', @@ -553,7 +553,7 @@ } ], 'returns': 'ViStatus', - 'use_session_lock': False + 'use_session_lock': True }, 'CheckIfScriptExists': { 'codegen_method': 'public', @@ -617,7 +617,7 @@ } ], 'returns': 'ViStatus', - 'use_session_lock': False + 'use_session_lock': True }, 'CheckIfWaveformExists': { 'codegen_method': 'public', @@ -681,7 +681,7 @@ } ], 'returns': 'ViStatus', - 'use_session_lock': False + 'use_session_lock': True }, 'ClearAllArbWaveforms': { 'codegen_method': 'public', @@ -711,7 +711,7 @@ } ], 'returns': 'ViStatus', - 'use_session_lock': False + 'use_session_lock': True }, 'ClearArbWaveform': { 'codegen_method': 'public', @@ -751,7 +751,7 @@ } ], 'returns': 'ViStatus', - 'use_session_lock': False + 'use_session_lock': True }, 'ClearError': { 'codegen_method': 'public', @@ -782,7 +782,7 @@ } ], 'returns': 'ViStatus', - 'use_session_lock': False + 'use_session_lock': True }, 'ClearSelfCalibrateRange': { 'codegen_method': 'public', @@ -812,7 +812,7 @@ } ], 'returns': 'ViStatus', - 'use_session_lock': False + 'use_session_lock': True }, 'Commit': { 'codegen_method': 'public', @@ -842,7 +842,7 @@ } ], 'returns': 'ViStatus', - 'use_session_lock': False + 'use_session_lock': True }, 'ConfigureDeembeddingTableInterpolationLinear': { 'codegen_method': 'public', @@ -925,7 +925,7 @@ } ], 'returns': 'ViStatus', - 'use_session_lock': False + 'use_session_lock': True }, 'ConfigureDeembeddingTableInterpolationNearest': { 'codegen_method': 'public', @@ -975,7 +975,7 @@ } ], 'returns': 'ViStatus', - 'use_session_lock': False + 'use_session_lock': True }, 'ConfigureDeembeddingTableInterpolationSpline': { 'codegen_method': 'public', @@ -1025,7 +1025,7 @@ } ], 'returns': 'ViStatus', - 'use_session_lock': False + 'use_session_lock': True }, 'ConfigureDigitalEdgeScriptTrigger': { 'codegen_method': 'public', @@ -1085,7 +1085,7 @@ } ], 'returns': 'ViStatus', - 'use_session_lock': False + 'use_session_lock': True }, 'ConfigureDigitalEdgeStartTrigger': { 'codegen_method': 'public', @@ -1136,7 +1136,7 @@ } ], 'returns': 'ViStatus', - 'use_session_lock': False + 'use_session_lock': True }, 'ConfigureDigitalLevelScriptTrigger': { 'codegen_method': 'public', @@ -1196,7 +1196,7 @@ } ], 'returns': 'ViStatus', - 'use_session_lock': False + 'use_session_lock': True }, 'ConfigureDigitalModulationUserDefinedWaveform': { 'codegen_method': 'public', @@ -1250,7 +1250,7 @@ } ], 'returns': 'ViStatus', - 'use_session_lock': False + 'use_session_lock': True }, 'ConfigureGenerationMode': { 'codegen_method': 'public', @@ -1314,7 +1314,7 @@ } ], 'returns': 'ViStatus', - 'use_session_lock': False + 'use_session_lock': True }, 'ConfigureOutputEnabled': { 'codegen_method': 'public', @@ -1354,7 +1354,7 @@ } ], 'returns': 'ViStatus', - 'use_session_lock': False + 'use_session_lock': True }, 'ConfigureP2PEndpointFullnessStartTrigger': { 'codegen_method': 'public', @@ -1395,7 +1395,7 @@ } ], 'returns': 'ViStatus', - 'use_session_lock': False + 'use_session_lock': True }, 'ConfigurePowerLevelType': { 'codegen_method': 'public', @@ -1452,7 +1452,7 @@ } ], 'returns': 'ViStatus', - 'use_session_lock': False + 'use_session_lock': True }, 'ConfigurePxiChassisClk10': { 'codegen_method': 'public', @@ -1492,7 +1492,7 @@ } ], 'returns': 'ViStatus', - 'use_session_lock': False + 'use_session_lock': True }, 'ConfigureRF': { 'codegen_method': 'public', @@ -1542,7 +1542,7 @@ } ], 'returns': 'ViStatus', - 'use_session_lock': False + 'use_session_lock': True }, 'ConfigureRefClock': { 'codegen_method': 'public', @@ -1629,7 +1629,7 @@ } ], 'returns': 'ViStatus', - 'use_session_lock': False + 'use_session_lock': True }, 'ConfigureSignalBandwidth': { 'codegen_method': 'public', @@ -1670,7 +1670,7 @@ } ], 'returns': 'ViStatus', - 'use_session_lock': False + 'use_session_lock': True }, 'ConfigureSoftwareScriptTrigger': { 'codegen_method': 'public', @@ -1710,7 +1710,7 @@ } ], 'returns': 'ViStatus', - 'use_session_lock': False + 'use_session_lock': True }, 'ConfigureSoftwareStartTrigger': { 'codegen_method': 'public', @@ -1740,7 +1740,7 @@ } ], 'returns': 'ViStatus', - 'use_session_lock': False + 'use_session_lock': True }, 'CreateDeembeddingSparameterTableS2PFile': { 'codegen_method': 'public', @@ -1828,7 +1828,7 @@ } ], 'returns': 'ViStatus', - 'use_session_lock': False + 'use_session_lock': True }, 'DeleteAllDeembeddingTables': { 'codegen_method': 'public', @@ -1858,7 +1858,7 @@ } ], 'returns': 'ViStatus', - 'use_session_lock': False + 'use_session_lock': True }, 'DeleteDeembeddingTable': { 'codegen_method': 'public', @@ -1908,7 +1908,7 @@ } ], 'returns': 'ViStatus', - 'use_session_lock': False + 'use_session_lock': True }, 'Disable': { 'codegen_method': 'public', @@ -1938,7 +1938,7 @@ } ], 'returns': 'ViStatus', - 'use_session_lock': False + 'use_session_lock': True }, 'DisableScriptTrigger': { 'codegen_method': 'public', @@ -1978,7 +1978,7 @@ } ], 'returns': 'ViStatus', - 'use_session_lock': False + 'use_session_lock': True }, 'DisableStartTrigger': { 'codegen_method': 'public', @@ -2008,7 +2008,7 @@ } ], 'returns': 'ViStatus', - 'use_session_lock': False + 'use_session_lock': True }, 'ExportSignal': { 'codegen_method': 'public', @@ -2196,7 +2196,7 @@ } ], 'returns': 'ViStatus', - 'use_session_lock': False + 'use_session_lock': True }, 'GetAttributeViBoolean': { 'codegen_method': 'private', @@ -2256,7 +2256,7 @@ } ], 'returns': 'ViStatus', - 'use_session_lock': False + 'use_session_lock': True }, 'GetAttributeViInt32': { 'codegen_method': 'private', @@ -2316,7 +2316,7 @@ } ], 'returns': 'ViStatus', - 'use_session_lock': False + 'use_session_lock': True }, 'GetAttributeViInt64': { 'codegen_method': 'private', @@ -2376,7 +2376,7 @@ } ], 'returns': 'ViStatus', - 'use_session_lock': False + 'use_session_lock': True }, 'GetAttributeViReal64': { 'codegen_method': 'private', @@ -2436,7 +2436,7 @@ } ], 'returns': 'ViStatus', - 'use_session_lock': False + 'use_session_lock': True }, 'GetAttributeViSession': { 'codegen_method': 'private', @@ -2496,7 +2496,7 @@ } ], 'returns': 'ViStatus', - 'use_session_lock': False + 'use_session_lock': True }, 'GetAttributeViString': { 'codegen_method': 'private', @@ -2570,7 +2570,7 @@ } ], 'returns': 'ViStatus', - 'use_session_lock': False + 'use_session_lock': True }, 'GetError': { 'codegen_method': 'public', @@ -2727,7 +2727,7 @@ } ], 'returns': 'ViStatus', - 'use_session_lock': False + 'use_session_lock': True }, 'GetLastExtCalLastDateAndTime': { 'codegen_method': 'python-only', @@ -2758,7 +2758,7 @@ 'python_name': 'get_external_calibration_last_date_and_time', 'real_datetime_call': 'GetExternalCalibrationLastDateAndTime', 'returns': 'ViStatus', - 'use_session_lock': False + 'use_session_lock': True }, 'GetLastSelfCalLastDateAndTime': { 'codegen_method': 'python-only', @@ -2789,7 +2789,7 @@ 'python_name': 'get_self_calibration_last_date_and_time', 'real_datetime_call': 'GetSelfCalibrationDateAndTime', 'returns': 'ViStatus', - 'use_session_lock': False + 'use_session_lock': True }, 'GetMaxSettablePower': { 'codegen_method': 'public', @@ -2829,7 +2829,7 @@ } ], 'returns': 'ViStatus', - 'use_session_lock': False + 'use_session_lock': True }, 'GetSelfCalibrationDateAndTime': { 'codegen_method': 'private', @@ -2930,7 +2930,7 @@ } ], 'returns': 'ViStatus', - 'use_session_lock': False + 'use_session_lock': True }, 'GetSelfCalibrationTemperature': { 'codegen_method': 'public', @@ -3003,7 +3003,7 @@ } ], 'returns': 'ViStatus', - 'use_session_lock': False + 'use_session_lock': True }, 'GetStreamEndpointHandle': { 'codegen_method': 'public', @@ -3053,7 +3053,7 @@ } ], 'returns': 'ViStatus', - 'use_session_lock': False + 'use_session_lock': True }, 'GetWaveformBurstStartLocations': { 'codegen_method': 'private', @@ -3123,7 +3123,7 @@ } ], 'returns': 'ViStatus', - 'use_session_lock': False + 'use_session_lock': True }, 'GetWaveformBurstStopLocations': { 'codegen_method': 'private', @@ -3193,7 +3193,7 @@ } ], 'returns': 'ViStatus', - 'use_session_lock': False + 'use_session_lock': True }, 'GetWaveformMarkerEventLocations': { 'codegen_method': 'private', @@ -3263,7 +3263,7 @@ } ], 'returns': 'ViStatus', - 'use_session_lock': False + 'use_session_lock': True }, 'InitWithOptions': { 'codegen_method': 'private', @@ -3295,6 +3295,7 @@ 'use_in_python_api': True }, { + 'default_value': False, 'direction': 'in', 'documentation': { 'description': ' Specifies whether you want NI-RFSG to perform an ID query.\n\n **Defined Values** :\n ', @@ -3319,6 +3320,7 @@ 'use_in_python_api': True }, { + 'default_value': False, 'direction': 'in', 'documentation': { 'description': ' Specifies whether you want to reset the NI-RFSG device during the initialization procedure.\n\n **Defined Values** :\n\n ', @@ -3412,7 +3414,7 @@ } ], 'returns': 'ViStatus', - 'use_session_lock': False + 'use_session_lock': True }, 'LoadConfigurationsFromFile': { 'codegen_method': 'public', @@ -3462,7 +3464,7 @@ } ], 'returns': 'ViStatus', - 'use_session_lock': False + 'use_session_lock': True }, 'LockSession': { 'codegen_method': 'public', @@ -3535,7 +3537,7 @@ } ], 'returns': 'ViStatus', - 'use_session_lock': False + 'use_session_lock': True }, 'PerformThermalCorrection': { 'codegen_method': 'public', @@ -3565,7 +3567,7 @@ } ], 'returns': 'ViStatus', - 'use_session_lock': False + 'use_session_lock': True }, 'QueryArbWaveformCapabilities': { 'codegen_method': 'public', @@ -3635,7 +3637,7 @@ } ], 'returns': 'ViStatus', - 'use_session_lock': False + 'use_session_lock': True }, 'ReadAndDownloadWaveformFromFileTDMS': { 'codegen_method': 'public', @@ -3695,7 +3697,7 @@ } ], 'returns': 'ViStatus', - 'use_session_lock': False + 'use_session_lock': True }, 'Reset': { 'codegen_method': 'public', @@ -3726,7 +3728,7 @@ } ], 'returns': 'ViStatus', - 'use_session_lock': False + 'use_session_lock': True }, 'ResetAttribute': { 'codegen_method': 'public', @@ -3776,7 +3778,7 @@ } ], 'returns': 'ViStatus', - 'use_session_lock': False + 'use_session_lock': True }, 'ResetDevice': { 'codegen_method': 'public', @@ -3807,7 +3809,7 @@ } ], 'returns': 'ViStatus', - 'use_session_lock': False + 'use_session_lock': True }, 'ResetWithDefaults': { 'codegen_method': 'public', @@ -3837,7 +3839,7 @@ } ], 'returns': 'ViStatus', - 'use_session_lock': False + 'use_session_lock': True }, 'SaveConfigurationsToFile': { 'codegen_method': 'public', @@ -3887,7 +3889,7 @@ } ], 'returns': 'ViStatus', - 'use_session_lock': False + 'use_session_lock': True }, 'SelectArbWaveform': { 'codegen_method': 'public', @@ -3927,7 +3929,7 @@ } ], 'returns': 'ViStatus', - 'use_session_lock': False + 'use_session_lock': True }, 'SelfCal': { 'codegen_method': 'public', @@ -3958,7 +3960,7 @@ } ], 'returns': 'ViStatus', - 'use_session_lock': False + 'use_session_lock': True }, 'SelfCalibrateRange': { 'codegen_method': 'public', @@ -4077,7 +4079,7 @@ } ], 'returns': 'ViStatus', - 'use_session_lock': False + 'use_session_lock': True }, 'SelfTest': { 'codegen_method': 'public', @@ -4130,7 +4132,7 @@ } ], 'returns': 'ViStatus', - 'use_session_lock': False + 'use_session_lock': True }, 'SendSoftwareEdgeTrigger': { 'codegen_method': 'public', @@ -4232,7 +4234,7 @@ ], 'render_in_session_base': True, 'returns': 'ViStatus', - 'use_session_lock': False + 'use_session_lock': True }, 'SetArbWaveformNextWritePosition': { 'codegen_method': 'public', @@ -4311,7 +4313,7 @@ } ], 'returns': 'ViStatus', - 'use_session_lock': False + 'use_session_lock': True }, 'SetAttributeViBoolean': { 'codegen_method': 'private', @@ -4372,7 +4374,7 @@ } ], 'returns': 'ViStatus', - 'use_session_lock': False + 'use_session_lock': True }, 'SetAttributeViInt32': { 'codegen_method': 'private', @@ -4434,7 +4436,7 @@ } ], 'returns': 'ViStatus', - 'use_session_lock': False + 'use_session_lock': True }, 'SetAttributeViInt64': { 'codegen_method': 'private', @@ -4495,7 +4497,7 @@ } ], 'returns': 'ViStatus', - 'use_session_lock': False + 'use_session_lock': True }, 'SetAttributeViReal64': { 'codegen_method': 'private', @@ -4557,7 +4559,7 @@ } ], 'returns': 'ViStatus', - 'use_session_lock': False + 'use_session_lock': True }, 'SetAttributeViSession': { 'codegen_method': 'private', @@ -4618,7 +4620,7 @@ } ], 'returns': 'ViStatus', - 'use_session_lock': False + 'use_session_lock': True }, 'SetAttributeViString': { 'codegen_method': 'private', @@ -4680,7 +4682,7 @@ } ], 'returns': 'ViStatus', - 'use_session_lock': False + 'use_session_lock': True }, 'SetWaveformBurstStartLocations': { 'codegen_method': 'private', @@ -4729,7 +4731,7 @@ 'use_in_python_api': True }, { - 'direction': 'out', + 'direction': 'in', 'documentation': { 'description': 'Returns the burst start locations stored in the NI-RFSG session for the waveform that you specified in the **NIRFSG_ATTR_CHANNEL_NAME** parameter. This value is expressed in samples.' }, @@ -4740,7 +4742,7 @@ } ], 'returns': 'ViStatus', - 'use_session_lock': False + 'use_session_lock': True }, 'SetWaveformBurstStopLocations': { 'codegen_method': 'private', @@ -4789,7 +4791,7 @@ 'use_in_python_api': True }, { - 'direction': 'out', + 'direction': 'in', 'documentation': { 'description': 'Specifies the burst stop locations, in samples, to store in the NI-RFSG session.' }, @@ -4800,7 +4802,7 @@ } ], 'returns': 'ViStatus', - 'use_session_lock': False + 'use_session_lock': True }, 'SetWaveformMarkerEventLocations': { 'codegen_method': 'private', @@ -4849,7 +4851,7 @@ 'use_in_python_api': True }, { - 'direction': 'out', + 'direction': 'in', 'documentation': { 'description': 'Specifies the marker location, in samples, to store in the NI-RFSG database.' }, @@ -4860,7 +4862,7 @@ } ], 'returns': 'ViStatus', - 'use_session_lock': False + 'use_session_lock': True }, 'UnlockSession': { 'codegen_method': 'public', @@ -4942,20 +4944,23 @@ } ], 'returns': 'ViStatus', - 'use_session_lock': False + 'use_session_lock': True }, - 'WriteWaveformDispatcher': { - 'codegen_method': 'python-only', + 'WriteArbWaveformComplexF32': { + 'codegen_method': 'private', 'documentation': { - 'description': ' \n Writes an arbitrary waveform to the NI-RFSG device starting at the position of the last data written in onboard memory. \n \n This function accepts the complex baseband data in the form of numpy array of numpy.complex64 or numpy.complex128 or interleaved numpy array of numpy.int16. If the waveform to write is already allocated using the nirfsg_AllocateArbWaveform function, the **NIRFSG_ATTR_MORE_DATA_PENDING** parameter is ignored. The PXI-5670/5671 must be in the Configuration state before you call this function. When streaming is enabled, you can call this function when the PXIe-5672/5673/5673E or PXIe-5820/5830/5831/5832/5840/5841/5842/5860 is in the Generation state.\n ----\n **Supported Devices** : PXIe-5644/5645/5646, PXI-5670/5671, PXIe-5672/5673/5673E, PXIe-5820/5830/5831/5832/5840/5841/5842/5860\n\n **Related Topics**\n\n `Streaming `_\n\n `Assigning Properties or Attributes to a Waveform `_\n ' + 'description': ' \n Writes an arbitrary waveform to the NI-RFSG device starting at the position of the last data written in onboard memory. \n \n This function accepts the complex baseband data in the form of complex singles. If the waveform to write is already allocated using the nirfsg_AllocateArbWaveform function, the **NIRFSG_ATTR_MORE_DATA_PENDING** parameter is ignored. The PXI-5670/5671 must be in the Configuration state before you call this function. When streaming is enabled, you can call this function when the PXIe-5672/5673/5673E or PXIe-5820/5830/5831/5832/5840/5841/5842/5860 is in the Generation state.\n\n **Supported Devices** : PXIe-5644/5645/5646, PXI-5670/5671, PXIe-5672/5673/5673E, PXIe-5820/5830/5831/5832/5840/5841/5842/5860\n\n **Related Topics**\n\n `Streaming `_\n\n `Assigning Properties or Attributes to a Waveform `_\n ', + 'note': 'On the PXIe-5644/5645/5646, PXIe-5672/5673/5673E, and PXIe-5820/5830/5831/5832/5840/5841/5842/5860, the **NIRFSG_ATTR_MORE_DATA_PENDING** parameter is always ignored. To write data in blocks on these devices, you must allocate the waveform before writing it.' }, 'included_in_proto': False, + 'is_error_handling': False, + 'method_name_for_documentation': 'write_arb_waveform', 'method_templates': [ { - 'documentation_filename': 'default_method', - 'library_interpreter_filename': 'none', + 'documentation_filename': 'numpy_method', + 'library_interpreter_filename': 'numpy_write_method', 'method_python_name_suffix': '', - 'session_filename': 'write_arb_waveform' + 'session_filename': 'numpy_write_method' } ], 'parameters': [ @@ -4982,7 +4987,7 @@ { 'direction': 'in', 'documentation': { - 'description': 'Specifies the number of samples in the message signal.' + 'description': 'Specifies the number of samples in both of the data arrays.' }, 'name': 'numberOfSamples', 'type': 'ViInt32', @@ -4990,23 +4995,25 @@ 'use_in_python_api': False }, { + 'complex_type': 'numpy', 'direction': 'in', 'documentation': { 'description': 'Specifies the array of data to load into the waveform. The array must have at least as many elements as the value in the **size_in_samples** parameter in the nirfsg_AllocateArbWaveform function.' }, 'name': 'waveformDataArray', + 'numpy': True, 'size': { 'mechanism': 'len', 'value': 'numberOfSamples' }, - 'type': 'ComplexViReal64[]', - 'use_in_python_api': True + 'type': 'ComplexViReal32[]', + 'use_in_python_api': True, + 'use_numpy_array': True }, { - 'direction': 'in', 'direction': 'in', 'documentation': { - 'description': 'Specifies whether or not the data block contains the end of the waveform. Set this parameter to VI_TRUE to allow data to be appended later to the waveform. Splitting the waveform into multiple data blocks can reduce the memory requirements of the write operation. Append data to a previously written waveform by using the same waveform in the **name** parameter. Set **NIRFSG_ATTR_MORE_DATA_PENDING** to VI_FALSE to indicate that this data block contains the end of the waveform. If the waveform is already allocated, this parameter is ignored.' + 'description': 'Specifies whether or not the data block contains the end of the waveform. Set this parameter to VI_TRUE to allow data to be appended later to the waveform. Splitting the waveform into multiple data blocks can reduce the memory requirements of the write operation. Append data to a previously written waveform by using the same waveform in the NIRFSG_ATTR_WAVEFORM_NAME parameter. Set **NIRFSG_ATTR_MORE_DATA_PENDING** to VI_FALSE to indicate that this data block contains the end of the waveform. If the waveform is already allocated, this parameter is ignored.' }, 'name': 'moreDataPending', 'type': 'ViBoolean', @@ -5014,16 +5021,18 @@ 'use_in_python_api': True } ], - 'python_name': 'write_arb_waveform', - 'returns': 'ViStatus' + 'returns': 'ViStatus', + 'use_session_lock': True }, - 'WriteWaveformComplexF64': { + 'WriteArbWaveformComplexF64': { 'codegen_method': 'private', 'documentation': { - 'description': ' \n Writes an arbitrary waveform to the NI-RFSG device starting at the position of the last data written in onboard memory. \n \n This function accepts the complex baseband data in the form of complex doubles. If the waveform to write is already allocated using the %function{allocate arb waveform}, the moreDataPending parameter is ignored. The PXI-5670/5671 must be in the Configuration state before you call this function. When streaming is enabled, you can call this function when the PXIe-5672/5673/5673E or PXIe-5820/5830/5831/5832/5840/5841/5842 is in the Generation state.\n ----\n **Note**\n On the PXIe-5644/5645/5646, PXIe-5672/5673/5673E, and PXIe-5820/5830/5831/5832/5840/5841/5842, the moreDataPending parameter is always ignored. To write data in blocks on these devices, you must allocate the waveform before writing it.\n ----\n\n **Supported Devices**: PXIe-5644/5645/5646, PXI-5670/5671, PXIe-5672/5673/5673E, PXIe-5820/5830/5831/5832/5840/5841/5842\n\n **Related Topics**\n\n [Streaming](https://www.ni.com/docs/en-US/bundle/ni-rfsg/page/streaming.html)\n\n [Assigning Properties or Attributes to a Waveform](https://www.ni.com/docs/en-US/bundle/ni-rfsg/page/assigning-properties-or-attributes-to-a-wavef.html)\n ' + 'description': ' \n Writes an arbitrary waveform to the NI-RFSG device starting at the position of the last data written in onboard memory. \n \n This function accepts the complex baseband data in the form of complex doubles. If the waveform to write is already allocated using the nirfsg_AllocateArbWaveform, the moreDataPending parameter is ignored. The PXI-5670/5671 must be in the Configuration state before you call this function. When streaming is enabled, you can call this function when the PXIe-5672/5673/5673E or PXIe-5820/5830/5831/5832/5840/5841/5842 is in the Generation state.\n\n **Supported Devices** : PXIe-5644/5645/5646, PXI-5670/5671, PXIe-5672/5673/5673E, PXIe-5820/5830/5831/5832/5840/5841/5842\n\n **Related Topics**\n\n `Streaming `_\n\n `Assigning Properties or Attributes to a Waveform `_\n ', + 'note': 'On the PXIe-5644/5645/5646, PXIe-5672/5673/5673E, and PXIe-5820/5830/5831/5832/5840/5841/5842, the moreDataPending parameter is always ignored. To write data in blocks on these devices, you must allocate the waveform before writing it.' }, 'included_in_proto': False, 'is_error_handling': False, + 'method_name_for_documentation': 'write_arb_waveform', 'method_templates': [ { 'documentation_filename': 'numpy_method', @@ -5032,7 +5041,6 @@ 'session_filename': 'numpy_write_method' } ], - 'method_name_for_documentation': 'write_arb_waveform', 'parameters': [ { 'direction': 'in', @@ -5045,7 +5053,6 @@ 'use_in_python_api': True }, { - 'direction': 'in', 'direction': 'in', 'documentation': { 'description': 'Specifies the name used to identify the waveform. This string is case-insensitive and alphanumeric, and it does not use reserved words.' @@ -5058,7 +5065,7 @@ { 'direction': 'in', 'documentation': { - 'description': 'Specifies the number of samples in the message signal.' + 'description': 'Specifies the number of samples in the data array.' }, 'name': 'numberOfSamples', 'type': 'ViInt32', @@ -5066,6 +5073,7 @@ 'use_in_python_api': False }, { + 'complex_type': 'numpy', 'direction': 'in', 'documentation': { 'description': 'Specifies the array of data to load into the waveform. The array must have at least as many elements as the value in the **size_in_samples** parameter in the nirfsg_AllocateArbWaveform function.' @@ -5077,9 +5085,8 @@ 'value': 'numberOfSamples' }, 'type': 'ComplexViReal64[]', - 'complex_type': 'numpy', - 'use_numpy_array': True, - 'use_in_python_api': True + 'use_in_python_api': True, + 'use_numpy_array': True }, { 'direction': 'in', @@ -5095,13 +5102,15 @@ 'returns': 'ViStatus', 'use_session_lock': True }, - 'WriteWaveformComplexI16': { + 'WriteArbWaveformComplexI16': { 'codegen_method': 'private', 'documentation': { - 'description': ' \n Writes an arbitrary waveform to the NI-RFSG device starting at the position of the last data written in onboard memory. \n \n This function accepts the interleaved I/Q data of a complex baseband signal. The PXI-5670/5671 must be in the Configuration state before you call this function. When streaming is enabled, this function can be called when the PXIe-5672/5673/5673E or PXIe-5820/5830/5831/5832/5840/5841/5842/5860 is in the Generation state.\n ----\n **Note**\n This function only supports %enum_value{power level type.peak power} mode as specified in the %attribute{power level type} attribute. If you download a waveform when using this function, you cannot set the %attribute{power level type} to %enum_value{power level type.average power} without causing error in the output.\n ----\n\n\n **Supported Devices**: PXIe-5644/5645/5646, PXIe-5672/5673/5673E, PXIe-5820/5830/5831/5832/5840/5841/5842/5860\n\n **Related Topics**\n\n [Streaming](https://www.ni.com/docs/en-US/bundle/ni-rfsg/page/streaming.html)\n\n [Assigning Properties or Attributes to a Waveform](https://www.ni.com/docs/en-US/bundle/ni-rfsg/page/assigning-properties-or-attributes-to-a-wavef.html)\n ' + 'description': ' \n Writes an arbitrary waveform to the NI-RFSG device starting at the position of the last data written in onboard memory. \n \n This function accepts the interleaved I/Q data of a complex baseband signal. The PXI-5670/5671 must be in the Configuration state before you call this function. When streaming is enabled, this function can be called when the PXIe-5672/5673/5673E or PXIe-5820/5830/5831/5832/5840/5841/5842/5860 is in the Generation state.\n\n **Supported Devices** : PXIe-5644/5645/5646, PXIe-5672/5673/5673E, PXIe-5820/5830/5831/5832/5840/5841/5842/5860\n\n **Related Topics**\n\n `Streaming `_\n\n `Assigning Properties or Attributes to a Waveform `_\n ', + 'note': 'This function only supports NIRFSG_VAL_PEAK_POWER mode as specified in the NIRFSG_ATTR_POWER_LEVEL_TYPE attribute. If you download a waveform when using this function, you cannot set the NIRFSG_ATTR_POWER_LEVEL_TYPE to NIRFSG_VAL_AVERAGE_POWER without causing error in the output.' }, 'included_in_proto': False, 'is_error_handling': False, + 'method_name_for_documentation': 'write_arb_waveform', 'method_templates': [ { 'documentation_filename': 'numpy_method', @@ -5110,7 +5119,6 @@ 'session_filename': 'numpy_write_method' } ], - 'method_name_for_documentation': 'write_arb_waveform', 'parameters': [ { 'direction': 'in', @@ -5135,7 +5143,7 @@ { 'direction': 'in', 'documentation': { - 'description': 'Specifies the number of samples in the message signal.' + 'description': 'Specifies the number of samples in the data array.' }, 'name': 'numberOfSamples', 'type': 'ViInt32', @@ -5143,6 +5151,7 @@ 'use_in_python_api': False }, { + 'complex_type': 'interleaved', 'direction': 'in', 'documentation': { 'description': 'Specifies the array of data to load into the waveform. The array must have at least as many elements as the value in the **size_in_samples** parameter in the nirfsg_AllocateArbWaveform function.' @@ -5154,40 +5163,28 @@ 'value': 'numberOfSamples' }, 'type': 'ComplexViInt16[]', - 'use_numpy_array': True, - 'complex_type': 'interleaved', - 'use_in_python_api': True - }, - { - 'direction': 'in', - 'documentation': { - 'description': 'Specifies whether or not the data block contains the end of the waveform. Set this parameter to VI_TRUE to allow data to be appended later to the waveform. Splitting the waveform into multiple data blocks can reduce the memory requirements of the write operation. Append data to a previously written waveform by using the same waveform in the **name** parameter. Set **NIRFSG_ATTR_MORE_DATA_PENDING** to VI_FALSE to indicate that this data block contains the end of the waveform. If the waveform is already allocated, this parameter is ignored.' - }, - 'name': 'moreDataPending', - 'type': 'ViBoolean', - 'use_array': False, - 'use_in_python_api': True + 'use_in_python_api': True, + 'use_numpy_array': True } ], 'returns': 'ViStatus', 'use_session_lock': True }, - 'WriteWaveformComplexF32': { - 'codegen_method': 'private', + 'WriteP2PEndpointI16': { + 'codegen_method': 'public', 'documentation': { - 'description': ' \n Writes an arbitrary waveform to the NI-RFSG device starting at the position of the last data written in onboard memory. \n \n This function accepts the complex baseband data in the form of complex singles. If the waveform to write is already allocated using the %function{allocate arb waveform} function, the **%parameter{more data pending}** parameter is ignored. The PXI-5670/5671 must be in the Configuration state before you call this function. When streaming is enabled, you can call this function when the PXIe-5672/5673/5673E or PXIe-5820/5830/5831/5832/5840/5841/5842/5860 is in the Generation state.\n ----\n **Note**\n On the PXIe-5644/5645/5646, PXIe-5672/5673/5673E, and PXIe-5820/5830/5831/5832/5840/5841/5842/5860, the **%parameter{more data pending}** parameter is always ignored. To write data in blocks on these devices, you must allocate the waveform before writing it.\n ----\n\n **Supported Devices**: PXIe-5644/5645/5646, PXI-5670/5671, PXIe-5672/5673/5673E, PXIe-5820/5830/5831/5832/5840/5841/5842/5860\n\n **Related Topics**\n\n [Streaming](https://www.ni.com/docs/en-US/bundle/ni-rfsg/page/streaming.html)\n\n [Assigning Properties or Attributes to a Waveform](https://www.ni.com/docs/en-US/bundle/ni-rfsg/page/assigning-properties-or-attributes-to-a-wavef.html)\n ' + 'description': ' \n\n Writes an array of 16-bit integer data to the peer-to-peer endpoint. \n \n Use this function to write initial data from the host to the endpoint before starting generation to avoid an underflow when you start the generation.\n\n **Supported Devices** : PXIe-5673E\n\n **Related Topics**\n\n `Peer-to-Peer Data Streaming `_--Refer to this topic for more information about configuring a stream.\n\n `Configuring Flow Control `_\n\n `Starting Peer-to-Peer Generation `_\n\n `Reconfiguring a Stream `_\n ' }, - 'included_in_proto': False, + 'included_in_proto': True, 'is_error_handling': False, 'method_templates': [ { - 'documentation_filename': 'numpy_method', - 'library_interpreter_filename': 'numpy_write_method', + 'documentation_filename': 'default_method', + 'library_interpreter_filename': 'default_method', 'method_python_name_suffix': '', - 'session_filename': 'numpy_write_method' + 'session_filename': 'default_method' } ], - 'method_name_for_documentation': 'write_arb_waveform', 'parameters': [ { 'direction': 'in', @@ -5202,9 +5199,9 @@ { 'direction': 'in', 'documentation': { - 'description': 'Specifies the name used to identify the waveform. This string is case-insensitive and alphanumeric, and it does not use reserved words.' + 'description': 'Specifies the stream endpoint FIFO to configure.' }, - 'name': 'waveformName', + 'name': 'streamEndpoint', 'type': 'ViConstString', 'use_array': False, 'use_in_python_api': True @@ -5212,36 +5209,24 @@ { 'direction': 'in', 'documentation': { - 'description': 'Specifies the number of samples in the message signal.' + 'description': 'Specifies the number of samples to write into the endpoint FIFO.' }, 'name': 'numberOfSamples', 'type': 'ViInt32', 'use_array': False, - 'use_in_python_api': False + 'use_in_python_api': True }, { 'direction': 'in', 'documentation': { - 'description': 'Specifies the array of data to load into the waveform. The array must have at least as many elements as the value in the **size_in_samples** parameter in the nirfsg_AllocateArbWaveform function.' + 'description': 'Specifies the array of data to write into the endpoint FIFO. The binary data is left-justified.' }, - 'name': 'waveformDataArray', - 'numpy': True, + 'name': 'endpointData', 'size': { - 'mechanism': 'len', + 'mechanism': 'passed-in', 'value': 'numberOfSamples' }, - 'type': 'ComplexViReal32[]', - 'complex_type': 'numpy', - 'use_numpy_array': True, - 'use_in_python_api': True - }, - { - 'direction': 'in', - 'documentation': { - 'description': 'Specifies whether or not the data block contains the end of the waveform. Set this parameter to VI_TRUE to allow data to be appended later to the waveform. Splitting the waveform into multiple data blocks can reduce the memory requirements of the write operation. Append data to a previously written waveform by using the same waveform in the **name** parameter. Set **NIRFSG_ATTR_MORE_DATA_PENDING** to VI_FALSE to indicate that this data block contains the end of the waveform. If the waveform is already allocated, this parameter is ignored.' - }, - 'name': 'moreDataPending', - 'type': 'ViBoolean', + 'type': 'ViInt16[]', 'use_array': False, 'use_in_python_api': True } @@ -5249,10 +5234,11 @@ 'returns': 'ViStatus', 'use_session_lock': True }, - 'WriteP2PEndpointI16': { + 'WriteScript': { 'codegen_method': 'public', 'documentation': { - 'description': ' \n\n Writes an array of 16-bit integer data to the peer-to-peer endpoint. \n \n Use this function to write initial data from the host to the endpoint before starting generation to avoid an underflow when you start the generation.\n\n **Supported Devices** : PXIe-5673E\n\n **Related Topics**\n\n `Peer-to-Peer Data Streaming `_--Refer to this topic for more information about configuring a stream.\n\n `Configuring Flow Control `_\n\n `Starting Peer-to-Peer Generation `_\n\n `Reconfiguring a Stream `_\n ' + 'description': ' \n\n Writes a script to the device to control waveform generation in Script mode. \n \n First, configure your device for Script mode by calling the nirfsg_ConfigureGenerationMode function. The NI-RFSG device must be in the Configuration state before calling the nirfsg_WriteScript function.\n\n **Supported Devices** : PXIe-5644/5645/5646, PXI-5670/5671, PXIe-5672/5673/5673E, PXIe-5820/5830/5831/5832/5840/5841/5842/5860\n\n **Related Topics**\n\n `Scripting Instructions `_--Refer to this topic for more information about VST restrictions on scripts.\n\n `Common Scripting Use Cases `_\n ', + 'note': 'If you are using an RF vector signal transceiver (VST) device, some script instructions may not be supported.' }, 'included_in_proto': True, 'is_error_handling': False, @@ -5278,55 +5264,31 @@ { 'direction': 'in', 'documentation': { - 'description': 'Specifies the stream endpoint FIFO to configure.' + 'description': 'Specifies a string containing a syntactically correct script. NI-RFSG supports multiple scripts that are selected with the NIRFSG_ATTR_SELECTED_SCRIPT attribute. Refer to `Scripting Instructions `_ for more information about using scripts.' }, - 'name': 'streamEndpoint', + 'name': 'script', 'type': 'ViConstString', 'use_array': False, 'use_in_python_api': True - }, - { - 'direction': 'in', - 'documentation': { - 'description': 'Specifies the number of samples to write into the endpoint FIFO.' - }, - 'name': 'numberOfSamples', - 'type': 'ViInt32', - 'use_array': False, - 'use_in_python_api': True - }, - { - 'direction': 'in', - 'documentation': { - 'description': 'Specifies the array of data to write into the endpoint FIFO. The binary data is left-justified.' - }, - 'name': 'endpointData', - 'size': { - 'mechanism': 'passed-in', - 'value': 'numberOfSamples' - }, - 'type': 'ViInt16[]', - 'use_array': False, - 'use_in_python_api': True } ], 'returns': 'ViStatus', - 'use_session_lock': False + 'use_session_lock': True }, - 'WriteScript': { - 'codegen_method': 'public', + 'WriteWaveformDispatcher': { + 'codegen_method': 'python-only', 'documentation': { - 'description': ' \n\n Writes a script to the device to control waveform generation in Script mode. \n \n First, configure your device for Script mode by calling the nirfsg_ConfigureGenerationMode function. The NI-RFSG device must be in the Configuration state before calling the nirfsg_WriteScript function.\n\n **Supported Devices** : PXIe-5644/5645/5646, PXI-5670/5671, PXIe-5672/5673/5673E, PXIe-5820/5830/5831/5832/5840/5841/5842/5860\n\n **Related Topics**\n\n `Scripting Instructions `_--Refer to this topic for more information about VST restrictions on scripts.\n\n `Common Scripting Use Cases `_\n ', - 'note': 'If you are using an RF vector signal transceiver (VST) device, some script instructions may not be supported.' + 'description': ' \n Writes an arbitrary waveform to the NI-RFSG device starting at the position of the last data written in onboard memory. \n \n This function accepts the complex baseband data in the form of numpy array of numpy.complex64 or numpy.complex128 or interleaved numpy array of numpy.int16. If the waveform to write is already allocated using the nirfsg_AllocateArbWaveform function, the **NIRFSG_ATTR_MORE_DATA_PENDING** parameter is ignored. The PXI-5670/5671 must be in the Configuration state before you call this function. When streaming is enabled, this function can be called when the PXIe-5672/5673/5673E or PXIe-5820/5830/5831/5832/5840/5841/5842/5860 is in the Generation state.\n\n **Supported Devices** : PXIe-5644/5645/5646, PXIe-5672/5673/5673E, PXIe-5820/5830/5831/5832/5840/5841/5842/5860\n\n **Related Topics**\n\n `Streaming `_\n\n `Assigning Properties or Attributes to a Waveform `_\n ', + 'note': 'This function only supports NIRFSG_VAL_PEAK_POWER mode as specified in the NIRFSG_ATTR_POWER_LEVEL_TYPE attribute. If you download a waveform when using this function, you cannot set the NIRFSG_ATTR_POWER_LEVEL_TYPE to NIRFSG_VAL_AVERAGE_POWER without causing error in the output.' }, - 'included_in_proto': True, + 'included_in_proto': False, 'is_error_handling': False, 'method_templates': [ { 'documentation_filename': 'default_method', - 'library_interpreter_filename': 'default_method', + 'library_interpreter_filename': 'none', 'method_python_name_suffix': '', - 'session_filename': 'default_method' + 'session_filename': 'write_arb_waveform' } ], 'parameters': [ @@ -5343,14 +5305,51 @@ { 'direction': 'in', 'documentation': { - 'description': 'Specifies a string containing a syntactically correct script. NI-RFSG supports multiple scripts that are selected with the NIRFSG_ATTR_SELECTED_SCRIPT attribute. Refer to `Scripting Instructions `_ for more information about using scripts.' + 'description': 'Specifies the name used to identify the waveform. This string is case-insensitive and alphanumeric, and it does not use reserved words.' }, - 'name': 'script', + 'name': 'waveformName', 'type': 'ViConstString', 'use_array': False, 'use_in_python_api': True + }, + { + 'direction': 'in', + 'documentation': { + 'description': 'Specifies the number of samples in the data array.' + }, + 'name': 'numberOfSamples', + 'type': 'ViInt32', + 'use_array': False, + 'use_in_python_api': False + }, + { + 'complex_type': 'numpy', + 'direction': 'in', + 'documentation': { + 'description': 'Specifies the array of data to load into the waveform. The array must have at least as many elements as the value in the **size_in_samples** parameter in the nirfsg_AllocateArbWaveform function.' + }, + 'name': 'waveformDataArray', + 'numpy': True, + 'size': { + 'mechanism': 'len', + 'value': 'numberOfSamples' + }, + 'type': 'ComplexViReal64[]', + 'use_in_python_api': True, + 'use_numpy_array': True + }, + { + 'direction': 'in', + 'documentation': { + 'description': 'Specifies whether or not the data block contains the end of the waveform. Set this parameter to VI_TRUE to allow data to be appended later to the waveform. Splitting the waveform into multiple data blocks can reduce the memory requirements of the write operation. Append data to a previously written waveform by using the same waveform in the **name** parameter. Set **NIRFSG_ATTR_MORE_DATA_PENDING** to VI_FALSE to indicate that this data block contains the end of the waveform. If the waveform is already allocated, this parameter is ignored.' + }, + 'name': 'moreDataPending', + 'type': 'ViBoolean', + 'use_array': False, + 'use_in_python_api': True } ], + 'python_name': 'write_arb_waveform', 'returns': 'ViStatus', 'use_session_lock': False }, diff --git a/tox-travis.ini b/tox-travis.ini index 9a7a62ada6..9c08695d4e 100644 --- a/tox-travis.ini +++ b/tox-travis.ini @@ -156,7 +156,7 @@ deps = installers: build flake8: hacking flake8: pep8-naming - docs: snowballstemmer == 2.2.0 + docs: snowballstemmer == 2.2.0 # Hardcoding due to https://github.com/sphinx-doc/sphinx/issues/13533 docs: sphinx docs: sphinx-rtd-theme pkg: check-manifest diff --git a/tox.ini b/tox.ini index 1ae593ac9f..6bfaca0c86 100644 --- a/tox.ini +++ b/tox.ini @@ -156,7 +156,7 @@ deps = installers: build flake8: hacking flake8: pep8-naming - docs: snowballstemmer == 2.2.0 + docs: snowballstemmer == 2.2.0 # Hardcoding due to https://github.com/sphinx-doc/sphinx/issues/13533 docs: sphinx docs: sphinx-rtd-theme pkg: check-manifest From 37d092db131cb8e89ae9cf94cd42c19e41553bd6 Mon Sep 17 00:00:00 2001 From: Rahul R Date: Thu, 15 May 2025 14:40:00 +0530 Subject: [PATCH 08/33] Update Changelog.md file --- CHANGELOG.md | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f89e0e442c..fb67388c5b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -49,7 +49,7 @@ #### [nidcpower] Unreleased - Added - - (Common) All functions should have parameters that take in numpy.complex types. + - (Common) Allow functions to have parameters that take in numpy.complex types. - Changed - Removed @@ -523,7 +523,7 @@ #### [nidigital] Unreleased - Added - - (Common) All functions should have parameters that take in numpy.complex types. + - (Common) Allow functions to have parameters that take in numpy.complex types. - Changed - Removed @@ -757,7 +757,7 @@ #### [nidmm] Unreleased - Added - - (Common) All functions should have parameters that take in numpy.complex types. + - (Common) Allow functions to have parameters that take in numpy.complex types. - Changed - Removed @@ -1073,7 +1073,7 @@ #### [nifgen] Unreleased - Added - - (Common) All functions should have parameters that take in numpy.complex types. + - (Common) Allow functions to have parameters that take in numpy.complex types. - Changed - Removed @@ -1450,7 +1450,7 @@ #### [nimodinst] Unreleased - Added - - (Common) All functions should have parameters that take in numpy.complex types. + - (Common) Allow functions to have parameters that take in numpy.complex types. - Changed - Removed @@ -1675,7 +1675,7 @@ - Enabled selected public APIs - Basic example - Documentation for APIs (not final) - - (Common) All functions should have parameters that take in numpy.complex types. + - (Common) Allow functions to have parameters that take in numpy.complex types. - Enabled write_arb_waveform funtions along with examples. - Changed - Removed @@ -1710,7 +1710,7 @@ #### [niscope] Unreleased - Added - - (Common) All functions should have parameters that take in numpy.complex types. + - (Common) Allow functions to have parameters that take in numpy.complex types. - Changed - Removed @@ -2149,7 +2149,7 @@ - [0.1.0](#nise-010---2018-10-17) - Added - - (Common) All functions should have parameters that take in numpy.complex types. + - (Common) Allow functions to have parameters that take in numpy.complex types. - Changed - Removed @@ -2305,7 +2305,7 @@ - [0.2.0](#niswitch-020---2017-09-20) - Added - - (Common) All functions should have parameters that take in numpy.complex types. + - (Common) Allow functions to have parameters that take in numpy.complex types. - Changed - Removed @@ -2556,7 +2556,7 @@ - [0.1.0](#nitclk-010---2019-10-21) - Added - - (Common) All functions should have parameters that take in numpy.complex types. + - (Common) Allow functions to have parameters that take in numpy.complex types. - Changed - Removed From 9a411cf17053ad641e7cca67e69409e04d28c58d Mon Sep 17 00:00:00 2001 From: Rahul R Date: Thu, 15 May 2025 14:49:59 +0530 Subject: [PATCH 09/33] Updated minor change. --- generated/nifake/nifake/unit_tests/test_library_interpreter.py | 1 + src/nifake/unit_tests/test_library_interpreter.py | 1 + 2 files changed, 2 insertions(+) diff --git a/generated/nifake/nifake/unit_tests/test_library_interpreter.py b/generated/nifake/nifake/unit_tests/test_library_interpreter.py index adaef20efb..57fc2593d8 100644 --- a/generated/nifake/nifake/unit_tests/test_library_interpreter.py +++ b/generated/nifake/nifake/unit_tests/test_library_interpreter.py @@ -35,6 +35,7 @@ def setup_method(self, method): self.side_effects_helper = _mock_helper.SideEffectsHelper() self.side_effects_helper.set_side_effects_and_return_values(self.patched_library) self.patched_library.niFake_SetRuntimeEnvironment.side_effect = self.side_effects_helper.niFake_SetRuntimeEnvironment + self.get_ctypes_pointer_for_buffer_side_effect_count = 0 self.get_ctypes_pointer_for_buffer_side_effect_items = [] diff --git a/src/nifake/unit_tests/test_library_interpreter.py b/src/nifake/unit_tests/test_library_interpreter.py index adaef20efb..57fc2593d8 100644 --- a/src/nifake/unit_tests/test_library_interpreter.py +++ b/src/nifake/unit_tests/test_library_interpreter.py @@ -35,6 +35,7 @@ def setup_method(self, method): self.side_effects_helper = _mock_helper.SideEffectsHelper() self.side_effects_helper.set_side_effects_and_return_values(self.patched_library) self.patched_library.niFake_SetRuntimeEnvironment.side_effect = self.side_effects_helper.niFake_SetRuntimeEnvironment + self.get_ctypes_pointer_for_buffer_side_effect_count = 0 self.get_ctypes_pointer_for_buffer_side_effect_items = [] From ac28335aaa5c1b4550c54b059db59a7b4366edfd Mon Sep 17 00:00:00 2001 From: Rahul R Date: Thu, 15 May 2025 15:24:07 +0530 Subject: [PATCH 10/33] Updated few minor fix --- generated/nifake/nifake/session.py | 12 +- generated/nirfsg/nirfsg/session.py | 178 ++++++++--------------------- src/nifake/metadata/functions.py | 6 +- src/nirfsg/metadata/functions.py | 174 ++++++++++++++-------------- 4 files changed, 142 insertions(+), 228 deletions(-) diff --git a/generated/nifake/nifake/session.py b/generated/nifake/nifake/session.py index 9493019052..3f5a682c2d 100644 --- a/generated/nifake/nifake/session.py +++ b/generated/nifake/nifake/session.py @@ -1671,8 +1671,8 @@ def write_waveform_numpy(self, waveform): self._interpreter.write_waveform_numpy(waveform) @ivi_synchronized - def _write_waveform_complex_f32(self, waveform_data_array): - r'''_write_waveform_complex_f32 + def write_waveform_complex_f32(self, waveform_data_array): + r'''write_waveform_complex_f32 A method that writes a waveform of complex64 numbers. @@ -1691,8 +1691,8 @@ def _write_waveform_complex_f32(self, waveform_data_array): self._interpreter.write_waveform_complex_f32(waveform_data_array) @ivi_synchronized - def _write_waveform_complex_f64(self, waveform_data_array): - r'''_write_waveform_complex_f64 + def write_waveform_complex_f64(self, waveform_data_array): + r'''write_waveform_complex_f64 A method that writes a waveform of complex128 numbers @@ -1711,8 +1711,8 @@ def _write_waveform_complex_f64(self, waveform_data_array): self._interpreter.write_waveform_complex_f64(waveform_data_array) @ivi_synchronized - def _write_waveform_complex_i16(self, waveform_data_array): - r'''_write_waveform_complex_i16 + def write_waveform_complex_i16(self, waveform_data_array): + r'''write_waveform_complex_i16 A method that writes a waveform of i16 numbers. diff --git a/generated/nirfsg/nirfsg/session.py b/generated/nirfsg/nirfsg/session.py index 257978f699..aff8c810e5 100644 --- a/generated/nirfsg/nirfsg/session.py +++ b/generated/nirfsg/nirfsg/session.py @@ -5434,7 +5434,6 @@ def __setattr__(self, key, value): ''' These are code-generated ''' - @ivi_synchronized def check_attribute_vi_boolean(self, attribute, value): r'''check_attribute_vi_boolean @@ -5461,7 +5460,6 @@ def check_attribute_vi_boolean(self, attribute, value): ''' self._interpreter.check_attribute_vi_boolean(self._repeated_capability, attribute, value) - @ivi_synchronized def check_attribute_vi_int32(self, attribute, value): r'''check_attribute_vi_int32 @@ -5488,7 +5486,6 @@ def check_attribute_vi_int32(self, attribute, value): ''' self._interpreter.check_attribute_vi_int32(self._repeated_capability, attribute, value) - @ivi_synchronized def check_attribute_vi_int64(self, attribute, value): r'''check_attribute_vi_int64 @@ -5515,7 +5512,6 @@ def check_attribute_vi_int64(self, attribute, value): ''' self._interpreter.check_attribute_vi_int64(self._repeated_capability, attribute, value) - @ivi_synchronized def check_attribute_vi_real64(self, attribute, value): r'''check_attribute_vi_real64 @@ -5542,7 +5538,6 @@ def check_attribute_vi_real64(self, attribute, value): ''' self._interpreter.check_attribute_vi_real64(self._repeated_capability, attribute, value) - @ivi_synchronized def check_attribute_vi_session(self, attribute): r'''check_attribute_vi_session @@ -5565,7 +5560,6 @@ def check_attribute_vi_session(self, attribute): ''' self._interpreter.check_attribute_vi_session(self._repeated_capability, attribute) - @ivi_synchronized def check_attribute_vi_string(self, attribute, value): r'''check_attribute_vi_string @@ -5592,7 +5586,6 @@ def check_attribute_vi_string(self, attribute, value): ''' self._interpreter.check_attribute_vi_string(self._repeated_capability, attribute, value) - @ivi_synchronized def _get_attribute_vi_boolean(self, attribute): r'''_get_attribute_vi_boolean @@ -5625,7 +5618,6 @@ def _get_attribute_vi_boolean(self, attribute): value = self._interpreter.get_attribute_vi_boolean(self._repeated_capability, attribute) return value - @ivi_synchronized def _get_attribute_vi_int32(self, attribute): r'''_get_attribute_vi_int32 @@ -5658,7 +5650,6 @@ def _get_attribute_vi_int32(self, attribute): value = self._interpreter.get_attribute_vi_int32(self._repeated_capability, attribute) return value - @ivi_synchronized def _get_attribute_vi_int64(self, attribute): r'''_get_attribute_vi_int64 @@ -5691,7 +5682,6 @@ def _get_attribute_vi_int64(self, attribute): value = self._interpreter.get_attribute_vi_int64(self._repeated_capability, attribute) return value - @ivi_synchronized def _get_attribute_vi_real64(self, attribute): r'''_get_attribute_vi_real64 @@ -5724,7 +5714,6 @@ def _get_attribute_vi_real64(self, attribute): value = self._interpreter.get_attribute_vi_real64(self._repeated_capability, attribute) return value - @ivi_synchronized def _get_attribute_vi_session(self, attribute): r'''_get_attribute_vi_session @@ -5757,7 +5746,6 @@ def _get_attribute_vi_session(self, attribute): value = self._interpreter.get_attribute_vi_session(self._repeated_capability, attribute) return value - @ivi_synchronized def _get_attribute_vi_string(self, attribute): r'''_get_attribute_vi_string @@ -5796,7 +5784,6 @@ def _get_attribute_vi_string(self, attribute): value = self._interpreter.get_attribute_vi_string(self._repeated_capability, attribute) return value - @ivi_synchronized def _get_waveform_burst_start_locations(self, number_of_locations): r'''_get_waveform_burst_start_locations @@ -5834,7 +5821,6 @@ def _get_waveform_burst_start_locations(self, number_of_locations): locations, required_size = self._interpreter.get_waveform_burst_start_locations(self._repeated_capability, number_of_locations) return locations, required_size - @ivi_synchronized def _get_waveform_burst_stop_locations(self, number_of_locations): r'''_get_waveform_burst_stop_locations @@ -5872,7 +5858,6 @@ def _get_waveform_burst_stop_locations(self, number_of_locations): locations, required_size = self._interpreter.get_waveform_burst_stop_locations(self._repeated_capability, number_of_locations) return locations, required_size - @ivi_synchronized def _get_waveform_marker_event_locations(self, number_of_locations): r'''_get_waveform_marker_event_locations @@ -5907,7 +5892,6 @@ def _get_waveform_marker_event_locations(self, number_of_locations): locations, required_size = self._interpreter.get_waveform_marker_event_locations(self._repeated_capability, number_of_locations) return locations, required_size - @ivi_synchronized def load_configurations_from_file(self, file_path): r'''load_configurations_from_file @@ -5969,7 +5953,6 @@ def lock(self): # that will handle the unlock for them return _Lock(self) - @ivi_synchronized def reset_attribute(self, attribute_id): r'''reset_attribute @@ -5994,7 +5977,6 @@ def reset_attribute(self, attribute_id): ''' self._interpreter.reset_attribute(self._repeated_capability, attribute_id) - @ivi_synchronized def save_configurations_to_file(self, file_path): r'''save_configurations_to_file @@ -6019,7 +6001,6 @@ def save_configurations_to_file(self, file_path): ''' self._interpreter.save_configurations_to_file(self._repeated_capability, file_path) - @ivi_synchronized def send_software_edge_trigger(self, trigger, trigger_identifier): r'''send_software_edge_trigger @@ -6084,7 +6065,6 @@ def send_software_edge_trigger(self, trigger, trigger_identifier): raise TypeError('Parameter trigger_identifier must be of type ' + str(enums.TriggerIdentifier)) self._interpreter.send_software_edge_trigger(trigger, trigger_identifier) - @ivi_synchronized def _set_attribute_vi_boolean(self, attribute, value): r'''_set_attribute_vi_boolean @@ -6120,7 +6100,6 @@ def _set_attribute_vi_boolean(self, attribute, value): ''' self._interpreter.set_attribute_vi_boolean(self._repeated_capability, attribute, value) - @ivi_synchronized def _set_attribute_vi_int32(self, attribute, value): r'''_set_attribute_vi_int32 @@ -6156,7 +6135,6 @@ def _set_attribute_vi_int32(self, attribute, value): ''' self._interpreter.set_attribute_vi_int32(self._repeated_capability, attribute, value) - @ivi_synchronized def _set_attribute_vi_int64(self, attribute, value): r'''_set_attribute_vi_int64 @@ -6194,7 +6172,6 @@ def _set_attribute_vi_int64(self, attribute, value): ''' self._interpreter.set_attribute_vi_int64(self._repeated_capability, attribute, value) - @ivi_synchronized def _set_attribute_vi_real64(self, attribute, value): r'''_set_attribute_vi_real64 @@ -6230,7 +6207,6 @@ def _set_attribute_vi_real64(self, attribute, value): ''' self._interpreter.set_attribute_vi_real64(self._repeated_capability, attribute, value) - @ivi_synchronized def _set_attribute_vi_session(self, attribute): r'''_set_attribute_vi_session @@ -6262,7 +6238,6 @@ def _set_attribute_vi_session(self, attribute): ''' self._interpreter.set_attribute_vi_session(self._repeated_capability, attribute) - @ivi_synchronized def _set_attribute_vi_string(self, attribute, value): r'''_set_attribute_vi_string @@ -6298,7 +6273,6 @@ def _set_attribute_vi_string(self, attribute, value): ''' self._interpreter.set_attribute_vi_string(self._repeated_capability, attribute, value) - @ivi_synchronized def _set_waveform_burst_start_locations(self, number_of_locations, locations): r'''_set_waveform_burst_start_locations @@ -6328,7 +6302,6 @@ def _set_waveform_burst_start_locations(self, number_of_locations, locations): ''' self._interpreter.set_waveform_burst_start_locations(self._repeated_capability, number_of_locations, locations) - @ivi_synchronized def _set_waveform_burst_stop_locations(self, number_of_locations, locations): r'''_set_waveform_burst_stop_locations @@ -6355,7 +6328,6 @@ def _set_waveform_burst_stop_locations(self, number_of_locations, locations): ''' self._interpreter.set_waveform_burst_stop_locations(self._repeated_capability, number_of_locations, locations) - @ivi_synchronized def _set_waveform_marker_event_locations(self, number_of_locations, locations): r'''_set_waveform_marker_event_locations @@ -6568,7 +6540,6 @@ def close(self): ''' These are code-generated ''' - @ivi_synchronized def abort(self): r'''abort @@ -6582,7 +6553,6 @@ def abort(self): ''' self._interpreter.abort() - @ivi_synchronized def allocate_arb_waveform(self, waveform_name, size_in_samples): r'''allocate_arb_waveform @@ -6606,7 +6576,6 @@ def allocate_arb_waveform(self, waveform_name, size_in_samples): ''' self._interpreter.allocate_arb_waveform(waveform_name, size_in_samples) - @ivi_synchronized def change_external_calibration_password(self, old_password, new_password): r'''change_external_calibration_password @@ -6622,7 +6591,6 @@ def change_external_calibration_password(self, old_password, new_password): ''' self._interpreter.change_external_calibration_password(old_password, new_password) - @ivi_synchronized def check_generation_status(self): r'''check_generation_status @@ -6655,7 +6623,6 @@ def check_generation_status(self): is_done = self._interpreter.check_generation_status() return is_done - @ivi_synchronized def check_if_script_exists(self, script_name): r'''check_if_script_exists @@ -6687,7 +6654,6 @@ def check_if_script_exists(self, script_name): script_exists = self._interpreter.check_if_script_exists(script_name) return script_exists - @ivi_synchronized def check_if_waveform_exists(self, waveform_name): r'''check_if_waveform_exists @@ -6719,7 +6685,6 @@ def check_if_waveform_exists(self, waveform_name): waveform_exists = self._interpreter.check_if_waveform_exists(waveform_name) return waveform_exists - @ivi_synchronized def clear_all_arb_waveforms(self): r'''clear_all_arb_waveforms @@ -6731,7 +6696,6 @@ def clear_all_arb_waveforms(self): ''' self._interpreter.clear_all_arb_waveforms() - @ivi_synchronized def clear_arb_waveform(self, name): r'''clear_arb_waveform @@ -6747,7 +6711,6 @@ def clear_arb_waveform(self, name): ''' self._interpreter.clear_arb_waveform(name) - @ivi_synchronized def clear_error(self): r'''clear_error @@ -6766,7 +6729,6 @@ def clear_error(self): ''' self._interpreter.clear_error() - @ivi_synchronized def clear_self_calibrate_range(self): r'''clear_self_calibrate_range @@ -6776,7 +6738,6 @@ def clear_self_calibrate_range(self): ''' self._interpreter.clear_self_calibrate_range() - @ivi_synchronized def commit(self): r'''commit @@ -6792,7 +6753,6 @@ def commit(self): ''' self._interpreter.commit() - @ivi_synchronized def configure_deembedding_table_interpolation_linear(self, port, table_name, format): r'''configure_deembedding_table_interpolation_linear @@ -6824,7 +6784,6 @@ def configure_deembedding_table_interpolation_linear(self, port, table_name, for raise TypeError('Parameter format must be of type ' + str(enums.Format)) self._interpreter.configure_deembedding_table_interpolation_linear(port, table_name, format) - @ivi_synchronized def configure_deembedding_table_interpolation_nearest(self, port, table_name): r'''configure_deembedding_table_interpolation_nearest @@ -6842,7 +6801,6 @@ def configure_deembedding_table_interpolation_nearest(self, port, table_name): ''' self._interpreter.configure_deembedding_table_interpolation_nearest(port, table_name) - @ivi_synchronized def configure_deembedding_table_interpolation_spline(self, port, table_name): r'''configure_deembedding_table_interpolation_spline @@ -6860,7 +6818,6 @@ def configure_deembedding_table_interpolation_spline(self, port, table_name): ''' self._interpreter.configure_deembedding_table_interpolation_spline(port, table_name) - @ivi_synchronized def configure_digital_edge_script_trigger(self, trigger_id, source, edge): r'''configure_digital_edge_script_trigger @@ -6888,7 +6845,6 @@ def configure_digital_edge_script_trigger(self, trigger_id, source, edge): ''' self._interpreter.configure_digital_edge_script_trigger(trigger_id, source, edge) - @ivi_synchronized def configure_digital_edge_start_trigger(self, source, edge): r'''configure_digital_edge_start_trigger @@ -6914,7 +6870,6 @@ def configure_digital_edge_start_trigger(self, source, edge): ''' self._interpreter.configure_digital_edge_start_trigger(source, edge) - @ivi_synchronized def configure_digital_level_script_trigger(self, trigger_id, source, level): r'''configure_digital_level_script_trigger @@ -6940,7 +6895,6 @@ def configure_digital_level_script_trigger(self, trigger_id, source, level): ''' self._interpreter.configure_digital_level_script_trigger(trigger_id, source, level) - @ivi_synchronized def configure_digital_modulation_user_defined_waveform(self, number_of_samples, user_defined_waveform): r'''configure_digital_modulation_user_defined_waveform @@ -6959,7 +6913,6 @@ def configure_digital_modulation_user_defined_waveform(self, number_of_samples, ''' self._interpreter.configure_digital_modulation_user_defined_waveform(number_of_samples, user_defined_waveform) - @ivi_synchronized def configure_generation_mode(self, generation_mode): r'''configure_generation_mode @@ -7001,7 +6954,6 @@ def configure_generation_mode(self, generation_mode): raise TypeError('Parameter generation_mode must be of type ' + str(enums.GenerationMode)) self._interpreter.configure_generation_mode(generation_mode) - @ivi_synchronized def configure_output_enabled(self, output_enabled): r'''configure_output_enabled @@ -7025,7 +6977,6 @@ def configure_output_enabled(self, output_enabled): ''' self._interpreter.configure_output_enabled(output_enabled) - @ivi_synchronized def configure_p2_p_endpoint_fullness_start_trigger(self, p2p_endpoint_fullness_level): r'''configure_p2_p_endpoint_fullness_start_trigger @@ -7050,7 +7001,6 @@ def configure_p2_p_endpoint_fullness_start_trigger(self, p2p_endpoint_fullness_l ''' self._interpreter.configure_p2_p_endpoint_fullness_start_trigger(p2p_endpoint_fullness_level) - @ivi_synchronized def configure_power_level_type(self, power_level_type): r'''configure_power_level_type @@ -7080,7 +7030,6 @@ def configure_power_level_type(self, power_level_type): ''' self._interpreter.configure_power_level_type(power_level_type) - @ivi_synchronized def configure_pxi_chassis_clk10(self, pxi_clk10_source): r'''configure_pxi_chassis_clk10 @@ -7102,7 +7051,6 @@ def configure_pxi_chassis_clk10(self, pxi_clk10_source): ''' self._interpreter.configure_pxi_chassis_clk10(pxi_clk10_source) - @ivi_synchronized def configure_rf(self, frequency, power_level): r'''configure_rf @@ -7128,7 +7076,6 @@ def configure_rf(self, frequency, power_level): ''' self._interpreter.configure_rf(frequency, power_level) - @ivi_synchronized def configure_ref_clock(self, ref_clock_source, ref_clock_rate): r'''configure_ref_clock @@ -7180,7 +7127,6 @@ def configure_ref_clock(self, ref_clock_source, ref_clock_rate): ''' self._interpreter.configure_ref_clock(ref_clock_source, ref_clock_rate) - @ivi_synchronized def configure_signal_bandwidth(self, signal_bandwidth): r'''configure_signal_bandwidth @@ -7200,7 +7146,6 @@ def configure_signal_bandwidth(self, signal_bandwidth): ''' self._interpreter.configure_signal_bandwidth(signal_bandwidth) - @ivi_synchronized def configure_software_script_trigger(self, trigger_id): r'''configure_software_script_trigger @@ -7222,7 +7167,6 @@ def configure_software_script_trigger(self, trigger_id): ''' self._interpreter.configure_software_script_trigger(trigger_id) - @ivi_synchronized def configure_software_start_trigger(self): r'''configure_software_start_trigger @@ -7242,7 +7186,6 @@ def configure_software_start_trigger(self): ''' self._interpreter.configure_software_start_trigger() - @ivi_synchronized def create_deembedding_sparameter_table_s2_p_file(self, port, table_name, s2p_file_path, sparameter_orientation): r'''create_deembedding_sparameter_table_s2_p_file @@ -7280,7 +7223,6 @@ def create_deembedding_sparameter_table_s2_p_file(self, port, table_name, s2p_fi raise TypeError('Parameter sparameter_orientation must be of type ' + str(enums.SparameterOrientation)) self._interpreter.create_deembedding_sparameter_table_s2_p_file(port, table_name, s2p_file_path, sparameter_orientation) - @ivi_synchronized def delete_all_deembedding_tables(self): r'''delete_all_deembedding_tables @@ -7290,7 +7232,6 @@ def delete_all_deembedding_tables(self): ''' self._interpreter.delete_all_deembedding_tables() - @ivi_synchronized def delete_deembedding_table(self, port, table_name): r'''delete_deembedding_table @@ -7306,7 +7247,6 @@ def delete_deembedding_table(self, port, table_name): ''' self._interpreter.delete_deembedding_table(port, table_name) - @ivi_synchronized def disable(self): r'''disable @@ -7316,7 +7256,6 @@ def disable(self): ''' self._interpreter.disable() - @ivi_synchronized def disable_script_trigger(self, trigger_id): r'''disable_script_trigger @@ -7336,7 +7275,6 @@ def disable_script_trigger(self, trigger_id): ''' self._interpreter.disable_script_trigger(trigger_id) - @ivi_synchronized def disable_start_trigger(self): r'''disable_start_trigger @@ -7352,7 +7290,6 @@ def disable_start_trigger(self): ''' self._interpreter.disable_start_trigger() - @ivi_synchronized def export_signal(self, signal, signal_identifier, output_terminal): r'''export_signal @@ -7454,7 +7391,6 @@ def export_signal(self, signal, signal_identifier, output_terminal): raise TypeError('Parameter output_terminal must be of type ' + str(enums.ReferenceClockExportOutputTerminal)) self._interpreter.export_signal(signal, signal_identifier, output_terminal) - @ivi_synchronized def _get_external_calibration_last_date_and_time(self): r'''_get_external_calibration_last_date_and_time @@ -7485,7 +7421,6 @@ def _get_external_calibration_last_date_and_time(self): year, month, day, hour, minute, second = self._interpreter.get_external_calibration_last_date_and_time() return year, month, day, hour, minute, second - @ivi_synchronized def get_external_calibration_last_date_and_time(self): '''get_external_calibration_last_date_and_time @@ -7498,7 +7433,6 @@ def get_external_calibration_last_date_and_time(self): year, month, day, hour, minute, second = self._get_external_calibration_last_date_and_time() return hightime.datetime(year, month, day, hour, minute) - @ivi_synchronized def get_self_calibration_last_date_and_time(self): '''get_self_calibration_last_date_and_time @@ -7511,7 +7445,6 @@ def get_self_calibration_last_date_and_time(self): year, month, day, hour, minute, second = self._get_self_calibration_date_and_time() return hightime.datetime(year, month, day, hour, minute) - @ivi_synchronized def get_max_settable_power(self): r'''get_max_settable_power @@ -7526,7 +7459,6 @@ def get_max_settable_power(self): value = self._interpreter.get_max_settable_power() return value - @ivi_synchronized def _get_self_calibration_date_and_time(self, module): r'''_get_self_calibration_date_and_time @@ -7561,7 +7493,6 @@ def _get_self_calibration_date_and_time(self, module): year, month, day, hour, minute, second = self._interpreter.get_self_calibration_date_and_time(module) return year, month, day, hour, minute, second - @ivi_synchronized def get_self_calibration_temperature(self, module): r'''get_self_calibration_temperature @@ -7594,7 +7525,6 @@ def get_self_calibration_temperature(self, module): temperature = self._interpreter.get_self_calibration_temperature(module) return temperature - @ivi_synchronized def get_stream_endpoint_handle(self, stream_endpoint): r'''get_stream_endpoint_handle @@ -7704,7 +7634,6 @@ def _init_with_options(self, resource_name, option_string, id_query=False, reset new_vi = self._interpreter.init_with_options(resource_name, id_query, reset_device, option_string) return new_vi - @ivi_synchronized def _initiate(self): r'''_initiate @@ -7720,7 +7649,6 @@ def _initiate(self): ''' self._interpreter.initiate() - @ivi_synchronized def perform_power_search(self): r'''perform_power_search @@ -7738,7 +7666,6 @@ def perform_power_search(self): ''' self._interpreter.perform_power_search() - @ivi_synchronized def perform_thermal_correction(self): r'''perform_thermal_correction @@ -7758,7 +7685,6 @@ def perform_thermal_correction(self): ''' self._interpreter.perform_thermal_correction() - @ivi_synchronized def query_arb_waveform_capabilities(self): r'''query_arb_waveform_capabilities @@ -7781,7 +7707,6 @@ def query_arb_waveform_capabilities(self): max_number_waveforms, waveform_quantum, min_waveform_size, max_waveform_size = self._interpreter.query_arb_waveform_capabilities() return max_number_waveforms, waveform_quantum, min_waveform_size, max_waveform_size - @ivi_synchronized def read_and_download_waveform_from_file_tdms(self, waveform_name, file_path, waveform_index): r'''read_and_download_waveform_from_file_tdms @@ -7818,7 +7743,6 @@ def read_and_download_waveform_from_file_tdms(self, waveform_name, file_path, wa ''' self._interpreter.read_and_download_waveform_from_file_tdms(waveform_name, file_path, waveform_index) - @ivi_synchronized def reset(self): r'''reset @@ -7836,7 +7760,6 @@ def reset(self): ''' self._interpreter.reset() - @ivi_synchronized def reset_device(self): r'''reset_device @@ -7863,7 +7786,6 @@ def reset_device(self): ''' self._interpreter.reset_device() - @ivi_synchronized def reset_with_defaults(self): r'''reset_with_defaults @@ -7873,7 +7795,6 @@ def reset_with_defaults(self): ''' self._interpreter.reset_with_defaults() - @ivi_synchronized def select_arb_waveform(self, name): r'''select_arb_waveform @@ -7896,7 +7817,6 @@ def select_arb_waveform(self, name): ''' self._interpreter.select_arb_waveform(name) - @ivi_synchronized def self_cal(self): r'''self_cal @@ -7912,7 +7832,6 @@ def self_cal(self): ''' self._interpreter.self_cal() - @ivi_synchronized def self_calibrate_range(self, steps_to_omit, min_frequency, max_frequency, min_power_level, max_power_level): r'''self_calibrate_range @@ -7971,7 +7890,6 @@ def self_calibrate_range(self, steps_to_omit, min_frequency, max_frequency, min_ raise TypeError('Parameter steps_to_omit must be of type ' + str(enums.SelfCalibrateRangeStepsToOmit)) self._interpreter.self_calibrate_range(steps_to_omit, min_frequency, max_frequency, min_power_level, max_power_level) - @ivi_synchronized def self_test(self, self_test_message): r'''self_test @@ -8008,7 +7926,6 @@ def self_test(self, self_test_message): self_test_result = self._interpreter.self_test(self_test_message) return self_test_result - @ivi_synchronized def set_arb_waveform_next_write_position(self, waveform_name, relative_to, offset): r'''set_arb_waveform_next_write_position @@ -8045,7 +7962,6 @@ def set_arb_waveform_next_write_position(self, waveform_name, relative_to, offse raise TypeError('Parameter relative_to must be of type ' + str(enums.RelativeTo)) self._interpreter.set_arb_waveform_next_write_position(waveform_name, relative_to, offset) - @ivi_synchronized def wait_until_settled(self, max_time_milliseconds): r'''wait_until_settled @@ -8146,7 +8062,6 @@ def _write_arb_waveform_complex_f64(self, waveform_name, waveform_data_array, mo raise TypeError('waveform_data_array must be numpy.ndarray of dtype=complex128, is ' + str(waveform_data_array.dtype)) self._interpreter.write_arb_waveform_complex_f64(waveform_name, waveform_data_array, more_data_pending) - @ivi_synchronized def _write_arb_waveform_complex_i16(self, waveform_name, waveform_data_array): r'''_write_arb_waveform_complex_i16 @@ -8180,6 +8095,52 @@ def _write_arb_waveform_complex_i16(self, waveform_name, waveform_data_array): raise TypeError('waveform_data_array must be numpy.ndarray of dtype=int16, is ' + str(waveform_data_array.dtype)) self._interpreter.write_arb_waveform_complex_i16(waveform_name, waveform_data_array) + def write_arb_waveform(self, waveform_name, waveform_data_array, more_data_pending): + '''write_arb_waveform + + Writes an arbitrary waveform to the NI-RFSG device starting at the position of the last data written in onboard memory. + + This method accepts the complex baseband data in the form of numpy array of numpy.complex64 or numpy.complex128 or interleaved numpy array of numpy.int16. If the waveform to write is already allocated using the allocate_arb_waveform method, the **MORE_DATA_PENDING** parameter is ignored. The PXI-5670/5671 must be in the Configuration state before you call this method. When streaming is enabled, this method can be called when the PXIe-5672/5673/5673E or PXIe-5820/5830/5831/5832/5840/5841/5842/5860 is in the Generation state. + + **Supported Devices** : PXIe-5644/5645/5646, PXIe-5672/5673/5673E, PXIe-5820/5830/5831/5832/5840/5841/5842/5860 + + **Related Topics** + + `Streaming `_ + + `Assigning Properties or Properties to a Waveform `_ + + Note: This method only supports PowerLevelType.PEAK mode as specified in the power_level_type property. If you download a waveform when using this method, you cannot set the power_level_type to PowerLevelType.AVERAGE without causing error in the output. + + Note: + One or more of the referenced properties are not in the Python API for this driver. + + Args: + waveform_name (str): Specifies the name used to identify the waveform. This string is case-insensitive and alphanumeric, and it does not use reserved words. + + waveform_data_array (list of ComplexViReal64): Specifies the array of data to load into the waveform. The array must have at least as many elements as the value in the **size_in_samples** parameter in the allocate_arb_waveform method. + + more_data_pending (bool): Specifies whether or not the data block contains the end of the waveform. Set this parameter to True to allow data to be appended later to the waveform. Splitting the waveform into multiple data blocks can reduce the memory requirements of the write operation. Append data to a previously written waveform by using the same waveform in the **name** parameter. Set **MORE_DATA_PENDING** to False to indicate that this data block contains the end of the waveform. If the waveform is already allocated, this parameter is ignored. + + Note: + One or more of the referenced properties are not in the Python API for this driver. + + ''' + if str(type(waveform_data_array)).find("'numpy.ndarray'") != -1: + import numpy + if waveform_data_array.dtype == numpy.complex128: + return self._write_arb_waveform_complex_f64(waveform_name, waveform_data_array, more_data_pending) + elif waveform_data_array.dtype == numpy.complex64: + return self._write_arb_waveform_complex_f32(waveform_name, waveform_data_array, more_data_pending) + elif waveform_data_array.dtype == numpy.int16: + return self._write_arb_waveform_complex_i16(waveform_name, waveform_data_array, more_data_pending) + else: + raise TypeError("Unsupported dtype. Is {}, expected {} or {} or {}".format(waveform_data_array.dtype, numpy.complex128, numpy.complex64, numpy.int16)) + else: + raise TypeError("Unsupported dtype. Is {}, expected {} or {} or {}".format(waveform_data_array.dtype, numpy.complex128, numpy.complex64, numpy.int16)) + + return self._write_arb_waveform_complex_f64(waveform_name, waveform_data_array, more_data_pending) + @ivi_synchronized def write_p2_p_endpoint_i16(self, stream_endpoint, number_of_samples, endpoint_data): r'''write_p2_p_endpoint_i16 @@ -8210,7 +8171,6 @@ def write_p2_p_endpoint_i16(self, stream_endpoint, number_of_samples, endpoint_d ''' self._interpreter.write_p2_p_endpoint_i16(stream_endpoint, number_of_samples, endpoint_data) - @ivi_synchronized def write_script(self, script): r'''write_script @@ -8234,52 +8194,6 @@ def write_script(self, script): ''' self._interpreter.write_script(script) - def write_arb_waveform(self, waveform_name, waveform_data_array, more_data_pending): - '''write_arb_waveform - - Writes an arbitrary waveform to the NI-RFSG device starting at the position of the last data written in onboard memory. - - This method accepts the complex baseband data in the form of numpy array of numpy.complex64 or numpy.complex128 or interleaved numpy array of numpy.int16. If the waveform to write is already allocated using the allocate_arb_waveform method, the **MORE_DATA_PENDING** parameter is ignored. The PXI-5670/5671 must be in the Configuration state before you call this method. When streaming is enabled, this method can be called when the PXIe-5672/5673/5673E or PXIe-5820/5830/5831/5832/5840/5841/5842/5860 is in the Generation state. - - **Supported Devices** : PXIe-5644/5645/5646, PXIe-5672/5673/5673E, PXIe-5820/5830/5831/5832/5840/5841/5842/5860 - - **Related Topics** - - `Streaming `_ - - `Assigning Properties or Properties to a Waveform `_ - - Note: This method only supports PowerLevelType.PEAK mode as specified in the power_level_type property. If you download a waveform when using this method, you cannot set the power_level_type to PowerLevelType.AVERAGE without causing error in the output. - - Note: - One or more of the referenced properties are not in the Python API for this driver. - - Args: - waveform_name (str): Specifies the name used to identify the waveform. This string is case-insensitive and alphanumeric, and it does not use reserved words. - - waveform_data_array (list of ComplexViReal64): Specifies the array of data to load into the waveform. The array must have at least as many elements as the value in the **size_in_samples** parameter in the allocate_arb_waveform method. - - more_data_pending (bool): Specifies whether or not the data block contains the end of the waveform. Set this parameter to True to allow data to be appended later to the waveform. Splitting the waveform into multiple data blocks can reduce the memory requirements of the write operation. Append data to a previously written waveform by using the same waveform in the **name** parameter. Set **MORE_DATA_PENDING** to False to indicate that this data block contains the end of the waveform. If the waveform is already allocated, this parameter is ignored. - - Note: - One or more of the referenced properties are not in the Python API for this driver. - - ''' - if str(type(waveform_data_array)).find("'numpy.ndarray'") != -1: - import numpy - if waveform_data_array.dtype == numpy.complex128: - return self._write_arb_waveform_complex_f64(waveform_name, waveform_data_array, more_data_pending) - elif waveform_data_array.dtype == numpy.complex64: - return self._write_arb_waveform_complex_f32(waveform_name, waveform_data_array, more_data_pending) - elif waveform_data_array.dtype == numpy.int16: - return self._write_arb_waveform_complex_i16(waveform_name, waveform_data_array, more_data_pending) - else: - raise TypeError("Unsupported dtype. Is {}, expected {} or {} or {}".format(waveform_data_array.dtype, numpy.complex128, numpy.complex64, numpy.int16)) - else: - raise TypeError("Unsupported dtype. Is {}, expected {} or {} or {}".format(waveform_data_array.dtype, numpy.complex128, numpy.complex64, numpy.int16)) - - return self._write_arb_waveform_complex_f64(waveform_name, waveform_data_array, more_data_pending) - def _close(self): r'''_close diff --git a/src/nifake/metadata/functions.py b/src/nifake/metadata/functions.py index 4edb4fcbff..a244882ca8 100644 --- a/src/nifake/metadata/functions.py +++ b/src/nifake/metadata/functions.py @@ -2798,7 +2798,7 @@ 'returns': 'ViStatus' }, 'WriteWaveformComplexF32': { - 'codegen_method': 'private', + 'codegen_method': 'public', 'documentation': { 'description': 'A function that writes a waveform of complex64 numbers.' }, @@ -2853,7 +2853,7 @@ 'returns': 'ViStatus' }, 'WriteWaveformComplexF64': { - 'codegen_method': 'private', + 'codegen_method': 'public', 'documentation': { 'description': 'A function that writes a waveform of complex128 numbers' }, @@ -2908,7 +2908,7 @@ 'returns': 'ViStatus' }, 'WriteWaveformComplexI16': { - 'codegen_method': 'private', + 'codegen_method': 'public', 'documentation': { 'description': 'A function that writes a waveform of i16 numbers.' }, diff --git a/src/nirfsg/metadata/functions.py b/src/nirfsg/metadata/functions.py index 9fc03c560e..428a84a4c7 100644 --- a/src/nirfsg/metadata/functions.py +++ b/src/nirfsg/metadata/functions.py @@ -29,7 +29,7 @@ } ], 'returns': 'ViStatus', - 'use_session_lock': True + 'use_session_lock': False }, 'AllocateArbWaveform': { 'codegen_method': 'public', @@ -79,7 +79,7 @@ } ], 'returns': 'ViStatus', - 'use_session_lock': True + 'use_session_lock': False }, 'ChangeExternalCalibrationPassword': { 'codegen_method': 'public', @@ -129,7 +129,7 @@ } ], 'returns': 'ViStatus', - 'use_session_lock': True + 'use_session_lock': False }, 'CheckAttributeViBoolean': { 'codegen_method': 'public', @@ -190,7 +190,7 @@ } ], 'returns': 'ViStatus', - 'use_session_lock': True + 'use_session_lock': False }, 'CheckAttributeViInt32': { 'codegen_method': 'public', @@ -252,7 +252,7 @@ } ], 'returns': 'ViStatus', - 'use_session_lock': True + 'use_session_lock': False }, 'CheckAttributeViInt64': { 'codegen_method': 'public', @@ -314,7 +314,7 @@ } ], 'returns': 'ViStatus', - 'use_session_lock': True + 'use_session_lock': False }, 'CheckAttributeViReal64': { 'codegen_method': 'public', @@ -376,7 +376,7 @@ } ], 'returns': 'ViStatus', - 'use_session_lock': True + 'use_session_lock': False }, 'CheckAttributeViSession': { 'codegen_method': 'public', @@ -437,7 +437,7 @@ } ], 'returns': 'ViStatus', - 'use_session_lock': True + 'use_session_lock': False }, 'CheckAttributeViString': { 'codegen_method': 'public', @@ -499,7 +499,7 @@ } ], 'returns': 'ViStatus', - 'use_session_lock': True + 'use_session_lock': False }, 'CheckGenerationStatus': { 'codegen_method': 'public', @@ -553,7 +553,7 @@ } ], 'returns': 'ViStatus', - 'use_session_lock': True + 'use_session_lock': False }, 'CheckIfScriptExists': { 'codegen_method': 'public', @@ -617,7 +617,7 @@ } ], 'returns': 'ViStatus', - 'use_session_lock': True + 'use_session_lock': False }, 'CheckIfWaveformExists': { 'codegen_method': 'public', @@ -681,7 +681,7 @@ } ], 'returns': 'ViStatus', - 'use_session_lock': True + 'use_session_lock': False }, 'ClearAllArbWaveforms': { 'codegen_method': 'public', @@ -711,7 +711,7 @@ } ], 'returns': 'ViStatus', - 'use_session_lock': True + 'use_session_lock': False }, 'ClearArbWaveform': { 'codegen_method': 'public', @@ -751,7 +751,7 @@ } ], 'returns': 'ViStatus', - 'use_session_lock': True + 'use_session_lock': False }, 'ClearError': { 'codegen_method': 'public', @@ -782,7 +782,7 @@ } ], 'returns': 'ViStatus', - 'use_session_lock': True + 'use_session_lock': False }, 'ClearSelfCalibrateRange': { 'codegen_method': 'public', @@ -812,7 +812,7 @@ } ], 'returns': 'ViStatus', - 'use_session_lock': True + 'use_session_lock': False }, 'Commit': { 'codegen_method': 'public', @@ -842,7 +842,7 @@ } ], 'returns': 'ViStatus', - 'use_session_lock': True + 'use_session_lock': False }, 'ConfigureDeembeddingTableInterpolationLinear': { 'codegen_method': 'public', @@ -925,7 +925,7 @@ } ], 'returns': 'ViStatus', - 'use_session_lock': True + 'use_session_lock': False }, 'ConfigureDeembeddingTableInterpolationNearest': { 'codegen_method': 'public', @@ -975,7 +975,7 @@ } ], 'returns': 'ViStatus', - 'use_session_lock': True + 'use_session_lock': False }, 'ConfigureDeembeddingTableInterpolationSpline': { 'codegen_method': 'public', @@ -1025,7 +1025,7 @@ } ], 'returns': 'ViStatus', - 'use_session_lock': True + 'use_session_lock': False }, 'ConfigureDigitalEdgeScriptTrigger': { 'codegen_method': 'public', @@ -1085,7 +1085,7 @@ } ], 'returns': 'ViStatus', - 'use_session_lock': True + 'use_session_lock': False }, 'ConfigureDigitalEdgeStartTrigger': { 'codegen_method': 'public', @@ -1136,7 +1136,7 @@ } ], 'returns': 'ViStatus', - 'use_session_lock': True + 'use_session_lock': False }, 'ConfigureDigitalLevelScriptTrigger': { 'codegen_method': 'public', @@ -1196,7 +1196,7 @@ } ], 'returns': 'ViStatus', - 'use_session_lock': True + 'use_session_lock': False }, 'ConfigureDigitalModulationUserDefinedWaveform': { 'codegen_method': 'public', @@ -1250,7 +1250,7 @@ } ], 'returns': 'ViStatus', - 'use_session_lock': True + 'use_session_lock': False }, 'ConfigureGenerationMode': { 'codegen_method': 'public', @@ -1314,7 +1314,7 @@ } ], 'returns': 'ViStatus', - 'use_session_lock': True + 'use_session_lock': False }, 'ConfigureOutputEnabled': { 'codegen_method': 'public', @@ -1354,7 +1354,7 @@ } ], 'returns': 'ViStatus', - 'use_session_lock': True + 'use_session_lock': False }, 'ConfigureP2PEndpointFullnessStartTrigger': { 'codegen_method': 'public', @@ -1395,7 +1395,7 @@ } ], 'returns': 'ViStatus', - 'use_session_lock': True + 'use_session_lock': False }, 'ConfigurePowerLevelType': { 'codegen_method': 'public', @@ -1452,7 +1452,7 @@ } ], 'returns': 'ViStatus', - 'use_session_lock': True + 'use_session_lock': False }, 'ConfigurePxiChassisClk10': { 'codegen_method': 'public', @@ -1492,7 +1492,7 @@ } ], 'returns': 'ViStatus', - 'use_session_lock': True + 'use_session_lock': False }, 'ConfigureRF': { 'codegen_method': 'public', @@ -1542,7 +1542,7 @@ } ], 'returns': 'ViStatus', - 'use_session_lock': True + 'use_session_lock': False }, 'ConfigureRefClock': { 'codegen_method': 'public', @@ -1629,7 +1629,7 @@ } ], 'returns': 'ViStatus', - 'use_session_lock': True + 'use_session_lock': False }, 'ConfigureSignalBandwidth': { 'codegen_method': 'public', @@ -1670,7 +1670,7 @@ } ], 'returns': 'ViStatus', - 'use_session_lock': True + 'use_session_lock': False }, 'ConfigureSoftwareScriptTrigger': { 'codegen_method': 'public', @@ -1710,7 +1710,7 @@ } ], 'returns': 'ViStatus', - 'use_session_lock': True + 'use_session_lock': False }, 'ConfigureSoftwareStartTrigger': { 'codegen_method': 'public', @@ -1740,7 +1740,7 @@ } ], 'returns': 'ViStatus', - 'use_session_lock': True + 'use_session_lock': False }, 'CreateDeembeddingSparameterTableS2PFile': { 'codegen_method': 'public', @@ -1828,7 +1828,7 @@ } ], 'returns': 'ViStatus', - 'use_session_lock': True + 'use_session_lock': False }, 'DeleteAllDeembeddingTables': { 'codegen_method': 'public', @@ -1858,7 +1858,7 @@ } ], 'returns': 'ViStatus', - 'use_session_lock': True + 'use_session_lock': False }, 'DeleteDeembeddingTable': { 'codegen_method': 'public', @@ -1908,7 +1908,7 @@ } ], 'returns': 'ViStatus', - 'use_session_lock': True + 'use_session_lock': False }, 'Disable': { 'codegen_method': 'public', @@ -1938,7 +1938,7 @@ } ], 'returns': 'ViStatus', - 'use_session_lock': True + 'use_session_lock': False }, 'DisableScriptTrigger': { 'codegen_method': 'public', @@ -1978,7 +1978,7 @@ } ], 'returns': 'ViStatus', - 'use_session_lock': True + 'use_session_lock': False }, 'DisableStartTrigger': { 'codegen_method': 'public', @@ -2008,7 +2008,7 @@ } ], 'returns': 'ViStatus', - 'use_session_lock': True + 'use_session_lock': False }, 'ExportSignal': { 'codegen_method': 'public', @@ -2196,7 +2196,7 @@ } ], 'returns': 'ViStatus', - 'use_session_lock': True + 'use_session_lock': False }, 'GetAttributeViBoolean': { 'codegen_method': 'private', @@ -2256,7 +2256,7 @@ } ], 'returns': 'ViStatus', - 'use_session_lock': True + 'use_session_lock': False }, 'GetAttributeViInt32': { 'codegen_method': 'private', @@ -2316,7 +2316,7 @@ } ], 'returns': 'ViStatus', - 'use_session_lock': True + 'use_session_lock': False }, 'GetAttributeViInt64': { 'codegen_method': 'private', @@ -2376,7 +2376,7 @@ } ], 'returns': 'ViStatus', - 'use_session_lock': True + 'use_session_lock': False }, 'GetAttributeViReal64': { 'codegen_method': 'private', @@ -2436,7 +2436,7 @@ } ], 'returns': 'ViStatus', - 'use_session_lock': True + 'use_session_lock': False }, 'GetAttributeViSession': { 'codegen_method': 'private', @@ -2496,7 +2496,7 @@ } ], 'returns': 'ViStatus', - 'use_session_lock': True + 'use_session_lock': False }, 'GetAttributeViString': { 'codegen_method': 'private', @@ -2570,7 +2570,7 @@ } ], 'returns': 'ViStatus', - 'use_session_lock': True + 'use_session_lock': False }, 'GetError': { 'codegen_method': 'public', @@ -2727,7 +2727,7 @@ } ], 'returns': 'ViStatus', - 'use_session_lock': True + 'use_session_lock': False }, 'GetLastExtCalLastDateAndTime': { 'codegen_method': 'python-only', @@ -2758,7 +2758,7 @@ 'python_name': 'get_external_calibration_last_date_and_time', 'real_datetime_call': 'GetExternalCalibrationLastDateAndTime', 'returns': 'ViStatus', - 'use_session_lock': True + 'use_session_lock': False }, 'GetLastSelfCalLastDateAndTime': { 'codegen_method': 'python-only', @@ -2789,7 +2789,7 @@ 'python_name': 'get_self_calibration_last_date_and_time', 'real_datetime_call': 'GetSelfCalibrationDateAndTime', 'returns': 'ViStatus', - 'use_session_lock': True + 'use_session_lock': False }, 'GetMaxSettablePower': { 'codegen_method': 'public', @@ -2829,7 +2829,7 @@ } ], 'returns': 'ViStatus', - 'use_session_lock': True + 'use_session_lock': False }, 'GetSelfCalibrationDateAndTime': { 'codegen_method': 'private', @@ -2930,7 +2930,7 @@ } ], 'returns': 'ViStatus', - 'use_session_lock': True + 'use_session_lock': False }, 'GetSelfCalibrationTemperature': { 'codegen_method': 'public', @@ -3003,7 +3003,7 @@ } ], 'returns': 'ViStatus', - 'use_session_lock': True + 'use_session_lock': False }, 'GetStreamEndpointHandle': { 'codegen_method': 'public', @@ -3053,7 +3053,7 @@ } ], 'returns': 'ViStatus', - 'use_session_lock': True + 'use_session_lock': False }, 'GetWaveformBurstStartLocations': { 'codegen_method': 'private', @@ -3123,7 +3123,7 @@ } ], 'returns': 'ViStatus', - 'use_session_lock': True + 'use_session_lock': False }, 'GetWaveformBurstStopLocations': { 'codegen_method': 'private', @@ -3193,7 +3193,7 @@ } ], 'returns': 'ViStatus', - 'use_session_lock': True + 'use_session_lock': False }, 'GetWaveformMarkerEventLocations': { 'codegen_method': 'private', @@ -3263,7 +3263,7 @@ } ], 'returns': 'ViStatus', - 'use_session_lock': True + 'use_session_lock': False }, 'InitWithOptions': { 'codegen_method': 'private', @@ -3414,7 +3414,7 @@ } ], 'returns': 'ViStatus', - 'use_session_lock': True + 'use_session_lock': False }, 'LoadConfigurationsFromFile': { 'codegen_method': 'public', @@ -3464,7 +3464,7 @@ } ], 'returns': 'ViStatus', - 'use_session_lock': True + 'use_session_lock': False }, 'LockSession': { 'codegen_method': 'public', @@ -3537,7 +3537,7 @@ } ], 'returns': 'ViStatus', - 'use_session_lock': True + 'use_session_lock': False }, 'PerformThermalCorrection': { 'codegen_method': 'public', @@ -3567,7 +3567,7 @@ } ], 'returns': 'ViStatus', - 'use_session_lock': True + 'use_session_lock': False }, 'QueryArbWaveformCapabilities': { 'codegen_method': 'public', @@ -3637,7 +3637,7 @@ } ], 'returns': 'ViStatus', - 'use_session_lock': True + 'use_session_lock': False }, 'ReadAndDownloadWaveformFromFileTDMS': { 'codegen_method': 'public', @@ -3697,7 +3697,7 @@ } ], 'returns': 'ViStatus', - 'use_session_lock': True + 'use_session_lock': False }, 'Reset': { 'codegen_method': 'public', @@ -3728,7 +3728,7 @@ } ], 'returns': 'ViStatus', - 'use_session_lock': True + 'use_session_lock': False }, 'ResetAttribute': { 'codegen_method': 'public', @@ -3778,7 +3778,7 @@ } ], 'returns': 'ViStatus', - 'use_session_lock': True + 'use_session_lock': False }, 'ResetDevice': { 'codegen_method': 'public', @@ -3809,7 +3809,7 @@ } ], 'returns': 'ViStatus', - 'use_session_lock': True + 'use_session_lock': False }, 'ResetWithDefaults': { 'codegen_method': 'public', @@ -3839,7 +3839,7 @@ } ], 'returns': 'ViStatus', - 'use_session_lock': True + 'use_session_lock': False }, 'SaveConfigurationsToFile': { 'codegen_method': 'public', @@ -3889,7 +3889,7 @@ } ], 'returns': 'ViStatus', - 'use_session_lock': True + 'use_session_lock': False }, 'SelectArbWaveform': { 'codegen_method': 'public', @@ -3929,7 +3929,7 @@ } ], 'returns': 'ViStatus', - 'use_session_lock': True + 'use_session_lock': False }, 'SelfCal': { 'codegen_method': 'public', @@ -3960,7 +3960,7 @@ } ], 'returns': 'ViStatus', - 'use_session_lock': True + 'use_session_lock': False }, 'SelfCalibrateRange': { 'codegen_method': 'public', @@ -4079,7 +4079,7 @@ } ], 'returns': 'ViStatus', - 'use_session_lock': True + 'use_session_lock': False }, 'SelfTest': { 'codegen_method': 'public', @@ -4132,7 +4132,7 @@ } ], 'returns': 'ViStatus', - 'use_session_lock': True + 'use_session_lock': False }, 'SendSoftwareEdgeTrigger': { 'codegen_method': 'public', @@ -4234,7 +4234,7 @@ ], 'render_in_session_base': True, 'returns': 'ViStatus', - 'use_session_lock': True + 'use_session_lock': False }, 'SetArbWaveformNextWritePosition': { 'codegen_method': 'public', @@ -4313,7 +4313,7 @@ } ], 'returns': 'ViStatus', - 'use_session_lock': True + 'use_session_lock': False }, 'SetAttributeViBoolean': { 'codegen_method': 'private', @@ -4374,7 +4374,7 @@ } ], 'returns': 'ViStatus', - 'use_session_lock': True + 'use_session_lock': False }, 'SetAttributeViInt32': { 'codegen_method': 'private', @@ -4436,7 +4436,7 @@ } ], 'returns': 'ViStatus', - 'use_session_lock': True + 'use_session_lock': False }, 'SetAttributeViInt64': { 'codegen_method': 'private', @@ -4497,7 +4497,7 @@ } ], 'returns': 'ViStatus', - 'use_session_lock': True + 'use_session_lock': False }, 'SetAttributeViReal64': { 'codegen_method': 'private', @@ -4559,7 +4559,7 @@ } ], 'returns': 'ViStatus', - 'use_session_lock': True + 'use_session_lock': False }, 'SetAttributeViSession': { 'codegen_method': 'private', @@ -4620,7 +4620,7 @@ } ], 'returns': 'ViStatus', - 'use_session_lock': True + 'use_session_lock': False }, 'SetAttributeViString': { 'codegen_method': 'private', @@ -4682,7 +4682,7 @@ } ], 'returns': 'ViStatus', - 'use_session_lock': True + 'use_session_lock': False }, 'SetWaveformBurstStartLocations': { 'codegen_method': 'private', @@ -4742,7 +4742,7 @@ } ], 'returns': 'ViStatus', - 'use_session_lock': True + 'use_session_lock': False }, 'SetWaveformBurstStopLocations': { 'codegen_method': 'private', @@ -4802,7 +4802,7 @@ } ], 'returns': 'ViStatus', - 'use_session_lock': True + 'use_session_lock': False }, 'SetWaveformMarkerEventLocations': { 'codegen_method': 'private', @@ -4862,7 +4862,7 @@ } ], 'returns': 'ViStatus', - 'use_session_lock': True + 'use_session_lock': False }, 'UnlockSession': { 'codegen_method': 'public', @@ -4944,7 +4944,7 @@ } ], 'returns': 'ViStatus', - 'use_session_lock': True + 'use_session_lock': False }, 'WriteArbWaveformComplexF32': { 'codegen_method': 'private', @@ -5168,7 +5168,7 @@ } ], 'returns': 'ViStatus', - 'use_session_lock': True + 'use_session_lock': False }, 'WriteP2PEndpointI16': { 'codegen_method': 'public', @@ -5273,9 +5273,9 @@ } ], 'returns': 'ViStatus', - 'use_session_lock': True + 'use_session_lock': False }, - 'WriteWaveformDispatcher': { + 'WriteArbWaveformDispatcher': { 'codegen_method': 'python-only', 'documentation': { 'description': ' \n Writes an arbitrary waveform to the NI-RFSG device starting at the position of the last data written in onboard memory. \n \n This function accepts the complex baseband data in the form of numpy array of numpy.complex64 or numpy.complex128 or interleaved numpy array of numpy.int16. If the waveform to write is already allocated using the nirfsg_AllocateArbWaveform function, the **NIRFSG_ATTR_MORE_DATA_PENDING** parameter is ignored. The PXI-5670/5671 must be in the Configuration state before you call this function. When streaming is enabled, this function can be called when the PXIe-5672/5673/5673E or PXIe-5820/5830/5831/5832/5840/5841/5842/5860 is in the Generation state.\n\n **Supported Devices** : PXIe-5644/5645/5646, PXIe-5672/5673/5673E, PXIe-5820/5830/5831/5832/5840/5841/5842/5860\n\n **Related Topics**\n\n `Streaming `_\n\n `Assigning Properties or Attributes to a Waveform `_\n ', From 9d8d5349a4229fcb28933733592c1bc262ee6557 Mon Sep 17 00:00:00 2001 From: Rahul R Date: Thu, 15 May 2025 15:59:00 +0530 Subject: [PATCH 11/33] Updated the waveform type as ctype --- CHANGELOG.md | 2 +- .../nifake/unit_tests/test_library_interpreter.py | 14 ++++++++------ src/nifake/unit_tests/test_library_interpreter.py | 14 ++++++++------ 3 files changed, 17 insertions(+), 13 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fb67388c5b..43e693a0e0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1676,7 +1676,7 @@ - Basic example - Documentation for APIs (not final) - (Common) Allow functions to have parameters that take in numpy.complex types. - - Enabled write_arb_waveform funtions along with examples. + - Enabled write_arb_waveform functions along with examples. - Changed - Removed diff --git a/generated/nifake/nifake/unit_tests/test_library_interpreter.py b/generated/nifake/nifake/unit_tests/test_library_interpreter.py index 57fc2593d8..4e0af2dc93 100644 --- a/generated/nifake/nifake/unit_tests/test_library_interpreter.py +++ b/generated/nifake/nifake/unit_tests/test_library_interpreter.py @@ -852,9 +852,10 @@ def test_write_numpy_complex128_valid_input(self): waveform_data = np.full(1000, 0.707 + 0.707j, dtype=np.complex128) number_of_samples = len(waveform_data) - complex_dtype = numpy.dtype(ComplexViReal64) - structured_array = waveform_data.view(complex_dtype) - waveform_data_pointer = structured_array.ctypes.data_as(ctypes.POINTER(ComplexViReal64)) + waveform_data_ctypes = (ComplexViReal64 * number_of_samples)( + *[ComplexViReal64(real=0.707, imag=0.707) for _ in range(number_of_samples)] + ) + waveform_data_pointer = ctypes.cast(waveform_data_ctypes, ctypes.POINTER(ComplexViReal64)) self.patched_library.niFake_WriteWaveformComplexF64.side_effect = self.side_effects_helper.niFake_WriteWaveformComplexF64 interpreter = self.get_initialized_library_interpreter() interpreter.write_waveform_complex_f64(waveform_data) @@ -896,9 +897,10 @@ def test_write_interleaved_complexi16_valid_input(self): waveform_data = np.array([32767, 0] * 1000, dtype=np.int16) number_of_samples = len(waveform_data) // 2 - complex_dtype = numpy.dtype(ComplexViInt16) - structured_array = waveform_data.view(complex_dtype) - waveform_data_pointer = structured_array.ctypes.data_as(ctypes.POINTER(ComplexViInt16)) + waveform_data_ctypes = (ComplexViInt16 * number_of_samples)( + *[ComplexViInt16(real=32767, imag=0) for _ in range(number_of_samples)] + ) + waveform_data_pointer = ctypes.cast(waveform_data_ctypes, ctypes.POINTER(ComplexViInt16)) self.patched_library.niFake_WriteWaveformComplexI16.side_effect = self.side_effects_helper.niFake_WriteWaveformComplexI16 interpreter = self.get_initialized_library_interpreter() interpreter.write_waveform_complex_i16(waveform_data) diff --git a/src/nifake/unit_tests/test_library_interpreter.py b/src/nifake/unit_tests/test_library_interpreter.py index 57fc2593d8..4e0af2dc93 100644 --- a/src/nifake/unit_tests/test_library_interpreter.py +++ b/src/nifake/unit_tests/test_library_interpreter.py @@ -852,9 +852,10 @@ def test_write_numpy_complex128_valid_input(self): waveform_data = np.full(1000, 0.707 + 0.707j, dtype=np.complex128) number_of_samples = len(waveform_data) - complex_dtype = numpy.dtype(ComplexViReal64) - structured_array = waveform_data.view(complex_dtype) - waveform_data_pointer = structured_array.ctypes.data_as(ctypes.POINTER(ComplexViReal64)) + waveform_data_ctypes = (ComplexViReal64 * number_of_samples)( + *[ComplexViReal64(real=0.707, imag=0.707) for _ in range(number_of_samples)] + ) + waveform_data_pointer = ctypes.cast(waveform_data_ctypes, ctypes.POINTER(ComplexViReal64)) self.patched_library.niFake_WriteWaveformComplexF64.side_effect = self.side_effects_helper.niFake_WriteWaveformComplexF64 interpreter = self.get_initialized_library_interpreter() interpreter.write_waveform_complex_f64(waveform_data) @@ -896,9 +897,10 @@ def test_write_interleaved_complexi16_valid_input(self): waveform_data = np.array([32767, 0] * 1000, dtype=np.int16) number_of_samples = len(waveform_data) // 2 - complex_dtype = numpy.dtype(ComplexViInt16) - structured_array = waveform_data.view(complex_dtype) - waveform_data_pointer = structured_array.ctypes.data_as(ctypes.POINTER(ComplexViInt16)) + waveform_data_ctypes = (ComplexViInt16 * number_of_samples)( + *[ComplexViInt16(real=32767, imag=0) for _ in range(number_of_samples)] + ) + waveform_data_pointer = ctypes.cast(waveform_data_ctypes, ctypes.POINTER(ComplexViInt16)) self.patched_library.niFake_WriteWaveformComplexI16.side_effect = self.side_effects_helper.niFake_WriteWaveformComplexI16 interpreter = self.get_initialized_library_interpreter() interpreter.write_waveform_complex_i16(waveform_data) From a68993406dae82c181006f655ed0a5b0dc27c578 Mon Sep 17 00:00:00 2001 From: Rahul R Date: Thu, 15 May 2025 16:53:17 +0530 Subject: [PATCH 12/33] Updated the seesion lock parameter for new arb functions --- docs/nirfsg/class.rst | 70 +++++----- generated/nirfsg/nirfsg/_library.py | 6 +- .../nirfsg/nirfsg/_library_interpreter.py | 24 ++-- generated/nirfsg/nirfsg/session.py | 128 +++++++++--------- .../nirfsg/nirfsg/unit_tests/_mock_helper.py | 18 +++ src/nirfsg/metadata/functions.py | 14 +- 6 files changed, 141 insertions(+), 119 deletions(-) diff --git a/docs/nirfsg/class.rst b/docs/nirfsg/class.rst index 1c95152500..ff330c8342 100644 --- a/docs/nirfsg/class.rst +++ b/docs/nirfsg/class.rst @@ -3,7 +3,7 @@ Session ======= -.. py:class:: Session(self, resource_name, options={}, id_query=False, reset_device=False) +.. py:class:: Session(self, resource_name, id_query, reset_device, options={}) @@ -41,40 +41,6 @@ Session :type resource_name: str - :param options: - - - Specifies the initial value of certain properties for the session. The - syntax for **options** is a dictionary of properties with an assigned - value. For example: - - { 'simulate': False } - - You do not have to specify a value for all the properties. If you do not - specify a value for a property, the default value is used. - - Advanced Example: - { 'simulate': True, 'driver_setup': { 'Model': '', 'BoardType': '' } } - - +-------------------------+---------+ - | Property | Default | - +=========================+=========+ - | range_check | True | - +-------------------------+---------+ - | query_instrument_status | False | - +-------------------------+---------+ - | cache | True | - +-------------------------+---------+ - | simulate | False | - +-------------------------+---------+ - | record_value_coersions | False | - +-------------------------+---------+ - | driver_setup | {} | - +-------------------------+---------+ - - - :type options: str - :param id_query: @@ -111,6 +77,40 @@ Session :type reset_device: bool + :param options: + + + Specifies the initial value of certain properties for the session. The + syntax for **options** is a dictionary of properties with an assigned + value. For example: + + { 'simulate': False } + + You do not have to specify a value for all the properties. If you do not + specify a value for a property, the default value is used. + + Advanced Example: + { 'simulate': True, 'driver_setup': { 'Model': '', 'BoardType': '' } } + + +-------------------------+---------+ + | Property | Default | + +=========================+=========+ + | range_check | True | + +-------------------------+---------+ + | query_instrument_status | False | + +-------------------------+---------+ + | cache | True | + +-------------------------+---------+ + | simulate | False | + +-------------------------+---------+ + | record_value_coersions | False | + +-------------------------+---------+ + | driver_setup | {} | + +-------------------------+---------+ + + + :type options: str + Methods ======= diff --git a/generated/nirfsg/nirfsg/_library.py b/generated/nirfsg/nirfsg/_library.py index 8cf649cf15..6244f88d68 100644 --- a/generated/nirfsg/nirfsg/_library.py +++ b/generated/nirfsg/nirfsg/_library.py @@ -772,7 +772,7 @@ def niRFSG_SetWaveformBurstStartLocations(self, vi, channel_name, number_of_loca with self._func_lock: if self.niRFSG_SetWaveformBurstStartLocations_cfunc is None: self.niRFSG_SetWaveformBurstStartLocations_cfunc = self._get_library_function('niRFSG_SetWaveformBurstStartLocations') - self.niRFSG_SetWaveformBurstStartLocations_cfunc.argtypes = [ViSession, ctypes.POINTER(ViChar), ViInt32, ViReal64] # noqa: F405 + self.niRFSG_SetWaveformBurstStartLocations_cfunc.argtypes = [ViSession, ctypes.POINTER(ViChar), ViInt32, ctypes.POINTER(ViReal64)] # noqa: F405 self.niRFSG_SetWaveformBurstStartLocations_cfunc.restype = ViStatus # noqa: F405 return self.niRFSG_SetWaveformBurstStartLocations_cfunc(vi, channel_name, number_of_locations, locations) @@ -780,7 +780,7 @@ def niRFSG_SetWaveformBurstStopLocations(self, vi, channel_name, number_of_locat with self._func_lock: if self.niRFSG_SetWaveformBurstStopLocations_cfunc is None: self.niRFSG_SetWaveformBurstStopLocations_cfunc = self._get_library_function('niRFSG_SetWaveformBurstStopLocations') - self.niRFSG_SetWaveformBurstStopLocations_cfunc.argtypes = [ViSession, ctypes.POINTER(ViChar), ViInt32, ViReal64] # noqa: F405 + self.niRFSG_SetWaveformBurstStopLocations_cfunc.argtypes = [ViSession, ctypes.POINTER(ViChar), ViInt32, ctypes.POINTER(ViReal64)] # noqa: F405 self.niRFSG_SetWaveformBurstStopLocations_cfunc.restype = ViStatus # noqa: F405 return self.niRFSG_SetWaveformBurstStopLocations_cfunc(vi, channel_name, number_of_locations, locations) @@ -788,7 +788,7 @@ def niRFSG_SetWaveformMarkerEventLocations(self, vi, channel_name, number_of_loc with self._func_lock: if self.niRFSG_SetWaveformMarkerEventLocations_cfunc is None: self.niRFSG_SetWaveformMarkerEventLocations_cfunc = self._get_library_function('niRFSG_SetWaveformMarkerEventLocations') - self.niRFSG_SetWaveformMarkerEventLocations_cfunc.argtypes = [ViSession, ctypes.POINTER(ViChar), ViInt32, ViReal64] # noqa: F405 + self.niRFSG_SetWaveformMarkerEventLocations_cfunc.argtypes = [ViSession, ctypes.POINTER(ViChar), ViInt32, ctypes.POINTER(ViReal64)] # noqa: F405 self.niRFSG_SetWaveformMarkerEventLocations_cfunc.restype = ViStatus # noqa: F405 return self.niRFSG_SetWaveformMarkerEventLocations_cfunc(vi, channel_name, number_of_locations, locations) diff --git a/generated/nirfsg/nirfsg/_library_interpreter.py b/generated/nirfsg/nirfsg/_library_interpreter.py index 53324c5c33..d68c63410b 100644 --- a/generated/nirfsg/nirfsg/_library_interpreter.py +++ b/generated/nirfsg/nirfsg/_library_interpreter.py @@ -746,32 +746,32 @@ def set_attribute_vi_string(self, channel_name, attribute, value): # noqa: N802 errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) return - def set_waveform_burst_start_locations(self, channel_name, number_of_locations, locations): # noqa: N802 + def set_waveform_burst_start_locations(self, channel_name, number_of_locations): # noqa: N802 vi_ctype = _visatype.ViSession(self._vi) # case S110 channel_name_ctype = ctypes.create_string_buffer(channel_name.encode(self._encoding)) # case C010 number_of_locations_ctype = _visatype.ViInt32(number_of_locations) # case S150 - locations_ctype = _visatype.ViReal64(locations) # case S150 - error_code = self._library.niRFSG_SetWaveformBurstStartLocations(vi_ctype, channel_name_ctype, number_of_locations_ctype, locations_ctype) + locations_ctype = _visatype.ViReal64() # case S220 + error_code = self._library.niRFSG_SetWaveformBurstStartLocations(vi_ctype, channel_name_ctype, number_of_locations_ctype, None if locations_ctype is None else (ctypes.pointer(locations_ctype))) errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) - return + return float(locations_ctype.value) - def set_waveform_burst_stop_locations(self, channel_name, number_of_locations, locations): # noqa: N802 + def set_waveform_burst_stop_locations(self, channel_name, number_of_locations): # noqa: N802 vi_ctype = _visatype.ViSession(self._vi) # case S110 channel_name_ctype = ctypes.create_string_buffer(channel_name.encode(self._encoding)) # case C010 number_of_locations_ctype = _visatype.ViInt32(number_of_locations) # case S150 - locations_ctype = _visatype.ViReal64(locations) # case S150 - error_code = self._library.niRFSG_SetWaveformBurstStopLocations(vi_ctype, channel_name_ctype, number_of_locations_ctype, locations_ctype) + locations_ctype = _visatype.ViReal64() # case S220 + error_code = self._library.niRFSG_SetWaveformBurstStopLocations(vi_ctype, channel_name_ctype, number_of_locations_ctype, None if locations_ctype is None else (ctypes.pointer(locations_ctype))) errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) - return + return float(locations_ctype.value) - def set_waveform_marker_event_locations(self, channel_name, number_of_locations, locations): # noqa: N802 + def set_waveform_marker_event_locations(self, channel_name, number_of_locations): # noqa: N802 vi_ctype = _visatype.ViSession(self._vi) # case S110 channel_name_ctype = ctypes.create_string_buffer(channel_name.encode(self._encoding)) # case C010 number_of_locations_ctype = _visatype.ViInt32(number_of_locations) # case S150 - locations_ctype = _visatype.ViReal64(locations) # case S150 - error_code = self._library.niRFSG_SetWaveformMarkerEventLocations(vi_ctype, channel_name_ctype, number_of_locations_ctype, locations_ctype) + locations_ctype = _visatype.ViReal64() # case S220 + error_code = self._library.niRFSG_SetWaveformMarkerEventLocations(vi_ctype, channel_name_ctype, number_of_locations_ctype, None if locations_ctype is None else (ctypes.pointer(locations_ctype))) errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) - return + return float(locations_ctype.value) def unlock(self): # noqa: N802 vi_ctype = _visatype.ViSession(self._vi) # case S110 diff --git a/generated/nirfsg/nirfsg/session.py b/generated/nirfsg/nirfsg/session.py index aff8c810e5..08a8796765 100644 --- a/generated/nirfsg/nirfsg/session.py +++ b/generated/nirfsg/nirfsg/session.py @@ -6273,7 +6273,7 @@ def _set_attribute_vi_string(self, attribute, value): ''' self._interpreter.set_attribute_vi_string(self._repeated_capability, attribute, value) - def _set_waveform_burst_start_locations(self, number_of_locations, locations): + def _set_waveform_burst_start_locations(self, number_of_locations): r'''_set_waveform_burst_start_locations Configures the start location of the burst in samples where the burst refers to the active portion of a waveform. @@ -6294,15 +6294,18 @@ def _set_waveform_burst_start_locations(self, number_of_locations, locations): Args: number_of_locations (int): Specifies the size of the burst start locations array. + + Returns: locations (float): Returns the burst start locations stored in the NI-RFSG session for the waveform that you specified in the **CHANNEL_NAME** parameter. This value is expressed in samples. Note: One or more of the referenced properties are not in the Python API for this driver. ''' - self._interpreter.set_waveform_burst_start_locations(self._repeated_capability, number_of_locations, locations) + locations = self._interpreter.set_waveform_burst_start_locations(self._repeated_capability, number_of_locations) + return locations - def _set_waveform_burst_stop_locations(self, number_of_locations, locations): + def _set_waveform_burst_stop_locations(self, number_of_locations): r'''_set_waveform_burst_stop_locations Configures the stop location of the burst in samples where the burst refers to the active portion of a waveform. @@ -6323,12 +6326,15 @@ def _set_waveform_burst_stop_locations(self, number_of_locations, locations): Args: number_of_locations (int): Specifies the size of the burst stop locations array. + + Returns: locations (float): Specifies the burst stop locations, in samples, to store in the NI-RFSG session. ''' - self._interpreter.set_waveform_burst_stop_locations(self._repeated_capability, number_of_locations, locations) + locations = self._interpreter.set_waveform_burst_stop_locations(self._repeated_capability, number_of_locations) + return locations - def _set_waveform_marker_event_locations(self, number_of_locations, locations): + def _set_waveform_marker_event_locations(self, number_of_locations): r'''_set_waveform_marker_event_locations Configures the marker locations associated with waveform and marker in the NI-RFSG session. @@ -6349,10 +6355,13 @@ def _set_waveform_marker_event_locations(self, number_of_locations, locations): Args: number_of_locations (int): Specifies the size of the locations array. + + Returns: locations (float): Specifies the marker location, in samples, to store in the NI-RFSG database. ''' - self._interpreter.set_waveform_marker_event_locations(self._repeated_capability, number_of_locations, locations) + locations = self._interpreter.set_waveform_marker_event_locations(self._repeated_capability, number_of_locations) + return locations def unlock(self): '''unlock @@ -6367,7 +6376,7 @@ def unlock(self): class Session(_SessionBase): '''An NI-RFSG session to the NI-RFSG driver''' - def __init__(self, resource_name, options={}, id_query=False, reset_device=False): + def __init__(self, resource_name, id_query, reset_device, options={}): r'''An NI-RFSG session to the NI-RFSG driver Opens a session to the device you specify as the **RESOURCE_NAME** and returns a ViSession handle that you use to identify the NI-RFSG device in all subsequent NI-RFSG method calls. @@ -6394,6 +6403,30 @@ def __init__(self, resource_name, options={}, id_query=False, reset_device=False Note: NI-RFSG device names are not case-sensitive. However, all IVI names, such as logical names, are case-sensitive. If you use an IVI logical name, make sure the name is identical to the name shown in the IVI Configuration Utility. + id_query (bool): Specifies whether you want NI-RFSG to perform an ID query. + + **Defined Values** : + + +-----------+--------------------------+ + | Value | Description | + +===========+==========================+ + | True (1) | Perform ID query. | + +-----------+--------------------------+ + | False (0) | Do not perform ID query. | + +-----------+--------------------------+ + + reset_device (bool): Specifies whether you want to reset the NI-RFSG device during the initialization procedure. + + **Defined Values** : + + +-----------+----------------------+ + | Value | Description | + +===========+======================+ + | True (1) | Reset device. | + +-----------+----------------------+ + | False (0) | Do not reset device. | + +-----------+----------------------+ + options (str): Specifies the initial value of certain properties for the session. The syntax for **options** is a dictionary of properties with an assigned value. For example: @@ -6422,30 +6455,6 @@ def __init__(self, resource_name, options={}, id_query=False, reset_device=False | driver_setup | {} | +-------------------------+---------+ - id_query (bool): Specifies whether you want NI-RFSG to perform an ID query. - - **Defined Values** : - - +-----------+--------------------------+ - | Value | Description | - +===========+==========================+ - | True (1) | Perform ID query. | - +-----------+--------------------------+ - | False (0) | Do not perform ID query. | - +-----------+--------------------------+ - - reset_device (bool): Specifies whether you want to reset the NI-RFSG device during the initialization procedure. - - **Defined Values** : - - +-----------+----------------------+ - | Value | Description | - +===========+======================+ - | True (1) | Reset device. | - +-----------+----------------------+ - | False (0) | Do not reset device. | - +-----------+----------------------+ - Returns: new_vi (int): Returns a ViSession handle that you use to identify the NI-RFSG device in all subsequent NI-RFSG method calls. @@ -6466,16 +6475,16 @@ def __init__(self, resource_name, options={}, id_query=False, reset_device=False # if _init_with_options fails, the error handler can reference it. # And then here, once _init_with_options succeeds, we call set_session_handle # with the actual session handle. - self._interpreter.set_session_handle(self._init_with_options(resource_name, options, id_query, reset_device)) + self._interpreter.set_session_handle(self._init_with_options(resource_name, id_query, reset_device, options)) self.tclk = nitclk.SessionReference(self._interpreter.get_session_handle()) # Store the parameter list for later printing in __repr__ param_list = [] param_list.append("resource_name=" + pp.pformat(resource_name)) - param_list.append("options=" + pp.pformat(options)) param_list.append("id_query=" + pp.pformat(id_query)) param_list.append("reset_device=" + pp.pformat(reset_device)) + param_list.append("options=" + pp.pformat(options)) self._param_list = ', '.join(param_list) # Store the list of channels in the Session which is needed by some nimi-python modules. @@ -7549,7 +7558,7 @@ def get_stream_endpoint_handle(self, stream_endpoint): reader_handle = self._interpreter.get_stream_endpoint_handle(stream_endpoint) return reader_handle - def _init_with_options(self, resource_name, option_string, id_query=False, reset_device=False): + def _init_with_options(self, resource_name, id_query, reset_device, option_string): r'''_init_with_options Opens a session to the device you specify as the **RESOURCE_NAME** and returns a ViSession handle that you use to identify the NI-RFSG device in all subsequent NI-RFSG method calls. @@ -7576,6 +7585,30 @@ def _init_with_options(self, resource_name, option_string, id_query=False, reset Note: NI-RFSG device names are not case-sensitive. However, all IVI names, such as logical names, are case-sensitive. If you use an IVI logical name, make sure the name is identical to the name shown in the IVI Configuration Utility. + id_query (bool): Specifies whether you want NI-RFSG to perform an ID query. + + **Defined Values** : + + +-----------+--------------------------+ + | Value | Description | + +===========+==========================+ + | True (1) | Perform ID query. | + +-----------+--------------------------+ + | False (0) | Do not perform ID query. | + +-----------+--------------------------+ + + reset_device (bool): Specifies whether you want to reset the NI-RFSG device during the initialization procedure. + + **Defined Values** : + + +-----------+----------------------+ + | Value | Description | + +===========+======================+ + | True (1) | Reset device. | + +-----------+----------------------+ + | False (0) | Do not reset device. | + +-----------+----------------------+ + option_string (str): Specifies the initial value of certain properties for the session. The following table lists the properties and the name you pass in this parameter to identify the property. The format of this string consists of the following relations: @@ -7602,30 +7635,6 @@ def _init_with_options(self, resource_name, option_string, id_query=False, reset | Simulate | simulate | +------------------+-------------------------+ - id_query (bool): Specifies whether you want NI-RFSG to perform an ID query. - - **Defined Values** : - - +-----------+--------------------------+ - | Value | Description | - +===========+==========================+ - | True (1) | Perform ID query. | - +-----------+--------------------------+ - | False (0) | Do not perform ID query. | - +-----------+--------------------------+ - - reset_device (bool): Specifies whether you want to reset the NI-RFSG device during the initialization procedure. - - **Defined Values** : - - +-----------+----------------------+ - | Value | Description | - +===========+======================+ - | True (1) | Reset device. | - +-----------+----------------------+ - | False (0) | Do not reset device. | - +-----------+----------------------+ - Returns: new_vi (int): Returns a ViSession handle that you use to identify the NI-RFSG device in all subsequent NI-RFSG method calls. @@ -7981,7 +7990,6 @@ def wait_until_settled(self, max_time_milliseconds): ''' self._interpreter.wait_until_settled(max_time_milliseconds) - @ivi_synchronized def _write_arb_waveform_complex_f32(self, waveform_name, waveform_data_array, more_data_pending): r'''_write_arb_waveform_complex_f32 @@ -8023,7 +8031,6 @@ def _write_arb_waveform_complex_f32(self, waveform_name, waveform_data_array, mo raise TypeError('waveform_data_array must be numpy.ndarray of dtype=complex64, is ' + str(waveform_data_array.dtype)) self._interpreter.write_arb_waveform_complex_f32(waveform_name, waveform_data_array, more_data_pending) - @ivi_synchronized def _write_arb_waveform_complex_f64(self, waveform_name, waveform_data_array, more_data_pending): r'''_write_arb_waveform_complex_f64 @@ -8141,7 +8148,6 @@ def write_arb_waveform(self, waveform_name, waveform_data_array, more_data_pendi return self._write_arb_waveform_complex_f64(waveform_name, waveform_data_array, more_data_pending) - @ivi_synchronized def write_p2_p_endpoint_i16(self, stream_endpoint, number_of_samples, endpoint_data): r'''write_p2_p_endpoint_i16 diff --git a/generated/nirfsg/nirfsg/unit_tests/_mock_helper.py b/generated/nirfsg/nirfsg/unit_tests/_mock_helper.py index ebe26d5930..9568297dae 100644 --- a/generated/nirfsg/nirfsg/unit_tests/_mock_helper.py +++ b/generated/nirfsg/nirfsg/unit_tests/_mock_helper.py @@ -219,10 +219,13 @@ def __init__(self): self._defaults['SetAttributeViString']['return'] = 0 self._defaults['SetWaveformBurstStartLocations'] = {} self._defaults['SetWaveformBurstStartLocations']['return'] = 0 + self._defaults['SetWaveformBurstStartLocations']['locations'] = None self._defaults['SetWaveformBurstStopLocations'] = {} self._defaults['SetWaveformBurstStopLocations']['return'] = 0 + self._defaults['SetWaveformBurstStopLocations']['locations'] = None self._defaults['SetWaveformMarkerEventLocations'] = {} self._defaults['SetWaveformMarkerEventLocations']['return'] = 0 + self._defaults['SetWaveformMarkerEventLocations']['locations'] = None self._defaults['UnlockSession'] = {} self._defaults['UnlockSession']['return'] = 0 self._defaults['UnlockSession']['callerHasLock'] = None @@ -852,16 +855,31 @@ def niRFSG_SetAttributeViString(self, vi, channel_name, attribute, value): # no def niRFSG_SetWaveformBurstStartLocations(self, vi, channel_name, number_of_locations, locations): # noqa: N802 if self._defaults['SetWaveformBurstStartLocations']['return'] != 0: return self._defaults['SetWaveformBurstStartLocations']['return'] + # locations + if self._defaults['SetWaveformBurstStartLocations']['locations'] is None: + raise MockFunctionCallError("niRFSG_SetWaveformBurstStartLocations", param='locations') + if locations is not None: + locations.contents.value = self._defaults['SetWaveformBurstStartLocations']['locations'] return self._defaults['SetWaveformBurstStartLocations']['return'] def niRFSG_SetWaveformBurstStopLocations(self, vi, channel_name, number_of_locations, locations): # noqa: N802 if self._defaults['SetWaveformBurstStopLocations']['return'] != 0: return self._defaults['SetWaveformBurstStopLocations']['return'] + # locations + if self._defaults['SetWaveformBurstStopLocations']['locations'] is None: + raise MockFunctionCallError("niRFSG_SetWaveformBurstStopLocations", param='locations') + if locations is not None: + locations.contents.value = self._defaults['SetWaveformBurstStopLocations']['locations'] return self._defaults['SetWaveformBurstStopLocations']['return'] def niRFSG_SetWaveformMarkerEventLocations(self, vi, channel_name, number_of_locations, locations): # noqa: N802 if self._defaults['SetWaveformMarkerEventLocations']['return'] != 0: return self._defaults['SetWaveformMarkerEventLocations']['return'] + # locations + if self._defaults['SetWaveformMarkerEventLocations']['locations'] is None: + raise MockFunctionCallError("niRFSG_SetWaveformMarkerEventLocations", param='locations') + if locations is not None: + locations.contents.value = self._defaults['SetWaveformMarkerEventLocations']['locations'] return self._defaults['SetWaveformMarkerEventLocations']['return'] def niRFSG_UnlockSession(self, vi, caller_has_lock): # noqa: N802 diff --git a/src/nirfsg/metadata/functions.py b/src/nirfsg/metadata/functions.py index 428a84a4c7..27ad151c57 100644 --- a/src/nirfsg/metadata/functions.py +++ b/src/nirfsg/metadata/functions.py @@ -3295,7 +3295,6 @@ 'use_in_python_api': True }, { - 'default_value': False, 'direction': 'in', 'documentation': { 'description': ' Specifies whether you want NI-RFSG to perform an ID query.\n\n **Defined Values** :\n ', @@ -3320,7 +3319,6 @@ 'use_in_python_api': True }, { - 'default_value': False, 'direction': 'in', 'documentation': { 'description': ' Specifies whether you want to reset the NI-RFSG device during the initialization procedure.\n\n **Defined Values** :\n\n ', @@ -4731,7 +4729,7 @@ 'use_in_python_api': True }, { - 'direction': 'in', + 'direction': 'out', 'documentation': { 'description': 'Returns the burst start locations stored in the NI-RFSG session for the waveform that you specified in the **NIRFSG_ATTR_CHANNEL_NAME** parameter. This value is expressed in samples.' }, @@ -4791,7 +4789,7 @@ 'use_in_python_api': True }, { - 'direction': 'in', + 'direction': 'out', 'documentation': { 'description': 'Specifies the burst stop locations, in samples, to store in the NI-RFSG session.' }, @@ -4851,7 +4849,7 @@ 'use_in_python_api': True }, { - 'direction': 'in', + 'direction': 'out', 'documentation': { 'description': 'Specifies the marker location, in samples, to store in the NI-RFSG database.' }, @@ -5022,7 +5020,7 @@ } ], 'returns': 'ViStatus', - 'use_session_lock': True + 'use_session_lock': False }, 'WriteArbWaveformComplexF64': { 'codegen_method': 'private', @@ -5100,7 +5098,7 @@ } ], 'returns': 'ViStatus', - 'use_session_lock': True + 'use_session_lock': False }, 'WriteArbWaveformComplexI16': { 'codegen_method': 'private', @@ -5232,7 +5230,7 @@ } ], 'returns': 'ViStatus', - 'use_session_lock': True + 'use_session_lock': False }, 'WriteScript': { 'codegen_method': 'public', From 7466bfd4a28d92d1683b16dbb4de2e57feb55ed5 Mon Sep 17 00:00:00 2001 From: Rahul R Date: Fri, 30 May 2025 12:39:35 +0530 Subject: [PATCH 13/33] Updated Code Review comments --- CHANGELOG.md | 10 ---------- build/helper/codegen_helper.py | 2 +- build/templates/_library_interpreter.py.mako | 8 ++++---- .../nidcpower/nidcpower/_library_interpreter.py | 8 ++++---- .../nidigital/nidigital/_library_interpreter.py | 8 ++++---- generated/nidmm/nidmm/_library_interpreter.py | 8 ++++---- generated/nifake/nifake/_library_interpreter.py | 14 +++++++------- generated/nifgen/nifgen/_library_interpreter.py | 8 ++++---- .../nimodinst/nimodinst/_library_interpreter.py | 8 ++++---- generated/nirfsg/nirfsg/_library_interpreter.py | 14 +++++++------- generated/niscope/niscope/_library_interpreter.py | 8 ++++---- generated/nise/nise/_library_interpreter.py | 8 ++++---- .../niswitch/niswitch/_library_interpreter.py | 8 ++++---- generated/nitclk/nitclk/_library_interpreter.py | 8 ++++---- 14 files changed, 55 insertions(+), 65 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 43e693a0e0..94efb797c8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -49,7 +49,6 @@ #### [nidcpower] Unreleased - Added - - (Common) Allow functions to have parameters that take in numpy.complex types. - Changed - Removed @@ -523,7 +522,6 @@ #### [nidigital] Unreleased - Added - - (Common) Allow functions to have parameters that take in numpy.complex types. - Changed - Removed @@ -757,7 +755,6 @@ #### [nidmm] Unreleased - Added - - (Common) Allow functions to have parameters that take in numpy.complex types. - Changed - Removed @@ -1073,7 +1070,6 @@ #### [nifgen] Unreleased - Added - - (Common) Allow functions to have parameters that take in numpy.complex types. - Changed - Removed @@ -1450,7 +1446,6 @@ #### [nimodinst] Unreleased - Added - - (Common) Allow functions to have parameters that take in numpy.complex types. - Changed - Removed @@ -1675,7 +1670,6 @@ - Enabled selected public APIs - Basic example - Documentation for APIs (not final) - - (Common) Allow functions to have parameters that take in numpy.complex types. - Enabled write_arb_waveform functions along with examples. - Changed - Removed @@ -1710,7 +1704,6 @@ #### [niscope] Unreleased - Added - - (Common) Allow functions to have parameters that take in numpy.complex types. - Changed - Removed @@ -2149,7 +2142,6 @@ - [0.1.0](#nise-010---2018-10-17) - Added - - (Common) Allow functions to have parameters that take in numpy.complex types. - Changed - Removed @@ -2305,7 +2297,6 @@ - [0.2.0](#niswitch-020---2017-09-20) - Added - - (Common) Allow functions to have parameters that take in numpy.complex types. - Changed - Removed @@ -2556,7 +2547,6 @@ - [0.1.0](#nitclk-010---2019-10-21) - Added - - (Common) Allow functions to have parameters that take in numpy.complex types. - Changed - Removed diff --git a/build/helper/codegen_helper.py b/build/helper/codegen_helper.py index b6e3ff3716..33ab3f09f7 100644 --- a/build/helper/codegen_helper.py +++ b/build/helper/codegen_helper.py @@ -438,7 +438,7 @@ def _get_ctype_variable_definition_snippet_for_buffers(parameter, parameters, iv if parameter['complex_type'] == 'none': definition = '_get_ctypes_pointer_for_buffer(value={}) # case B510'.format(parameter['python_name']) else: - definition = '_get_ctypes_pointer_for_buffer(value={}, library_type={}.{}, complex_type=\'{}\') # case B510'.format(parameter['python_name'], module_name, parameter['ctypes_type'], parameter['complex_type']) + definition = '_get_ctypes_pointer_for_buffer(value={}, library_type={}.{}) # case B510'.format(parameter['python_name'], module_name, parameter['ctypes_type']) elif parameter['direction'] == 'in': if custom_type is not None: definition = '_get_ctypes_pointer_for_buffer([{0}.{1}(c) for c in {2}], library_type={0}.{1}) # case B540'.format(module_name, parameter['ctypes_type'], parameter['python_name']) diff --git a/build/templates/_library_interpreter.py.mako b/build/templates/_library_interpreter.py.mako index 9330fa0e61..aad6da6373 100644 --- a/build/templates/_library_interpreter.py.mako +++ b/build/templates/_library_interpreter.py.mako @@ -40,19 +40,19 @@ _was_runtime_environment_set = None % endif # Helper functions for creating ctypes needed for calling into the driver DLL -def _get_ctypes_pointer_for_buffer(value=None, library_type=None, size=None, complex_type='none'): +def _get_ctypes_pointer_for_buffer(value=None, library_type=None, size=None): if isinstance(value, array.array): assert library_type is not None, 'library_type is required for array.array' addr, _ = value.buffer_info() return ctypes.cast(addr, ctypes.POINTER(library_type)) elif str(type(value)).find("'numpy.ndarray'") != -1: import numpy - if complex_type == 'none': - return numpy.ctypeslib.as_ctypes(value) - else: + if library_type in (_complextype.ComplexViInt16, _complextype.ComplexViReal32, _complextype.ComplexViReal64): complex_dtype = numpy.dtype(library_type) structured_array = value.view(complex_dtype) return structured_array.ctypes.data_as(ctypes.POINTER(library_type)) + else: + return numpy.ctypeslib.as_ctypes(value) elif isinstance(value, bytes): return ctypes.cast(value, ctypes.POINTER(library_type)) elif isinstance(value, list): diff --git a/generated/nidcpower/nidcpower/_library_interpreter.py b/generated/nidcpower/nidcpower/_library_interpreter.py index 27312a0f2c..da33986c7c 100644 --- a/generated/nidcpower/nidcpower/_library_interpreter.py +++ b/generated/nidcpower/nidcpower/_library_interpreter.py @@ -21,19 +21,19 @@ # Helper functions for creating ctypes needed for calling into the driver DLL -def _get_ctypes_pointer_for_buffer(value=None, library_type=None, size=None, complex_type='none'): +def _get_ctypes_pointer_for_buffer(value=None, library_type=None, size=None): if isinstance(value, array.array): assert library_type is not None, 'library_type is required for array.array' addr, _ = value.buffer_info() return ctypes.cast(addr, ctypes.POINTER(library_type)) elif str(type(value)).find("'numpy.ndarray'") != -1: import numpy - if complex_type == 'none': - return numpy.ctypeslib.as_ctypes(value) - else: + if library_type in (_complextype.ComplexViInt16, _complextype.ComplexViReal32, _complextype.ComplexViReal64): complex_dtype = numpy.dtype(library_type) structured_array = value.view(complex_dtype) return structured_array.ctypes.data_as(ctypes.POINTER(library_type)) + else: + return numpy.ctypeslib.as_ctypes(value) elif isinstance(value, bytes): return ctypes.cast(value, ctypes.POINTER(library_type)) elif isinstance(value, list): diff --git a/generated/nidigital/nidigital/_library_interpreter.py b/generated/nidigital/nidigital/_library_interpreter.py index d58f0c2cd1..78d56b4601 100644 --- a/generated/nidigital/nidigital/_library_interpreter.py +++ b/generated/nidigital/nidigital/_library_interpreter.py @@ -19,19 +19,19 @@ # Helper functions for creating ctypes needed for calling into the driver DLL -def _get_ctypes_pointer_for_buffer(value=None, library_type=None, size=None, complex_type='none'): +def _get_ctypes_pointer_for_buffer(value=None, library_type=None, size=None): if isinstance(value, array.array): assert library_type is not None, 'library_type is required for array.array' addr, _ = value.buffer_info() return ctypes.cast(addr, ctypes.POINTER(library_type)) elif str(type(value)).find("'numpy.ndarray'") != -1: import numpy - if complex_type == 'none': - return numpy.ctypeslib.as_ctypes(value) - else: + if library_type in (_complextype.ComplexViInt16, _complextype.ComplexViReal32, _complextype.ComplexViReal64): complex_dtype = numpy.dtype(library_type) structured_array = value.view(complex_dtype) return structured_array.ctypes.data_as(ctypes.POINTER(library_type)) + else: + return numpy.ctypeslib.as_ctypes(value) elif isinstance(value, bytes): return ctypes.cast(value, ctypes.POINTER(library_type)) elif isinstance(value, list): diff --git a/generated/nidmm/nidmm/_library_interpreter.py b/generated/nidmm/nidmm/_library_interpreter.py index c47328f958..0f517dd222 100644 --- a/generated/nidmm/nidmm/_library_interpreter.py +++ b/generated/nidmm/nidmm/_library_interpreter.py @@ -17,19 +17,19 @@ # Helper functions for creating ctypes needed for calling into the driver DLL -def _get_ctypes_pointer_for_buffer(value=None, library_type=None, size=None, complex_type='none'): +def _get_ctypes_pointer_for_buffer(value=None, library_type=None, size=None): if isinstance(value, array.array): assert library_type is not None, 'library_type is required for array.array' addr, _ = value.buffer_info() return ctypes.cast(addr, ctypes.POINTER(library_type)) elif str(type(value)).find("'numpy.ndarray'") != -1: import numpy - if complex_type == 'none': - return numpy.ctypeslib.as_ctypes(value) - else: + if library_type in (_complextype.ComplexViInt16, _complextype.ComplexViReal32, _complextype.ComplexViReal64): complex_dtype = numpy.dtype(library_type) structured_array = value.view(complex_dtype) return structured_array.ctypes.data_as(ctypes.POINTER(library_type)) + else: + return numpy.ctypeslib.as_ctypes(value) elif isinstance(value, bytes): return ctypes.cast(value, ctypes.POINTER(library_type)) elif isinstance(value, list): diff --git a/generated/nifake/nifake/_library_interpreter.py b/generated/nifake/nifake/_library_interpreter.py index e6c9eca77d..c88cbc632f 100644 --- a/generated/nifake/nifake/_library_interpreter.py +++ b/generated/nifake/nifake/_library_interpreter.py @@ -23,19 +23,19 @@ # Helper functions for creating ctypes needed for calling into the driver DLL -def _get_ctypes_pointer_for_buffer(value=None, library_type=None, size=None, complex_type='none'): +def _get_ctypes_pointer_for_buffer(value=None, library_type=None, size=None): if isinstance(value, array.array): assert library_type is not None, 'library_type is required for array.array' addr, _ = value.buffer_info() return ctypes.cast(addr, ctypes.POINTER(library_type)) elif str(type(value)).find("'numpy.ndarray'") != -1: import numpy - if complex_type == 'none': - return numpy.ctypeslib.as_ctypes(value) - else: + if library_type in (_complextype.ComplexViInt16, _complextype.ComplexViReal32, _complextype.ComplexViReal64): complex_dtype = numpy.dtype(library_type) structured_array = value.view(complex_dtype) return structured_array.ctypes.data_as(ctypes.POINTER(library_type)) + else: + return numpy.ctypeslib.as_ctypes(value) elif isinstance(value, bytes): return ctypes.cast(value, ctypes.POINTER(library_type)) elif isinstance(value, list): @@ -741,7 +741,7 @@ def write_waveform_numpy(self, waveform): # noqa: N802 def write_waveform_complex_f32(self, waveform_data_array): # noqa: N802 vi_ctype = _visatype.ViSession(self._vi) # case S110 number_of_samples_ctype = _visatype.ViInt32(0 if waveform_data_array is None else len(waveform_data_array)) # case S160 - waveform_data_array_ctype = _get_ctypes_pointer_for_buffer(value=waveform_data_array, library_type=_complextype.ComplexViReal32, complex_type='numpy') # case B510 + waveform_data_array_ctype = _get_ctypes_pointer_for_buffer(value=waveform_data_array, library_type=_complextype.ComplexViReal32) # case B510 error_code = self._library.niFake_WriteWaveformComplexF32(vi_ctype, number_of_samples_ctype, waveform_data_array_ctype) errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) return @@ -749,7 +749,7 @@ def write_waveform_complex_f32(self, waveform_data_array): # noqa: N802 def write_waveform_complex_f64(self, waveform_data_array): # noqa: N802 vi_ctype = _visatype.ViSession(self._vi) # case S110 number_of_samples_ctype = _visatype.ViInt32(0 if waveform_data_array is None else len(waveform_data_array)) # case S160 - waveform_data_array_ctype = _get_ctypes_pointer_for_buffer(value=waveform_data_array, library_type=_complextype.ComplexViReal64, complex_type='numpy') # case B510 + waveform_data_array_ctype = _get_ctypes_pointer_for_buffer(value=waveform_data_array, library_type=_complextype.ComplexViReal64) # case B510 error_code = self._library.niFake_WriteWaveformComplexF64(vi_ctype, number_of_samples_ctype, waveform_data_array_ctype) errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) return @@ -757,7 +757,7 @@ def write_waveform_complex_f64(self, waveform_data_array): # noqa: N802 def write_waveform_complex_i16(self, waveform_data_array): # noqa: N802 vi_ctype = _visatype.ViSession(self._vi) # case S110 number_of_samples_ctype = _visatype.ViInt32(0 if waveform_data_array is None else len(waveform_data_array) // 2) # case S160 - waveform_data_array_ctype = _get_ctypes_pointer_for_buffer(value=waveform_data_array, library_type=_complextype.ComplexViInt16, complex_type='interleaved') # case B510 + waveform_data_array_ctype = _get_ctypes_pointer_for_buffer(value=waveform_data_array, library_type=_complextype.ComplexViInt16) # case B510 error_code = self._library.niFake_WriteWaveformComplexI16(vi_ctype, number_of_samples_ctype, waveform_data_array_ctype) errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) return diff --git a/generated/nifgen/nifgen/_library_interpreter.py b/generated/nifgen/nifgen/_library_interpreter.py index 30ec6f76b4..5e6dab7c47 100644 --- a/generated/nifgen/nifgen/_library_interpreter.py +++ b/generated/nifgen/nifgen/_library_interpreter.py @@ -17,19 +17,19 @@ # Helper functions for creating ctypes needed for calling into the driver DLL -def _get_ctypes_pointer_for_buffer(value=None, library_type=None, size=None, complex_type='none'): +def _get_ctypes_pointer_for_buffer(value=None, library_type=None, size=None): if isinstance(value, array.array): assert library_type is not None, 'library_type is required for array.array' addr, _ = value.buffer_info() return ctypes.cast(addr, ctypes.POINTER(library_type)) elif str(type(value)).find("'numpy.ndarray'") != -1: import numpy - if complex_type == 'none': - return numpy.ctypeslib.as_ctypes(value) - else: + if library_type in (_complextype.ComplexViInt16, _complextype.ComplexViReal32, _complextype.ComplexViReal64): complex_dtype = numpy.dtype(library_type) structured_array = value.view(complex_dtype) return structured_array.ctypes.data_as(ctypes.POINTER(library_type)) + else: + return numpy.ctypeslib.as_ctypes(value) elif isinstance(value, bytes): return ctypes.cast(value, ctypes.POINTER(library_type)) elif isinstance(value, list): diff --git a/generated/nimodinst/nimodinst/_library_interpreter.py b/generated/nimodinst/nimodinst/_library_interpreter.py index f0164e79fc..57107267f1 100644 --- a/generated/nimodinst/nimodinst/_library_interpreter.py +++ b/generated/nimodinst/nimodinst/_library_interpreter.py @@ -11,19 +11,19 @@ # Helper functions for creating ctypes needed for calling into the driver DLL -def _get_ctypes_pointer_for_buffer(value=None, library_type=None, size=None, complex_type='none'): +def _get_ctypes_pointer_for_buffer(value=None, library_type=None, size=None): if isinstance(value, array.array): assert library_type is not None, 'library_type is required for array.array' addr, _ = value.buffer_info() return ctypes.cast(addr, ctypes.POINTER(library_type)) elif str(type(value)).find("'numpy.ndarray'") != -1: import numpy - if complex_type == 'none': - return numpy.ctypeslib.as_ctypes(value) - else: + if library_type in (_complextype.ComplexViInt16, _complextype.ComplexViReal32, _complextype.ComplexViReal64): complex_dtype = numpy.dtype(library_type) structured_array = value.view(complex_dtype) return structured_array.ctypes.data_as(ctypes.POINTER(library_type)) + else: + return numpy.ctypeslib.as_ctypes(value) elif isinstance(value, bytes): return ctypes.cast(value, ctypes.POINTER(library_type)) elif isinstance(value, list): diff --git a/generated/nirfsg/nirfsg/_library_interpreter.py b/generated/nirfsg/nirfsg/_library_interpreter.py index d68c63410b..f6a5a5750a 100644 --- a/generated/nirfsg/nirfsg/_library_interpreter.py +++ b/generated/nirfsg/nirfsg/_library_interpreter.py @@ -12,19 +12,19 @@ # Helper functions for creating ctypes needed for calling into the driver DLL -def _get_ctypes_pointer_for_buffer(value=None, library_type=None, size=None, complex_type='none'): +def _get_ctypes_pointer_for_buffer(value=None, library_type=None, size=None): if isinstance(value, array.array): assert library_type is not None, 'library_type is required for array.array' addr, _ = value.buffer_info() return ctypes.cast(addr, ctypes.POINTER(library_type)) elif str(type(value)).find("'numpy.ndarray'") != -1: import numpy - if complex_type == 'none': - return numpy.ctypeslib.as_ctypes(value) - else: + if library_type in (_complextype.ComplexViInt16, _complextype.ComplexViReal32, _complextype.ComplexViReal64): complex_dtype = numpy.dtype(library_type) structured_array = value.view(complex_dtype) return structured_array.ctypes.data_as(ctypes.POINTER(library_type)) + else: + return numpy.ctypeslib.as_ctypes(value) elif isinstance(value, bytes): return ctypes.cast(value, ctypes.POINTER(library_type)) elif isinstance(value, list): @@ -790,7 +790,7 @@ def write_arb_waveform_complex_f32(self, waveform_name, waveform_data_array, mor vi_ctype = _visatype.ViSession(self._vi) # case S110 waveform_name_ctype = ctypes.create_string_buffer(waveform_name.encode(self._encoding)) # case C020 number_of_samples_ctype = _visatype.ViInt32(0 if waveform_data_array is None else len(waveform_data_array)) # case S160 - waveform_data_array_ctype = _get_ctypes_pointer_for_buffer(value=waveform_data_array, library_type=_complextype.ComplexViReal32, complex_type='numpy') # case B510 + waveform_data_array_ctype = _get_ctypes_pointer_for_buffer(value=waveform_data_array, library_type=_complextype.ComplexViReal32) # case B510 more_data_pending_ctype = _visatype.ViBoolean(more_data_pending) # case S150 error_code = self._library.niRFSG_WriteArbWaveformComplexF32(vi_ctype, waveform_name_ctype, number_of_samples_ctype, waveform_data_array_ctype, more_data_pending_ctype) errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) @@ -800,7 +800,7 @@ def write_arb_waveform_complex_f64(self, waveform_name, waveform_data_array, mor vi_ctype = _visatype.ViSession(self._vi) # case S110 waveform_name_ctype = ctypes.create_string_buffer(waveform_name.encode(self._encoding)) # case C020 number_of_samples_ctype = _visatype.ViInt32(0 if waveform_data_array is None else len(waveform_data_array)) # case S160 - waveform_data_array_ctype = _get_ctypes_pointer_for_buffer(value=waveform_data_array, library_type=_complextype.ComplexViReal64, complex_type='numpy') # case B510 + waveform_data_array_ctype = _get_ctypes_pointer_for_buffer(value=waveform_data_array, library_type=_complextype.ComplexViReal64) # case B510 more_data_pending_ctype = _visatype.ViBoolean(more_data_pending) # case S150 error_code = self._library.niRFSG_WriteArbWaveformComplexF64(vi_ctype, waveform_name_ctype, number_of_samples_ctype, waveform_data_array_ctype, more_data_pending_ctype) errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) @@ -810,7 +810,7 @@ def write_arb_waveform_complex_i16(self, waveform_name, waveform_data_array): # vi_ctype = _visatype.ViSession(self._vi) # case S110 waveform_name_ctype = ctypes.create_string_buffer(waveform_name.encode(self._encoding)) # case C020 number_of_samples_ctype = _visatype.ViInt32(0 if waveform_data_array is None else len(waveform_data_array) // 2) # case S160 - waveform_data_array_ctype = _get_ctypes_pointer_for_buffer(value=waveform_data_array, library_type=_complextype.ComplexViInt16, complex_type='interleaved') # case B510 + waveform_data_array_ctype = _get_ctypes_pointer_for_buffer(value=waveform_data_array, library_type=_complextype.ComplexViInt16) # case B510 error_code = self._library.niRFSG_WriteArbWaveformComplexI16(vi_ctype, waveform_name_ctype, number_of_samples_ctype, waveform_data_array_ctype) errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) return diff --git a/generated/niscope/niscope/_library_interpreter.py b/generated/niscope/niscope/_library_interpreter.py index 00c0315aa8..c4068b7dce 100644 --- a/generated/niscope/niscope/_library_interpreter.py +++ b/generated/niscope/niscope/_library_interpreter.py @@ -21,19 +21,19 @@ # Helper functions for creating ctypes needed for calling into the driver DLL -def _get_ctypes_pointer_for_buffer(value=None, library_type=None, size=None, complex_type='none'): +def _get_ctypes_pointer_for_buffer(value=None, library_type=None, size=None): if isinstance(value, array.array): assert library_type is not None, 'library_type is required for array.array' addr, _ = value.buffer_info() return ctypes.cast(addr, ctypes.POINTER(library_type)) elif str(type(value)).find("'numpy.ndarray'") != -1: import numpy - if complex_type == 'none': - return numpy.ctypeslib.as_ctypes(value) - else: + if library_type in (_complextype.ComplexViInt16, _complextype.ComplexViReal32, _complextype.ComplexViReal64): complex_dtype = numpy.dtype(library_type) structured_array = value.view(complex_dtype) return structured_array.ctypes.data_as(ctypes.POINTER(library_type)) + else: + return numpy.ctypeslib.as_ctypes(value) elif isinstance(value, bytes): return ctypes.cast(value, ctypes.POINTER(library_type)) elif isinstance(value, list): diff --git a/generated/nise/nise/_library_interpreter.py b/generated/nise/nise/_library_interpreter.py index 08470eb20b..ca29757e6d 100644 --- a/generated/nise/nise/_library_interpreter.py +++ b/generated/nise/nise/_library_interpreter.py @@ -12,19 +12,19 @@ # Helper functions for creating ctypes needed for calling into the driver DLL -def _get_ctypes_pointer_for_buffer(value=None, library_type=None, size=None, complex_type='none'): +def _get_ctypes_pointer_for_buffer(value=None, library_type=None, size=None): if isinstance(value, array.array): assert library_type is not None, 'library_type is required for array.array' addr, _ = value.buffer_info() return ctypes.cast(addr, ctypes.POINTER(library_type)) elif str(type(value)).find("'numpy.ndarray'") != -1: import numpy - if complex_type == 'none': - return numpy.ctypeslib.as_ctypes(value) - else: + if library_type in (_complextype.ComplexViInt16, _complextype.ComplexViReal32, _complextype.ComplexViReal64): complex_dtype = numpy.dtype(library_type) structured_array = value.view(complex_dtype) return structured_array.ctypes.data_as(ctypes.POINTER(library_type)) + else: + return numpy.ctypeslib.as_ctypes(value) elif isinstance(value, bytes): return ctypes.cast(value, ctypes.POINTER(library_type)) elif isinstance(value, list): diff --git a/generated/niswitch/niswitch/_library_interpreter.py b/generated/niswitch/niswitch/_library_interpreter.py index 9f0ec3c683..2f075d8b99 100644 --- a/generated/niswitch/niswitch/_library_interpreter.py +++ b/generated/niswitch/niswitch/_library_interpreter.py @@ -17,19 +17,19 @@ # Helper functions for creating ctypes needed for calling into the driver DLL -def _get_ctypes_pointer_for_buffer(value=None, library_type=None, size=None, complex_type='none'): +def _get_ctypes_pointer_for_buffer(value=None, library_type=None, size=None): if isinstance(value, array.array): assert library_type is not None, 'library_type is required for array.array' addr, _ = value.buffer_info() return ctypes.cast(addr, ctypes.POINTER(library_type)) elif str(type(value)).find("'numpy.ndarray'") != -1: import numpy - if complex_type == 'none': - return numpy.ctypeslib.as_ctypes(value) - else: + if library_type in (_complextype.ComplexViInt16, _complextype.ComplexViReal32, _complextype.ComplexViReal64): complex_dtype = numpy.dtype(library_type) structured_array = value.view(complex_dtype) return structured_array.ctypes.data_as(ctypes.POINTER(library_type)) + else: + return numpy.ctypeslib.as_ctypes(value) elif isinstance(value, bytes): return ctypes.cast(value, ctypes.POINTER(library_type)) elif isinstance(value, list): diff --git a/generated/nitclk/nitclk/_library_interpreter.py b/generated/nitclk/nitclk/_library_interpreter.py index 9a434a6f7f..9de15347a9 100644 --- a/generated/nitclk/nitclk/_library_interpreter.py +++ b/generated/nitclk/nitclk/_library_interpreter.py @@ -11,19 +11,19 @@ # Helper functions for creating ctypes needed for calling into the driver DLL -def _get_ctypes_pointer_for_buffer(value=None, library_type=None, size=None, complex_type='none'): +def _get_ctypes_pointer_for_buffer(value=None, library_type=None, size=None): if isinstance(value, array.array): assert library_type is not None, 'library_type is required for array.array' addr, _ = value.buffer_info() return ctypes.cast(addr, ctypes.POINTER(library_type)) elif str(type(value)).find("'numpy.ndarray'") != -1: import numpy - if complex_type == 'none': - return numpy.ctypeslib.as_ctypes(value) - else: + if library_type in (_complextype.ComplexViInt16, _complextype.ComplexViReal32, _complextype.ComplexViReal64): complex_dtype = numpy.dtype(library_type) structured_array = value.view(complex_dtype) return structured_array.ctypes.data_as(ctypes.POINTER(library_type)) + else: + return numpy.ctypeslib.as_ctypes(value) elif isinstance(value, bytes): return ctypes.cast(value, ctypes.POINTER(library_type)) elif isinstance(value, list): From 7363e360752ae93db27928ed038f56b726063843 Mon Sep 17 00:00:00 2001 From: Rahul R Date: Fri, 6 Jun 2025 17:30:46 +0530 Subject: [PATCH 14/33] Change log code review comments included --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 94efb797c8..dbfa0653b3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2141,6 +2141,7 @@ - [0.2.0](#nise-020---2018-10-25) - [0.1.0](#nise-010---2018-10-17) +#### [nise] Unreleased - Added - Changed - Removed @@ -2296,6 +2297,7 @@ - [0.3.0](#niswitch-030---2017-10-13) - [0.2.0](#niswitch-020---2017-09-20) +#### [niswitch] Unreleased - Added - Changed - Removed @@ -2546,6 +2548,7 @@ - [0.3.0](#nitclk-030---2019-11-19) - [0.1.0](#nitclk-010---2019-10-21) +#### [nitclk] Unreleased - Added - Changed - Removed From d07653f0bb28acbf4dfdd36cb8b937b417af3edc Mon Sep 17 00:00:00 2001 From: Rahul R Date: Mon, 9 Jun 2025 14:12:30 +0530 Subject: [PATCH 15/33] Removed RFSG specific changes and include complextype only if needed --- CHANGELOG.md | 1 - src/nirfsg/examples/nirfsg_arb_waveform.py | 46 --- src/nirfsg/examples/nirfsg_script.py | 54 ---- src/nirfsg/metadata/functions.py | 302 ------------------ .../session.py/write_arb_waveform.py.mako | 24 -- 5 files changed, 427 deletions(-) delete mode 100644 src/nirfsg/examples/nirfsg_arb_waveform.py delete mode 100644 src/nirfsg/examples/nirfsg_script.py delete mode 100644 src/nirfsg/templates/session.py/write_arb_waveform.py.mako diff --git a/CHANGELOG.md b/CHANGELOG.md index dbfa0653b3..c3563df429 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1670,7 +1670,6 @@ - Enabled selected public APIs - Basic example - Documentation for APIs (not final) - - Enabled write_arb_waveform functions along with examples. - Changed - Removed diff --git a/src/nirfsg/examples/nirfsg_arb_waveform.py b/src/nirfsg/examples/nirfsg_arb_waveform.py deleted file mode 100644 index 179bc78e7b..0000000000 --- a/src/nirfsg/examples/nirfsg_arb_waveform.py +++ /dev/null @@ -1,46 +0,0 @@ -import argparse -import nirfsg -import numpy as np -import sys - - -def example(resource_name, options, frequency, power_level, number_of_samples): - waveform_data = np.full(number_of_samples, 1 + 0j, dtype=np.complex128) - with nirfsg.Session(resource_name=resource_name, id_query=False, reset_device=False, options=options) as session: - session.configure_rf( - frequency, - power_level - ) - session.generation_mode = nirfsg.GenerationMode.ARB_WAVEFORM - session.write_arb_waveform('wfm', waveform_data, False) - with session.initiate(): - session.check_generation_status() - - -def _main(argsv): - parser = argparse.ArgumentParser(description='Continuously generates an arbitrary waveform using NI-RFSG.', formatter_class=argparse.ArgumentDefaultsHelpFormatter) - parser.add_argument('-n', '--resource-name', default='5841', help='Resource name of the NI RF signal generator.') - parser.add_argument('-f', '--frequency', default=1e9, type=float, help='Frequency in Hz.') - parser.add_argument('-p', '--power-level', default=-10.0, type=float, help='Power level in dBm.') - parser.add_argument('-n', '--number-of-samples', default=1000, type=int, help='Number of samples.') - parser.add_argument('-op', '--option-string', default='Simulate=1, DriverSetup=Model:5841', type=str, help='Option string for the session.') - args = parser.parse_args(argsv) - example(args.resource_name, args.option_string, args.frequency, args.power_level, args.number_of_samples) - - -def main(): - _main(sys.argv[1:]) - - -def test_example(): - options = "Simulate=1, DriverSetup=Model:5841" - example('5841', options, 1e9, -10.0) - - -def test_main(): - cmd_line = ['--resource-name', '5841', '--frequency', '1e9', '--power-level', '-10', '--number-of-samples', '1000', '--option-string', 'Simulate=1, DriverSetup=Model:5841'] - _main(cmd_line) - - -if __name__ == '__main__': - main() \ No newline at end of file diff --git a/src/nirfsg/examples/nirfsg_script.py b/src/nirfsg/examples/nirfsg_script.py deleted file mode 100644 index a667390c52..0000000000 --- a/src/nirfsg/examples/nirfsg_script.py +++ /dev/null @@ -1,54 +0,0 @@ -import argparse -import nirfsg -import numpy as np -import sys - -SAMPLE_SCRIPT = ''' -script continuousWaveform - repeat forever - generate wfm - end repeat -end script -''' - -def example(resource_name, options, frequency, power_level, number_of_samples): - waveform_data = np.full(number_of_samples, 1 + 0j, dtype=np.complex64) - with nirfsg.Session(resource_name=resource_name, id_query=False, reset_device=False, options=options) as session: - session.configure_rf( - frequency, - power_level - ) - session.generation_mode = nirfsg.GenerationMode.SCRIPT - session.write_arb_waveform('wfm', waveform_data, False) - session.write_script(SAMPLE_SCRIPT) - with session.initiate(): - session.check_generation_status() - - -def _main(argsv): - parser = argparse.ArgumentParser(description='Generates a signal based on the script provided.', formatter_class=argparse.ArgumentDefaultsHelpFormatter) - parser.add_argument('-n', '--resource-name', default='5841', help='Resource name of the NI RF signal generator.') - parser.add_argument('-f', '--frequency', default=1e9, type=float, help='Frequency in Hz.') - parser.add_argument('-p', '--power-level', default=-10.0, type=float, help='Power level in dBm.') - parser.add_argument('-n', '--number-of-samples', default=1000, type=int, help='Number of samples.') - parser.add_argument('-op', '--option-string', default='Simulate=1, DriverSetup=Model:5841', type=str, help='Option string for the session.') - args = parser.parse_args(argsv) - example(args.resource_name, args.option_string, args.frequency, args.power_level, args.number_of_samples) - - -def main(): - _main(sys.argv[1:]) - - -def test_example(): - options = "Simulate=1, DriverSetup=Model:5841" - example('5841', options, 1e9, -10.0) - - -def test_main(): - cmd_line = ['--resource-name', '5841', '--frequency', '1e9', '--power-level', '-10', '--number-of-samples', '1000', '--option-string', 'Simulate=1, DriverSetup=Model:5841'] - _main(cmd_line) - - -if __name__ == '__main__': - main() \ No newline at end of file diff --git a/src/nirfsg/metadata/functions.py b/src/nirfsg/metadata/functions.py index 27ad151c57..b3dd8ba68c 100644 --- a/src/nirfsg/metadata/functions.py +++ b/src/nirfsg/metadata/functions.py @@ -4944,230 +4944,6 @@ 'returns': 'ViStatus', 'use_session_lock': False }, - 'WriteArbWaveformComplexF32': { - 'codegen_method': 'private', - 'documentation': { - 'description': ' \n Writes an arbitrary waveform to the NI-RFSG device starting at the position of the last data written in onboard memory. \n \n This function accepts the complex baseband data in the form of complex singles. If the waveform to write is already allocated using the nirfsg_AllocateArbWaveform function, the **NIRFSG_ATTR_MORE_DATA_PENDING** parameter is ignored. The PXI-5670/5671 must be in the Configuration state before you call this function. When streaming is enabled, you can call this function when the PXIe-5672/5673/5673E or PXIe-5820/5830/5831/5832/5840/5841/5842/5860 is in the Generation state.\n\n **Supported Devices** : PXIe-5644/5645/5646, PXI-5670/5671, PXIe-5672/5673/5673E, PXIe-5820/5830/5831/5832/5840/5841/5842/5860\n\n **Related Topics**\n\n `Streaming `_\n\n `Assigning Properties or Attributes to a Waveform `_\n ', - 'note': 'On the PXIe-5644/5645/5646, PXIe-5672/5673/5673E, and PXIe-5820/5830/5831/5832/5840/5841/5842/5860, the **NIRFSG_ATTR_MORE_DATA_PENDING** parameter is always ignored. To write data in blocks on these devices, you must allocate the waveform before writing it.' - }, - 'included_in_proto': False, - 'is_error_handling': False, - 'method_name_for_documentation': 'write_arb_waveform', - 'method_templates': [ - { - 'documentation_filename': 'numpy_method', - 'library_interpreter_filename': 'numpy_write_method', - 'method_python_name_suffix': '', - 'session_filename': 'numpy_write_method' - } - ], - 'parameters': [ - { - 'direction': 'in', - 'documentation': { - 'description': 'Identifies your instrument session. The ViSession handle is obtained from the nirfsg_Init function or the nirfsg_InitWithOptions function and identifies a particular instrument session.' - }, - 'name': 'vi', - 'type': 'ViSession', - 'use_array': False, - 'use_in_python_api': True - }, - { - 'direction': 'in', - 'documentation': { - 'description': 'Specifies the name used to identify the waveform. This string is case-insensitive and alphanumeric, and it does not use reserved words.' - }, - 'name': 'waveformName', - 'type': 'ViConstString', - 'use_array': False, - 'use_in_python_api': True - }, - { - 'direction': 'in', - 'documentation': { - 'description': 'Specifies the number of samples in both of the data arrays.' - }, - 'name': 'numberOfSamples', - 'type': 'ViInt32', - 'use_array': False, - 'use_in_python_api': False - }, - { - 'complex_type': 'numpy', - 'direction': 'in', - 'documentation': { - 'description': 'Specifies the array of data to load into the waveform. The array must have at least as many elements as the value in the **size_in_samples** parameter in the nirfsg_AllocateArbWaveform function.' - }, - 'name': 'waveformDataArray', - 'numpy': True, - 'size': { - 'mechanism': 'len', - 'value': 'numberOfSamples' - }, - 'type': 'ComplexViReal32[]', - 'use_in_python_api': True, - 'use_numpy_array': True - }, - { - 'direction': 'in', - 'documentation': { - 'description': 'Specifies whether or not the data block contains the end of the waveform. Set this parameter to VI_TRUE to allow data to be appended later to the waveform. Splitting the waveform into multiple data blocks can reduce the memory requirements of the write operation. Append data to a previously written waveform by using the same waveform in the NIRFSG_ATTR_WAVEFORM_NAME parameter. Set **NIRFSG_ATTR_MORE_DATA_PENDING** to VI_FALSE to indicate that this data block contains the end of the waveform. If the waveform is already allocated, this parameter is ignored.' - }, - 'name': 'moreDataPending', - 'type': 'ViBoolean', - 'use_array': False, - 'use_in_python_api': True - } - ], - 'returns': 'ViStatus', - 'use_session_lock': False - }, - 'WriteArbWaveformComplexF64': { - 'codegen_method': 'private', - 'documentation': { - 'description': ' \n Writes an arbitrary waveform to the NI-RFSG device starting at the position of the last data written in onboard memory. \n \n This function accepts the complex baseband data in the form of complex doubles. If the waveform to write is already allocated using the nirfsg_AllocateArbWaveform, the moreDataPending parameter is ignored. The PXI-5670/5671 must be in the Configuration state before you call this function. When streaming is enabled, you can call this function when the PXIe-5672/5673/5673E or PXIe-5820/5830/5831/5832/5840/5841/5842 is in the Generation state.\n\n **Supported Devices** : PXIe-5644/5645/5646, PXI-5670/5671, PXIe-5672/5673/5673E, PXIe-5820/5830/5831/5832/5840/5841/5842\n\n **Related Topics**\n\n `Streaming `_\n\n `Assigning Properties or Attributes to a Waveform `_\n ', - 'note': 'On the PXIe-5644/5645/5646, PXIe-5672/5673/5673E, and PXIe-5820/5830/5831/5832/5840/5841/5842, the moreDataPending parameter is always ignored. To write data in blocks on these devices, you must allocate the waveform before writing it.' - }, - 'included_in_proto': False, - 'is_error_handling': False, - 'method_name_for_documentation': 'write_arb_waveform', - 'method_templates': [ - { - 'documentation_filename': 'numpy_method', - 'library_interpreter_filename': 'numpy_write_method', - 'method_python_name_suffix': '', - 'session_filename': 'numpy_write_method' - } - ], - 'parameters': [ - { - 'direction': 'in', - 'documentation': { - 'description': 'Identifies your instrument session. The ViSession handle is obtained from the nirfsg_Init function or the nirfsg_InitWithOptions function and identifies a particular instrument session.' - }, - 'name': 'vi', - 'type': 'ViSession', - 'use_array': False, - 'use_in_python_api': True - }, - { - 'direction': 'in', - 'documentation': { - 'description': 'Specifies the name used to identify the waveform. This string is case-insensitive and alphanumeric, and it does not use reserved words.' - }, - 'name': 'waveformName', - 'type': 'ViConstString', - 'use_array': False, - 'use_in_python_api': True - }, - { - 'direction': 'in', - 'documentation': { - 'description': 'Specifies the number of samples in the data array.' - }, - 'name': 'numberOfSamples', - 'type': 'ViInt32', - 'use_array': False, - 'use_in_python_api': False - }, - { - 'complex_type': 'numpy', - 'direction': 'in', - 'documentation': { - 'description': 'Specifies the array of data to load into the waveform. The array must have at least as many elements as the value in the **size_in_samples** parameter in the nirfsg_AllocateArbWaveform function.' - }, - 'name': 'waveformDataArray', - 'numpy': True, - 'size': { - 'mechanism': 'len', - 'value': 'numberOfSamples' - }, - 'type': 'ComplexViReal64[]', - 'use_in_python_api': True, - 'use_numpy_array': True - }, - { - 'direction': 'in', - 'documentation': { - 'description': 'Specifies whether or not the data block contains the end of the waveform. Set this parameter to VI_TRUE to allow data to be appended later to the waveform. Splitting the waveform into multiple data blocks can reduce the memory requirements of the write operation. Append data to a previously written waveform by using the same waveform in the **name** parameter. Set **NIRFSG_ATTR_MORE_DATA_PENDING** to VI_FALSE to indicate that this data block contains the end of the waveform. If the waveform is already allocated, this parameter is ignored.' - }, - 'name': 'moreDataPending', - 'type': 'ViBoolean', - 'use_array': False, - 'use_in_python_api': True - } - ], - 'returns': 'ViStatus', - 'use_session_lock': False - }, - 'WriteArbWaveformComplexI16': { - 'codegen_method': 'private', - 'documentation': { - 'description': ' \n Writes an arbitrary waveform to the NI-RFSG device starting at the position of the last data written in onboard memory. \n \n This function accepts the interleaved I/Q data of a complex baseband signal. The PXI-5670/5671 must be in the Configuration state before you call this function. When streaming is enabled, this function can be called when the PXIe-5672/5673/5673E or PXIe-5820/5830/5831/5832/5840/5841/5842/5860 is in the Generation state.\n\n **Supported Devices** : PXIe-5644/5645/5646, PXIe-5672/5673/5673E, PXIe-5820/5830/5831/5832/5840/5841/5842/5860\n\n **Related Topics**\n\n `Streaming `_\n\n `Assigning Properties or Attributes to a Waveform `_\n ', - 'note': 'This function only supports NIRFSG_VAL_PEAK_POWER mode as specified in the NIRFSG_ATTR_POWER_LEVEL_TYPE attribute. If you download a waveform when using this function, you cannot set the NIRFSG_ATTR_POWER_LEVEL_TYPE to NIRFSG_VAL_AVERAGE_POWER without causing error in the output.' - }, - 'included_in_proto': False, - 'is_error_handling': False, - 'method_name_for_documentation': 'write_arb_waveform', - 'method_templates': [ - { - 'documentation_filename': 'numpy_method', - 'library_interpreter_filename': 'numpy_write_method', - 'method_python_name_suffix': '', - 'session_filename': 'numpy_write_method' - } - ], - 'parameters': [ - { - 'direction': 'in', - 'documentation': { - 'description': 'Identifies your instrument session. The ViSession handle is obtained from the nirfsg_Init function or the nirfsg_InitWithOptions function and identifies a particular instrument session.' - }, - 'name': 'vi', - 'type': 'ViSession', - 'use_array': False, - 'use_in_python_api': True - }, - { - 'direction': 'in', - 'documentation': { - 'description': 'Specifies the name used to identify the waveform. This string is case-insensitive and alphanumeric, and it does not use reserved words.' - }, - 'name': 'waveformName', - 'type': 'ViConstString', - 'use_array': False, - 'use_in_python_api': True - }, - { - 'direction': 'in', - 'documentation': { - 'description': 'Specifies the number of samples in the data array.' - }, - 'name': 'numberOfSamples', - 'type': 'ViInt32', - 'use_array': False, - 'use_in_python_api': False - }, - { - 'complex_type': 'interleaved', - 'direction': 'in', - 'documentation': { - 'description': 'Specifies the array of data to load into the waveform. The array must have at least as many elements as the value in the **size_in_samples** parameter in the nirfsg_AllocateArbWaveform function.' - }, - 'name': 'waveformDataArray', - 'numpy': True, - 'size': { - 'mechanism': 'len', - 'value': 'numberOfSamples' - }, - 'type': 'ComplexViInt16[]', - 'use_in_python_api': True, - 'use_numpy_array': True - } - ], - 'returns': 'ViStatus', - 'use_session_lock': False - }, 'WriteP2PEndpointI16': { 'codegen_method': 'public', 'documentation': { @@ -5273,84 +5049,6 @@ 'returns': 'ViStatus', 'use_session_lock': False }, - 'WriteArbWaveformDispatcher': { - 'codegen_method': 'python-only', - 'documentation': { - 'description': ' \n Writes an arbitrary waveform to the NI-RFSG device starting at the position of the last data written in onboard memory. \n \n This function accepts the complex baseband data in the form of numpy array of numpy.complex64 or numpy.complex128 or interleaved numpy array of numpy.int16. If the waveform to write is already allocated using the nirfsg_AllocateArbWaveform function, the **NIRFSG_ATTR_MORE_DATA_PENDING** parameter is ignored. The PXI-5670/5671 must be in the Configuration state before you call this function. When streaming is enabled, this function can be called when the PXIe-5672/5673/5673E or PXIe-5820/5830/5831/5832/5840/5841/5842/5860 is in the Generation state.\n\n **Supported Devices** : PXIe-5644/5645/5646, PXIe-5672/5673/5673E, PXIe-5820/5830/5831/5832/5840/5841/5842/5860\n\n **Related Topics**\n\n `Streaming `_\n\n `Assigning Properties or Attributes to a Waveform `_\n ', - 'note': 'This function only supports NIRFSG_VAL_PEAK_POWER mode as specified in the NIRFSG_ATTR_POWER_LEVEL_TYPE attribute. If you download a waveform when using this function, you cannot set the NIRFSG_ATTR_POWER_LEVEL_TYPE to NIRFSG_VAL_AVERAGE_POWER without causing error in the output.' - }, - 'included_in_proto': False, - 'is_error_handling': False, - 'method_templates': [ - { - 'documentation_filename': 'default_method', - 'library_interpreter_filename': 'none', - 'method_python_name_suffix': '', - 'session_filename': 'write_arb_waveform' - } - ], - 'parameters': [ - { - 'direction': 'in', - 'documentation': { - 'description': 'Identifies your instrument session. The ViSession handle is obtained from the nirfsg_Init function or the nirfsg_InitWithOptions function and identifies a particular instrument session.' - }, - 'name': 'vi', - 'type': 'ViSession', - 'use_array': False, - 'use_in_python_api': True - }, - { - 'direction': 'in', - 'documentation': { - 'description': 'Specifies the name used to identify the waveform. This string is case-insensitive and alphanumeric, and it does not use reserved words.' - }, - 'name': 'waveformName', - 'type': 'ViConstString', - 'use_array': False, - 'use_in_python_api': True - }, - { - 'direction': 'in', - 'documentation': { - 'description': 'Specifies the number of samples in the data array.' - }, - 'name': 'numberOfSamples', - 'type': 'ViInt32', - 'use_array': False, - 'use_in_python_api': False - }, - { - 'complex_type': 'numpy', - 'direction': 'in', - 'documentation': { - 'description': 'Specifies the array of data to load into the waveform. The array must have at least as many elements as the value in the **size_in_samples** parameter in the nirfsg_AllocateArbWaveform function.' - }, - 'name': 'waveformDataArray', - 'numpy': True, - 'size': { - 'mechanism': 'len', - 'value': 'numberOfSamples' - }, - 'type': 'ComplexViReal64[]', - 'use_in_python_api': True, - 'use_numpy_array': True - }, - { - 'direction': 'in', - 'documentation': { - 'description': 'Specifies whether or not the data block contains the end of the waveform. Set this parameter to VI_TRUE to allow data to be appended later to the waveform. Splitting the waveform into multiple data blocks can reduce the memory requirements of the write operation. Append data to a previously written waveform by using the same waveform in the **name** parameter. Set **NIRFSG_ATTR_MORE_DATA_PENDING** to VI_FALSE to indicate that this data block contains the end of the waveform. If the waveform is already allocated, this parameter is ignored.' - }, - 'name': 'moreDataPending', - 'type': 'ViBoolean', - 'use_array': False, - 'use_in_python_api': True - } - ], - 'python_name': 'write_arb_waveform', - 'returns': 'ViStatus', - 'use_session_lock': False - }, 'close': { 'codegen_method': 'private', 'documentation': { diff --git a/src/nirfsg/templates/session.py/write_arb_waveform.py.mako b/src/nirfsg/templates/session.py/write_arb_waveform.py.mako deleted file mode 100644 index e4097d8472..0000000000 --- a/src/nirfsg/templates/session.py/write_arb_waveform.py.mako +++ /dev/null @@ -1,24 +0,0 @@ -<%page args="f, config, method_template"/>\ -<% - '''Dispatches to the appropriate "write arb waveform" method based on the waveform type.''' - import build.helper as helper -%>\ - def ${f['python_name']}(${helper.get_params_snippet(f, helper.ParameterUsageOptions.SESSION_METHOD_DECLARATION)}): - '''${f['python_name']} - - ${helper.get_function_docstring(f, False, config, indent=8)} - ''' - if str(type(waveform_data_array)).find("'numpy.ndarray'") != -1: - import numpy - if waveform_data_array.dtype == numpy.complex128: - return self._write_arb_waveform_complex_f64(waveform_name, waveform_data_array, more_data_pending) - elif waveform_data_array.dtype == numpy.complex64: - return self._write_arb_waveform_complex_f32(waveform_name, waveform_data_array, more_data_pending) - elif waveform_data_array.dtype == numpy.int16: - return self._write_arb_waveform_complex_i16(waveform_name, waveform_data_array, more_data_pending) - else: - raise TypeError("Unsupported dtype. Is {}, expected {} or {} or {}".format(waveform_data_array.dtype, numpy.complex128, numpy.complex64, numpy.int16)) - else: - raise TypeError("Unsupported dtype. Is {}, expected {} or {} or {}".format(waveform_data_array.dtype, numpy.complex128, numpy.complex64, numpy.int16)) - - return self._write_arb_waveform_complex_f64(waveform_name, waveform_data_array, more_data_pending) From 50ed57df82db3276e1afc8d760db5e1854ddb22b Mon Sep 17 00:00:00 2001 From: Rahul R Date: Mon, 9 Jun 2025 14:14:41 +0530 Subject: [PATCH 16/33] Removed RFSG specific changes --- build/helper/__init__.py | 1 + build/helper/metadata_filters.py | 48 ++++++ build/helper/parameter_usage_options.py | 2 + build/templates/_library.py.mako | 5 +- build/templates/_library_interpreter.py.mako | 7 + docs/nirfsg/class.rst | 57 ------- docs/nirfsg/examples.rst | 18 -- generated/nidcpower/nidcpower/_library.py | 1 - .../nidcpower/_library_interpreter.py | 8 +- generated/nidigital/nidigital/_library.py | 1 - .../nidigital/_library_interpreter.py | 8 +- generated/nidmm/nidmm/_library.py | 1 - generated/nidmm/nidmm/_library_interpreter.py | 8 +- generated/nifake/nifake/_library.py | 2 +- generated/nifgen/nifgen/_library.py | 1 - .../nifgen/nifgen/_library_interpreter.py | 8 +- generated/nimodinst/nimodinst/_library.py | 1 - .../nimodinst/_library_interpreter.py | 8 +- generated/nirfsg/nirfsg/_library.py | 28 ---- .../nirfsg/nirfsg/_library_interpreter.py | 37 +--- generated/nirfsg/nirfsg/session.py | 158 ------------------ .../nirfsg/nirfsg/unit_tests/_mock_helper.py | 27 --- generated/niscope/niscope/_library.py | 1 - .../niscope/niscope/_library_interpreter.py | 8 +- generated/nise/nise/_library.py | 1 - generated/nise/nise/_library_interpreter.py | 8 +- generated/niswitch/niswitch/_library.py | 1 - .../niswitch/niswitch/_library_interpreter.py | 8 +- generated/nitclk/nitclk/_library.py | 1 - .../nitclk/nitclk/_library_interpreter.py | 8 +- 30 files changed, 73 insertions(+), 398 deletions(-) diff --git a/build/helper/__init__.py b/build/helper/__init__.py index f6d8dbcfa1..08ed178f15 100644 --- a/build/helper/__init__.py +++ b/build/helper/__init__.py @@ -42,6 +42,7 @@ from build.helper.metadata_add_all import add_all_metadata # noqa: F401 +from build.helper.metadata_filters import are_complex_parameters_used # noqa: F401 from build.helper.metadata_filters import filter_codegen_attributes # noqa: F401 from build.helper.metadata_filters import filter_codegen_attributes_public_only # noqa: F401 from build.helper.metadata_filters import filter_codegen_enums # noqa: F401 diff --git a/build/helper/metadata_filters.py b/build/helper/metadata_filters.py index 3a4d5bb1c1..a8bb7a24d6 100644 --- a/build/helper/metadata_filters.py +++ b/build/helper/metadata_filters.py @@ -19,6 +19,7 @@ 'skip_all_except_numpy_parameters': False, 'mechanism': 'fixed, passed-in, len', 'python_api_list': True, + 'skip_all_except_complex_type_parameters': False, }, ParameterUsageOptions.SESSION_METHOD_PASSTHROUGH_CALL: { 'skip_session_handle': True, @@ -33,6 +34,7 @@ 'skip_all_except_numpy_parameters': False, 'mechanism': 'fixed, passed-in, len', 'python_api_list': True, + 'skip_all_except_complex_type_parameters': False, }, ParameterUsageOptions.SESSION_NUMPY_INTO_METHOD_DECLARATION: { 'skip_session_handle': True, @@ -47,6 +49,7 @@ 'skip_all_except_numpy_parameters': False, 'mechanism': 'fixed, passed-in', 'python_api_list': False, + 'skip_all_except_complex_type_parameters': False, }, ParameterUsageOptions.INTERPRETER_NUMPY_INTO_METHOD_DECLARATION: { 'skip_session_handle': True, @@ -61,6 +64,7 @@ 'skip_all_except_numpy_parameters': False, 'mechanism': 'fixed, passed-in', 'python_api_list': False, + 'skip_all_except_complex_type_parameters': False, }, ParameterUsageOptions.SESSION_METHOD_CALL: { 'skip_session_handle': True, @@ -75,6 +79,7 @@ 'skip_all_except_numpy_parameters': False, 'mechanism': 'fixed, passed-in', 'python_api_list': True, + 'skip_all_except_complex_type_parameters': False, }, ParameterUsageOptions.DOCUMENTATION_SESSION_METHOD: { 'skip_session_handle': True, @@ -89,6 +94,7 @@ 'skip_all_except_numpy_parameters': False, 'mechanism': 'any', 'python_api_list': True, + 'skip_all_except_complex_type_parameters': False, }, ParameterUsageOptions.LIBRARY_METHOD_DECLARATION: { 'skip_session_handle': False, @@ -103,6 +109,7 @@ 'skip_all_except_numpy_parameters': False, 'mechanism': 'any', 'python_api_list': True, + 'skip_all_except_complex_type_parameters': False, }, ParameterUsageOptions.LIBRARY_METHOD_CALL: { 'skip_session_handle': False, @@ -117,6 +124,7 @@ 'skip_all_except_numpy_parameters': False, 'mechanism': 'any', 'python_api_list': True, + 'skip_all_except_complex_type_parameters': False, }, ParameterUsageOptions.GRPC_REQUEST_PARAMETERS: { 'skip_session_handle': False, @@ -131,6 +139,7 @@ 'skip_all_except_numpy_parameters': False, 'mechanism': 'any', 'python_api_list': True, + 'skip_all_except_complex_type_parameters': False, }, ParameterUsageOptions.CTYPES_ARGTYPES: { 'skip_session_handle': False, @@ -145,6 +154,7 @@ 'skip_all_except_numpy_parameters': False, 'mechanism': 'any', 'python_api_list': True, + 'skip_all_except_complex_type_parameters': False, }, ParameterUsageOptions.INTERPRETER_METHOD_DECLARATION: { 'skip_session_handle': True, @@ -159,6 +169,7 @@ 'skip_all_except_numpy_parameters': False, 'mechanism': 'fixed, passed-in, len', 'python_api_list': True, + 'skip_all_except_complex_type_parameters': False, }, ParameterUsageOptions.INPUT_PARAMETERS: { 'skip_session_handle': True, @@ -173,6 +184,7 @@ 'skip_all_except_numpy_parameters': False, 'mechanism': 'any', 'python_api_list': True, + 'skip_all_except_complex_type_parameters': False, }, ParameterUsageOptions.LIBRARY_OUTPUT_PARAMETERS: { 'skip_session_handle': True, @@ -187,6 +199,7 @@ 'skip_all_except_numpy_parameters': False, 'mechanism': 'any', 'python_api_list': True, + 'skip_all_except_complex_type_parameters': False, }, ParameterUsageOptions.API_OUTPUT_PARAMETERS: { 'skip_session_handle': True, @@ -201,6 +214,7 @@ 'skip_all_except_numpy_parameters': False, 'mechanism': 'any', 'python_api_list': False, + 'skip_all_except_complex_type_parameters': False, }, ParameterUsageOptions.API_NUMPY_OUTPUT_PARAMETERS: { 'skip_session_handle': True, @@ -215,6 +229,7 @@ 'skip_all_except_numpy_parameters': False, 'mechanism': 'any', 'python_api_list': False, + 'skip_all_except_complex_type_parameters': False, }, ParameterUsageOptions.GRPC_OUTPUT_PARAMETERS: { 'skip_session_handle': True, @@ -229,6 +244,7 @@ 'skip_all_except_numpy_parameters': False, 'mechanism': 'any', 'python_api_list': False, + 'skip_all_except_complex_type_parameters': False, }, ParameterUsageOptions.NUMPY_PARAMETERS: { 'skip_session_handle': True, @@ -243,6 +259,7 @@ 'skip_all_except_numpy_parameters': True, 'mechanism': 'any', 'python_api_list': True, + 'skip_all_except_complex_type_parameters': False, }, ParameterUsageOptions.IVI_DANCE_PARAMETER: { 'skip_session_handle': True, @@ -257,6 +274,7 @@ 'skip_all_except_numpy_parameters': False, 'mechanism': 'ivi-dance, ivi-dance-with-a-twist', 'python_api_list': True, + 'skip_all_except_complex_type_parameters': False, }, ParameterUsageOptions.LEN_PARAMETER: { 'skip_session_handle': True, @@ -271,6 +289,7 @@ 'skip_all_except_numpy_parameters': False, 'mechanism': 'len', 'python_api_list': True, + 'skip_all_except_complex_type_parameters': False, }, ParameterUsageOptions.INPUT_ENUM_PARAMETERS: { 'skip_session_handle': True, @@ -285,6 +304,23 @@ 'skip_all_except_numpy_parameters': False, 'mechanism': 'any', 'python_api_list': True, + 'skip_all_except_complex_type_parameters': False, + }, + ParameterUsageOptions.COMPLEX_NUMBER_PARAMETERS: { + 'skip_session_handle': True, + 'skip_input_parameters': False, + 'skip_output_parameters': False, + 'but_keep_output_numpy_array_parameters': True, + 'skip_size_parameter': True, + 'reordered_for_default_values': False, + 'skip_repeated_capability_parameter': True, + 'skip_non_enum_parameter': False, + 'skip_numpy_parameters': False, + 'skip_all_except_numpy_parameters': True, + 'mechanism': 'any', + 'python_api_list': True, + 'skip_all_except_complex_type_parameters': True, + 'skip_all_except_complex_type_parameters': True, }, } @@ -349,6 +385,8 @@ def filter_parameters(parameters, parameter_usage_options): skip = False if not options_to_use['python_api_list'] and not x['use_in_python_api']: skip = True + if options_to_use['skip_all_except_complex_type_parameters'] and x['complex_type'] == 'none': + skip = True if not skip: parameters_to_use.append(x) @@ -451,3 +489,13 @@ def filter_codegen_enums(enums): return {k: v for k, v in enums.items() if v['codegen_method'] != 'no'} +def are_complex_parameters_used(functions): + '''Returns function metadata only for those functions to included the library layer (library.py and mock_helper.py)''' + are_complex_parameters_used = False + complex_parameters = [] + for k, v in functions.items(): + complex_parameters = filter_parameters(v['parameters'], ParameterUsageOptions.COMPLEX_NUMBER_PARAMETERS) + if complex_parameters != []: + are_complex_parameters_used = True + break + return are_complex_parameters_used diff --git a/build/helper/parameter_usage_options.py b/build/helper/parameter_usage_options.py index f01aa59ab5..9eb9e1efd7 100644 --- a/build/helper/parameter_usage_options.py +++ b/build/helper/parameter_usage_options.py @@ -62,3 +62,5 @@ class ParameterUsageOptions(AutoNumber): '''Get the len parameter''' INPUT_ENUM_PARAMETERS = () '''Get any input parameters whose type is enum''' + COMPLEX_NUMBER_PARAMETERS = () + '''Get all parameters of complex type''' diff --git a/build/templates/_library.py.mako b/build/templates/_library.py.mako index 138cddc33e..d997e2ff8a 100644 --- a/build/templates/_library.py.mako +++ b/build/templates/_library.py.mako @@ -12,13 +12,16 @@ driver_name = config['driver_name'] functions = config['functions'] functions = helper.filter_library_functions(functions) +are_complex_parameters_used = helper.are_complex_parameters_used(functions) %>\ import ctypes import ${module_name}.errors as errors import threading -from ${module_name}._complextype import * # noqa: F401,F403,H303 +% if are_complex_parameters_used: +import ${module_name}._complextype as _complextype # noqa: F401 +% endif from ${module_name}._visatype import * # noqa: F403,H303 % for c in config['custom_types']: diff --git a/build/templates/_library_interpreter.py.mako b/build/templates/_library_interpreter.py.mako index aad6da6373..6c99c0b276 100644 --- a/build/templates/_library_interpreter.py.mako +++ b/build/templates/_library_interpreter.py.mako @@ -12,6 +12,7 @@ driver_name = config['driver_name'] functions = config['functions'] functions = helper.filter_codegen_functions(functions) +are_complex_parameters_used = helper.are_complex_parameters_used(functions) %>\ import array @@ -21,7 +22,9 @@ import hightime # noqa: F401 import platform % endif +% if are_complex_parameters_used: import ${module_name}._complextype as _complextype # noqa: F401 +% endif import ${module_name}._library_singleton as _library_singleton import ${module_name}._visatype as _visatype % if config['enums']: @@ -47,12 +50,16 @@ def _get_ctypes_pointer_for_buffer(value=None, library_type=None, size=None): return ctypes.cast(addr, ctypes.POINTER(library_type)) elif str(type(value)).find("'numpy.ndarray'") != -1: import numpy + % if are_complex_parameters_used: if library_type in (_complextype.ComplexViInt16, _complextype.ComplexViReal32, _complextype.ComplexViReal64): complex_dtype = numpy.dtype(library_type) structured_array = value.view(complex_dtype) return structured_array.ctypes.data_as(ctypes.POINTER(library_type)) else: return numpy.ctypeslib.as_ctypes(value) + % else: + return numpy.ctypeslib.as_ctypes(value) + % endif elif isinstance(value, bytes): return ctypes.cast(value, ctypes.POINTER(library_type)) elif isinstance(value, list): diff --git a/docs/nirfsg/class.rst b/docs/nirfsg/class.rst index ff330c8342..c35091f21e 100644 --- a/docs/nirfsg/class.rst +++ b/docs/nirfsg/class.rst @@ -2690,63 +2690,6 @@ wait_until_settled :type max_time_milliseconds: int -write_arb_waveform ------------------- - - .. py:currentmodule:: nirfsg.Session - - .. py:method:: write_arb_waveform(waveform_name, waveform_data_array, more_data_pending) - - Writes an arbitrary waveform to the NI-RFSG device starting at the position of the last data written in onboard memory. - - This method accepts the complex baseband data in the form of numpy array of numpy.complex64 or numpy.complex128 or interleaved numpy array of numpy.int16. If the waveform to write is already allocated using the :py:meth:`nirfsg.Session.allocate_arb_waveform` method, the **:py:attr:`nirfsg.Session.MORE_DATA_PENDING`** parameter is ignored. The PXI-5670/5671 must be in the Configuration state before you call this method. When streaming is enabled, this method can be called when the PXIe-5672/5673/5673E or PXIe-5820/5830/5831/5832/5840/5841/5842/5860 is in the Generation state. - - **Supported Devices** : PXIe-5644/5645/5646, PXIe-5672/5673/5673E, PXIe-5820/5830/5831/5832/5840/5841/5842/5860 - - **Related Topics** - - `Streaming `_ - - `Assigning Properties or Properties to a Waveform `_ - - - - .. note:: This method only supports :py:data:`~nirfsg.PowerLevelType.PEAK` mode as specified in the :py:attr:`nirfsg.Session.power_level_type` property. If you download a waveform when using this method, you cannot set the :py:attr:`nirfsg.Session.power_level_type` to :py:data:`~nirfsg.PowerLevelType.AVERAGE` without causing error in the output. - - .. note:: One or more of the referenced properties are not in the Python API for this driver. - - - - :param waveform_name: - - - Specifies the name used to identify the waveform. This string is case-insensitive and alphanumeric, and it does not use reserved words. - - - - - :type waveform_name: str - :param waveform_data_array: - - - Specifies the array of data to load into the waveform. The array must have at least as many elements as the value in the **size_in_samples** parameter in the :py:meth:`nirfsg.Session.allocate_arb_waveform` method. - - - - - :type waveform_data_array: list of ComplexViReal64 - :param more_data_pending: - - - Specifies whether or not the data block contains the end of the waveform. Set this parameter to True to allow data to be appended later to the waveform. Splitting the waveform into multiple data blocks can reduce the memory requirements of the write operation. Append data to a previously written waveform by using the same waveform in the **name** parameter. Set **:py:attr:`nirfsg.Session.MORE_DATA_PENDING`** to False to indicate that this data block contains the end of the waveform. If the waveform is already allocated, this parameter is ignored. - - - - .. note:: One or more of the referenced properties are not in the Python API for this driver. - - - :type more_data_pending: bool - write_p2_p_endpoint_i16 ----------------------- diff --git a/docs/nirfsg/examples.rst b/docs/nirfsg/examples.rst index 3202debb57..aeaca2c243 100644 --- a/docs/nirfsg/examples.rst +++ b/docs/nirfsg/examples.rst @@ -3,15 +3,6 @@ Examples `You can download all nirfsg examples here `_ -nirfsg_arb_waveform.py ----------------------- - -.. literalinclude:: ../../src/nirfsg/examples/nirfsg_arb_waveform.py - :language: python - :linenos: - :encoding: utf8 - :caption: `(nirfsg_arb_waveform.py) `_ - nirfsg_cw.py ------------ @@ -21,12 +12,3 @@ nirfsg_cw.py :encoding: utf8 :caption: `(nirfsg_cw.py) `_ -nirfsg_script.py ----------------- - -.. literalinclude:: ../../src/nirfsg/examples/nirfsg_script.py - :language: python - :linenos: - :encoding: utf8 - :caption: `(nirfsg_script.py) `_ - diff --git a/generated/nidcpower/nidcpower/_library.py b/generated/nidcpower/nidcpower/_library.py index bc147c8f6b..2db23ea441 100644 --- a/generated/nidcpower/nidcpower/_library.py +++ b/generated/nidcpower/nidcpower/_library.py @@ -5,7 +5,6 @@ import nidcpower.errors as errors import threading -from nidcpower._complextype import * # noqa: F401,F403,H303 from nidcpower._visatype import * # noqa: F403,H303 import nidcpower.lcr_measurement as lcr_measurement # noqa: F401 diff --git a/generated/nidcpower/nidcpower/_library_interpreter.py b/generated/nidcpower/nidcpower/_library_interpreter.py index da33986c7c..473680f188 100644 --- a/generated/nidcpower/nidcpower/_library_interpreter.py +++ b/generated/nidcpower/nidcpower/_library_interpreter.py @@ -6,7 +6,6 @@ import hightime # noqa: F401 import platform -import nidcpower._complextype as _complextype # noqa: F401 import nidcpower._library_singleton as _library_singleton import nidcpower._visatype as _visatype import nidcpower.enums as enums # noqa: F401 @@ -28,12 +27,7 @@ def _get_ctypes_pointer_for_buffer(value=None, library_type=None, size=None): return ctypes.cast(addr, ctypes.POINTER(library_type)) elif str(type(value)).find("'numpy.ndarray'") != -1: import numpy - if library_type in (_complextype.ComplexViInt16, _complextype.ComplexViReal32, _complextype.ComplexViReal64): - complex_dtype = numpy.dtype(library_type) - structured_array = value.view(complex_dtype) - return structured_array.ctypes.data_as(ctypes.POINTER(library_type)) - else: - return numpy.ctypeslib.as_ctypes(value) + return numpy.ctypeslib.as_ctypes(value) elif isinstance(value, bytes): return ctypes.cast(value, ctypes.POINTER(library_type)) elif isinstance(value, list): diff --git a/generated/nidigital/nidigital/_library.py b/generated/nidigital/nidigital/_library.py index bdd440091c..1f1d78ed16 100644 --- a/generated/nidigital/nidigital/_library.py +++ b/generated/nidigital/nidigital/_library.py @@ -5,7 +5,6 @@ import nidigital.errors as errors import threading -from nidigital._complextype import * # noqa: F401,F403,H303 from nidigital._visatype import * # noqa: F403,H303 import nidigital.history_ram_cycle_information as history_ram_cycle_information # noqa: F401 diff --git a/generated/nidigital/nidigital/_library_interpreter.py b/generated/nidigital/nidigital/_library_interpreter.py index 78d56b4601..e830756ab8 100644 --- a/generated/nidigital/nidigital/_library_interpreter.py +++ b/generated/nidigital/nidigital/_library_interpreter.py @@ -6,7 +6,6 @@ import hightime # noqa: F401 import platform -import nidigital._complextype as _complextype # noqa: F401 import nidigital._library_singleton as _library_singleton import nidigital._visatype as _visatype import nidigital.enums as enums # noqa: F401 @@ -26,12 +25,7 @@ def _get_ctypes_pointer_for_buffer(value=None, library_type=None, size=None): return ctypes.cast(addr, ctypes.POINTER(library_type)) elif str(type(value)).find("'numpy.ndarray'") != -1: import numpy - if library_type in (_complextype.ComplexViInt16, _complextype.ComplexViReal32, _complextype.ComplexViReal64): - complex_dtype = numpy.dtype(library_type) - structured_array = value.view(complex_dtype) - return structured_array.ctypes.data_as(ctypes.POINTER(library_type)) - else: - return numpy.ctypeslib.as_ctypes(value) + return numpy.ctypeslib.as_ctypes(value) elif isinstance(value, bytes): return ctypes.cast(value, ctypes.POINTER(library_type)) elif isinstance(value, list): diff --git a/generated/nidmm/nidmm/_library.py b/generated/nidmm/nidmm/_library.py index 882fe10f33..67dc31dffb 100644 --- a/generated/nidmm/nidmm/_library.py +++ b/generated/nidmm/nidmm/_library.py @@ -5,7 +5,6 @@ import nidmm.errors as errors import threading -from nidmm._complextype import * # noqa: F401,F403,H303 from nidmm._visatype import * # noqa: F403,H303 diff --git a/generated/nidmm/nidmm/_library_interpreter.py b/generated/nidmm/nidmm/_library_interpreter.py index 0f517dd222..4e87b4274b 100644 --- a/generated/nidmm/nidmm/_library_interpreter.py +++ b/generated/nidmm/nidmm/_library_interpreter.py @@ -6,7 +6,6 @@ import hightime # noqa: F401 import platform -import nidmm._complextype as _complextype # noqa: F401 import nidmm._library_singleton as _library_singleton import nidmm._visatype as _visatype import nidmm.enums as enums # noqa: F401 @@ -24,12 +23,7 @@ def _get_ctypes_pointer_for_buffer(value=None, library_type=None, size=None): return ctypes.cast(addr, ctypes.POINTER(library_type)) elif str(type(value)).find("'numpy.ndarray'") != -1: import numpy - if library_type in (_complextype.ComplexViInt16, _complextype.ComplexViReal32, _complextype.ComplexViReal64): - complex_dtype = numpy.dtype(library_type) - structured_array = value.view(complex_dtype) - return structured_array.ctypes.data_as(ctypes.POINTER(library_type)) - else: - return numpy.ctypeslib.as_ctypes(value) + return numpy.ctypeslib.as_ctypes(value) elif isinstance(value, bytes): return ctypes.cast(value, ctypes.POINTER(library_type)) elif isinstance(value, list): diff --git a/generated/nifake/nifake/_library.py b/generated/nifake/nifake/_library.py index ce7ed08730..028527957a 100644 --- a/generated/nifake/nifake/_library.py +++ b/generated/nifake/nifake/_library.py @@ -5,7 +5,7 @@ import nifake.errors as errors import threading -from nifake._complextype import * # noqa: F401,F403,H303 +import nifake._complextype as _complextype # noqa: F401 from nifake._visatype import * # noqa: F403,H303 import nifake.custom_struct as custom_struct # noqa: F401 diff --git a/generated/nifgen/nifgen/_library.py b/generated/nifgen/nifgen/_library.py index 1aba8f7fd3..92a4ed764c 100644 --- a/generated/nifgen/nifgen/_library.py +++ b/generated/nifgen/nifgen/_library.py @@ -5,7 +5,6 @@ import nifgen.errors as errors import threading -from nifgen._complextype import * # noqa: F401,F403,H303 from nifgen._visatype import * # noqa: F403,H303 diff --git a/generated/nifgen/nifgen/_library_interpreter.py b/generated/nifgen/nifgen/_library_interpreter.py index 5e6dab7c47..6370353a26 100644 --- a/generated/nifgen/nifgen/_library_interpreter.py +++ b/generated/nifgen/nifgen/_library_interpreter.py @@ -6,7 +6,6 @@ import hightime # noqa: F401 import platform -import nifgen._complextype as _complextype # noqa: F401 import nifgen._library_singleton as _library_singleton import nifgen._visatype as _visatype import nifgen.enums as enums # noqa: F401 @@ -24,12 +23,7 @@ def _get_ctypes_pointer_for_buffer(value=None, library_type=None, size=None): return ctypes.cast(addr, ctypes.POINTER(library_type)) elif str(type(value)).find("'numpy.ndarray'") != -1: import numpy - if library_type in (_complextype.ComplexViInt16, _complextype.ComplexViReal32, _complextype.ComplexViReal64): - complex_dtype = numpy.dtype(library_type) - structured_array = value.view(complex_dtype) - return structured_array.ctypes.data_as(ctypes.POINTER(library_type)) - else: - return numpy.ctypeslib.as_ctypes(value) + return numpy.ctypeslib.as_ctypes(value) elif isinstance(value, bytes): return ctypes.cast(value, ctypes.POINTER(library_type)) elif isinstance(value, list): diff --git a/generated/nimodinst/nimodinst/_library.py b/generated/nimodinst/nimodinst/_library.py index ab88660dc3..7f1f8f140c 100644 --- a/generated/nimodinst/nimodinst/_library.py +++ b/generated/nimodinst/nimodinst/_library.py @@ -5,7 +5,6 @@ import nimodinst.errors as errors import threading -from nimodinst._complextype import * # noqa: F401,F403,H303 from nimodinst._visatype import * # noqa: F403,H303 diff --git a/generated/nimodinst/nimodinst/_library_interpreter.py b/generated/nimodinst/nimodinst/_library_interpreter.py index 57107267f1..b51ce157e1 100644 --- a/generated/nimodinst/nimodinst/_library_interpreter.py +++ b/generated/nimodinst/nimodinst/_library_interpreter.py @@ -4,7 +4,6 @@ import array import ctypes import hightime # noqa: F401 -import nimodinst._complextype as _complextype # noqa: F401 import nimodinst._library_singleton as _library_singleton import nimodinst._visatype as _visatype import nimodinst.errors as errors @@ -18,12 +17,7 @@ def _get_ctypes_pointer_for_buffer(value=None, library_type=None, size=None): return ctypes.cast(addr, ctypes.POINTER(library_type)) elif str(type(value)).find("'numpy.ndarray'") != -1: import numpy - if library_type in (_complextype.ComplexViInt16, _complextype.ComplexViReal32, _complextype.ComplexViReal64): - complex_dtype = numpy.dtype(library_type) - structured_array = value.view(complex_dtype) - return structured_array.ctypes.data_as(ctypes.POINTER(library_type)) - else: - return numpy.ctypeslib.as_ctypes(value) + return numpy.ctypeslib.as_ctypes(value) elif isinstance(value, bytes): return ctypes.cast(value, ctypes.POINTER(library_type)) elif isinstance(value, list): diff --git a/generated/nirfsg/nirfsg/_library.py b/generated/nirfsg/nirfsg/_library.py index 6244f88d68..dc194ec708 100644 --- a/generated/nirfsg/nirfsg/_library.py +++ b/generated/nirfsg/nirfsg/_library.py @@ -5,7 +5,6 @@ import nirfsg.errors as errors import threading -from nirfsg._complextype import * # noqa: F401,F403,H303 from nirfsg._visatype import * # noqa: F403,H303 @@ -106,9 +105,6 @@ def __init__(self, ctypes_library): self.niRFSG_SetWaveformMarkerEventLocations_cfunc = None self.niRFSG_UnlockSession_cfunc = None self.niRFSG_WaitUntilSettled_cfunc = None - self.niRFSG_WriteArbWaveformComplexF32_cfunc = None - self.niRFSG_WriteArbWaveformComplexF64_cfunc = None - self.niRFSG_WriteArbWaveformComplexI16_cfunc = None self.niRFSG_WriteP2PEndpointI16_cfunc = None self.niRFSG_WriteScript_cfunc = None self.niRFSG_close_cfunc = None @@ -808,30 +804,6 @@ def niRFSG_WaitUntilSettled(self, vi, max_time_milliseconds): # noqa: N802 self.niRFSG_WaitUntilSettled_cfunc.restype = ViStatus # noqa: F405 return self.niRFSG_WaitUntilSettled_cfunc(vi, max_time_milliseconds) - def niRFSG_WriteArbWaveformComplexF32(self, vi, waveform_name, number_of_samples, waveform_data_array, more_data_pending): # noqa: N802 - with self._func_lock: - if self.niRFSG_WriteArbWaveformComplexF32_cfunc is None: - self.niRFSG_WriteArbWaveformComplexF32_cfunc = self._get_library_function('niRFSG_WriteArbWaveformComplexF32') - self.niRFSG_WriteArbWaveformComplexF32_cfunc.argtypes = [ViSession, ctypes.POINTER(ViChar), ViInt32, ctypes.POINTER(ComplexViReal32), ViBoolean] # noqa: F405 - self.niRFSG_WriteArbWaveformComplexF32_cfunc.restype = ViStatus # noqa: F405 - return self.niRFSG_WriteArbWaveformComplexF32_cfunc(vi, waveform_name, number_of_samples, waveform_data_array, more_data_pending) - - def niRFSG_WriteArbWaveformComplexF64(self, vi, waveform_name, number_of_samples, waveform_data_array, more_data_pending): # noqa: N802 - with self._func_lock: - if self.niRFSG_WriteArbWaveformComplexF64_cfunc is None: - self.niRFSG_WriteArbWaveformComplexF64_cfunc = self._get_library_function('niRFSG_WriteArbWaveformComplexF64') - self.niRFSG_WriteArbWaveformComplexF64_cfunc.argtypes = [ViSession, ctypes.POINTER(ViChar), ViInt32, ctypes.POINTER(ComplexViReal64), ViBoolean] # noqa: F405 - self.niRFSG_WriteArbWaveformComplexF64_cfunc.restype = ViStatus # noqa: F405 - return self.niRFSG_WriteArbWaveformComplexF64_cfunc(vi, waveform_name, number_of_samples, waveform_data_array, more_data_pending) - - def niRFSG_WriteArbWaveformComplexI16(self, vi, waveform_name, number_of_samples, waveform_data_array): # noqa: N802 - with self._func_lock: - if self.niRFSG_WriteArbWaveformComplexI16_cfunc is None: - self.niRFSG_WriteArbWaveformComplexI16_cfunc = self._get_library_function('niRFSG_WriteArbWaveformComplexI16') - self.niRFSG_WriteArbWaveformComplexI16_cfunc.argtypes = [ViSession, ctypes.POINTER(ViChar), ViInt32, ctypes.POINTER(ComplexViInt16)] # noqa: F405 - self.niRFSG_WriteArbWaveformComplexI16_cfunc.restype = ViStatus # noqa: F405 - return self.niRFSG_WriteArbWaveformComplexI16_cfunc(vi, waveform_name, number_of_samples, waveform_data_array) - def niRFSG_WriteP2PEndpointI16(self, vi, stream_endpoint, number_of_samples, endpoint_data): # noqa: N802 with self._func_lock: if self.niRFSG_WriteP2PEndpointI16_cfunc is None: diff --git a/generated/nirfsg/nirfsg/_library_interpreter.py b/generated/nirfsg/nirfsg/_library_interpreter.py index f6a5a5750a..0646b26fd7 100644 --- a/generated/nirfsg/nirfsg/_library_interpreter.py +++ b/generated/nirfsg/nirfsg/_library_interpreter.py @@ -4,7 +4,6 @@ import array import ctypes import hightime # noqa: F401 -import nirfsg._complextype as _complextype # noqa: F401 import nirfsg._library_singleton as _library_singleton import nirfsg._visatype as _visatype import nirfsg.enums as enums # noqa: F401 @@ -19,12 +18,7 @@ def _get_ctypes_pointer_for_buffer(value=None, library_type=None, size=None): return ctypes.cast(addr, ctypes.POINTER(library_type)) elif str(type(value)).find("'numpy.ndarray'") != -1: import numpy - if library_type in (_complextype.ComplexViInt16, _complextype.ComplexViReal32, _complextype.ComplexViReal64): - complex_dtype = numpy.dtype(library_type) - structured_array = value.view(complex_dtype) - return structured_array.ctypes.data_as(ctypes.POINTER(library_type)) - else: - return numpy.ctypeslib.as_ctypes(value) + return numpy.ctypeslib.as_ctypes(value) elif isinstance(value, bytes): return ctypes.cast(value, ctypes.POINTER(library_type)) elif isinstance(value, list): @@ -786,35 +780,6 @@ def wait_until_settled(self, max_time_milliseconds): # noqa: N802 errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) return - def write_arb_waveform_complex_f32(self, waveform_name, waveform_data_array, more_data_pending): # noqa: N802 - vi_ctype = _visatype.ViSession(self._vi) # case S110 - waveform_name_ctype = ctypes.create_string_buffer(waveform_name.encode(self._encoding)) # case C020 - number_of_samples_ctype = _visatype.ViInt32(0 if waveform_data_array is None else len(waveform_data_array)) # case S160 - waveform_data_array_ctype = _get_ctypes_pointer_for_buffer(value=waveform_data_array, library_type=_complextype.ComplexViReal32) # case B510 - more_data_pending_ctype = _visatype.ViBoolean(more_data_pending) # case S150 - error_code = self._library.niRFSG_WriteArbWaveformComplexF32(vi_ctype, waveform_name_ctype, number_of_samples_ctype, waveform_data_array_ctype, more_data_pending_ctype) - errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) - return - - def write_arb_waveform_complex_f64(self, waveform_name, waveform_data_array, more_data_pending): # noqa: N802 - vi_ctype = _visatype.ViSession(self._vi) # case S110 - waveform_name_ctype = ctypes.create_string_buffer(waveform_name.encode(self._encoding)) # case C020 - number_of_samples_ctype = _visatype.ViInt32(0 if waveform_data_array is None else len(waveform_data_array)) # case S160 - waveform_data_array_ctype = _get_ctypes_pointer_for_buffer(value=waveform_data_array, library_type=_complextype.ComplexViReal64) # case B510 - more_data_pending_ctype = _visatype.ViBoolean(more_data_pending) # case S150 - error_code = self._library.niRFSG_WriteArbWaveformComplexF64(vi_ctype, waveform_name_ctype, number_of_samples_ctype, waveform_data_array_ctype, more_data_pending_ctype) - errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) - return - - def write_arb_waveform_complex_i16(self, waveform_name, waveform_data_array): # noqa: N802 - vi_ctype = _visatype.ViSession(self._vi) # case S110 - waveform_name_ctype = ctypes.create_string_buffer(waveform_name.encode(self._encoding)) # case C020 - number_of_samples_ctype = _visatype.ViInt32(0 if waveform_data_array is None else len(waveform_data_array) // 2) # case S160 - waveform_data_array_ctype = _get_ctypes_pointer_for_buffer(value=waveform_data_array, library_type=_complextype.ComplexViInt16) # case B510 - error_code = self._library.niRFSG_WriteArbWaveformComplexI16(vi_ctype, waveform_name_ctype, number_of_samples_ctype, waveform_data_array_ctype) - errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) - return - def write_p2_p_endpoint_i16(self, stream_endpoint, number_of_samples, endpoint_data): # noqa: N802 vi_ctype = _visatype.ViSession(self._vi) # case S110 stream_endpoint_ctype = ctypes.create_string_buffer(stream_endpoint.encode(self._encoding)) # case C020 diff --git a/generated/nirfsg/nirfsg/session.py b/generated/nirfsg/nirfsg/session.py index 08a8796765..c81c41bad1 100644 --- a/generated/nirfsg/nirfsg/session.py +++ b/generated/nirfsg/nirfsg/session.py @@ -7990,164 +7990,6 @@ def wait_until_settled(self, max_time_milliseconds): ''' self._interpreter.wait_until_settled(max_time_milliseconds) - def _write_arb_waveform_complex_f32(self, waveform_name, waveform_data_array, more_data_pending): - r'''_write_arb_waveform_complex_f32 - - Writes an arbitrary waveform to the NI-RFSG device starting at the position of the last data written in onboard memory. - - This method accepts the complex baseband data in the form of complex singles. If the waveform to write is already allocated using the allocate_arb_waveform method, the **MORE_DATA_PENDING** parameter is ignored. The PXI-5670/5671 must be in the Configuration state before you call this method. When streaming is enabled, you can call this method when the PXIe-5672/5673/5673E or PXIe-5820/5830/5831/5832/5840/5841/5842/5860 is in the Generation state. - - **Supported Devices** : PXIe-5644/5645/5646, PXI-5670/5671, PXIe-5672/5673/5673E, PXIe-5820/5830/5831/5832/5840/5841/5842/5860 - - **Related Topics** - - `Streaming `_ - - `Assigning Properties or Properties to a Waveform `_ - - Note: On the PXIe-5644/5645/5646, PXIe-5672/5673/5673E, and PXIe-5820/5830/5831/5832/5840/5841/5842/5860, the **MORE_DATA_PENDING** parameter is always ignored. To write data in blocks on these devices, you must allocate the waveform before writing it. - - Note: - One or more of the referenced properties are not in the Python API for this driver. - - Args: - waveform_name (str): Specifies the name used to identify the waveform. This string is case-insensitive and alphanumeric, and it does not use reserved words. - - waveform_data_array (numpy.array(dtype=numpy.complex64)): Specifies the array of data to load into the waveform. The array must have at least as many elements as the value in the **size_in_samples** parameter in the allocate_arb_waveform method. - - more_data_pending (bool): Specifies whether or not the data block contains the end of the waveform. Set this parameter to True to allow data to be appended later to the waveform. Splitting the waveform into multiple data blocks can reduce the memory requirements of the write operation. Append data to a previously written waveform by using the same waveform in the WAVEFORM_NAME parameter. Set **MORE_DATA_PENDING** to False to indicate that this data block contains the end of the waveform. If the waveform is already allocated, this parameter is ignored. - - Note: - One or more of the referenced properties are not in the Python API for this driver. - - ''' - import numpy - - if type(waveform_data_array) is not numpy.ndarray: - raise TypeError('waveform_data_array must be {0}, is {1}'.format(numpy.ndarray, type(waveform_data_array))) - if numpy.isfortran(waveform_data_array) is True: - raise TypeError('waveform_data_array must be in C-order') - if waveform_data_array.dtype is not numpy.dtype('complex64'): - raise TypeError('waveform_data_array must be numpy.ndarray of dtype=complex64, is ' + str(waveform_data_array.dtype)) - self._interpreter.write_arb_waveform_complex_f32(waveform_name, waveform_data_array, more_data_pending) - - def _write_arb_waveform_complex_f64(self, waveform_name, waveform_data_array, more_data_pending): - r'''_write_arb_waveform_complex_f64 - - Writes an arbitrary waveform to the NI-RFSG device starting at the position of the last data written in onboard memory. - - This method accepts the complex baseband data in the form of complex doubles. If the waveform to write is already allocated using the allocate_arb_waveform, the moreDataPending parameter is ignored. The PXI-5670/5671 must be in the Configuration state before you call this method. When streaming is enabled, you can call this method when the PXIe-5672/5673/5673E or PXIe-5820/5830/5831/5832/5840/5841/5842 is in the Generation state. - - **Supported Devices** : PXIe-5644/5645/5646, PXI-5670/5671, PXIe-5672/5673/5673E, PXIe-5820/5830/5831/5832/5840/5841/5842 - - **Related Topics** - - `Streaming `_ - - `Assigning Properties or Properties to a Waveform `_ - - Note: On the PXIe-5644/5645/5646, PXIe-5672/5673/5673E, and PXIe-5820/5830/5831/5832/5840/5841/5842, the moreDataPending parameter is always ignored. To write data in blocks on these devices, you must allocate the waveform before writing it. - - Args: - waveform_name (str): Specifies the name used to identify the waveform. This string is case-insensitive and alphanumeric, and it does not use reserved words. - - waveform_data_array (numpy.array(dtype=numpy.complex128)): Specifies the array of data to load into the waveform. The array must have at least as many elements as the value in the **size_in_samples** parameter in the allocate_arb_waveform method. - - more_data_pending (bool): Specifies whether or not the data block contains the end of the waveform. Set this parameter to True to allow data to be appended later to the waveform. Splitting the waveform into multiple data blocks can reduce the memory requirements of the write operation. Append data to a previously written waveform by using the same waveform in the **name** parameter. Set **MORE_DATA_PENDING** to False to indicate that this data block contains the end of the waveform. If the waveform is already allocated, this parameter is ignored. - - Note: - One or more of the referenced properties are not in the Python API for this driver. - - ''' - import numpy - - if type(waveform_data_array) is not numpy.ndarray: - raise TypeError('waveform_data_array must be {0}, is {1}'.format(numpy.ndarray, type(waveform_data_array))) - if numpy.isfortran(waveform_data_array) is True: - raise TypeError('waveform_data_array must be in C-order') - if waveform_data_array.dtype is not numpy.dtype('complex128'): - raise TypeError('waveform_data_array must be numpy.ndarray of dtype=complex128, is ' + str(waveform_data_array.dtype)) - self._interpreter.write_arb_waveform_complex_f64(waveform_name, waveform_data_array, more_data_pending) - - def _write_arb_waveform_complex_i16(self, waveform_name, waveform_data_array): - r'''_write_arb_waveform_complex_i16 - - Writes an arbitrary waveform to the NI-RFSG device starting at the position of the last data written in onboard memory. - - This method accepts the interleaved I/Q data of a complex baseband signal. The PXI-5670/5671 must be in the Configuration state before you call this method. When streaming is enabled, this method can be called when the PXIe-5672/5673/5673E or PXIe-5820/5830/5831/5832/5840/5841/5842/5860 is in the Generation state. - - **Supported Devices** : PXIe-5644/5645/5646, PXIe-5672/5673/5673E, PXIe-5820/5830/5831/5832/5840/5841/5842/5860 - - **Related Topics** - - `Streaming `_ - - `Assigning Properties or Properties to a Waveform `_ - - Note: This method only supports PowerLevelType.PEAK mode as specified in the power_level_type property. If you download a waveform when using this method, you cannot set the power_level_type to PowerLevelType.AVERAGE without causing error in the output. - - Args: - waveform_name (str): Specifies the name used to identify the waveform. This string is case-insensitive and alphanumeric, and it does not use reserved words. - - waveform_data_array (numpy.array(dtype=numpy.int16)): Specifies the array of data to load into the waveform. The array must have at least as many elements as the value in the **size_in_samples** parameter in the allocate_arb_waveform method. - - ''' - import numpy - - if type(waveform_data_array) is not numpy.ndarray: - raise TypeError('waveform_data_array must be {0}, is {1}'.format(numpy.ndarray, type(waveform_data_array))) - if numpy.isfortran(waveform_data_array) is True: - raise TypeError('waveform_data_array must be in C-order') - if waveform_data_array.dtype is not numpy.dtype('int16'): - raise TypeError('waveform_data_array must be numpy.ndarray of dtype=int16, is ' + str(waveform_data_array.dtype)) - self._interpreter.write_arb_waveform_complex_i16(waveform_name, waveform_data_array) - - def write_arb_waveform(self, waveform_name, waveform_data_array, more_data_pending): - '''write_arb_waveform - - Writes an arbitrary waveform to the NI-RFSG device starting at the position of the last data written in onboard memory. - - This method accepts the complex baseband data in the form of numpy array of numpy.complex64 or numpy.complex128 or interleaved numpy array of numpy.int16. If the waveform to write is already allocated using the allocate_arb_waveform method, the **MORE_DATA_PENDING** parameter is ignored. The PXI-5670/5671 must be in the Configuration state before you call this method. When streaming is enabled, this method can be called when the PXIe-5672/5673/5673E or PXIe-5820/5830/5831/5832/5840/5841/5842/5860 is in the Generation state. - - **Supported Devices** : PXIe-5644/5645/5646, PXIe-5672/5673/5673E, PXIe-5820/5830/5831/5832/5840/5841/5842/5860 - - **Related Topics** - - `Streaming `_ - - `Assigning Properties or Properties to a Waveform `_ - - Note: This method only supports PowerLevelType.PEAK mode as specified in the power_level_type property. If you download a waveform when using this method, you cannot set the power_level_type to PowerLevelType.AVERAGE without causing error in the output. - - Note: - One or more of the referenced properties are not in the Python API for this driver. - - Args: - waveform_name (str): Specifies the name used to identify the waveform. This string is case-insensitive and alphanumeric, and it does not use reserved words. - - waveform_data_array (list of ComplexViReal64): Specifies the array of data to load into the waveform. The array must have at least as many elements as the value in the **size_in_samples** parameter in the allocate_arb_waveform method. - - more_data_pending (bool): Specifies whether or not the data block contains the end of the waveform. Set this parameter to True to allow data to be appended later to the waveform. Splitting the waveform into multiple data blocks can reduce the memory requirements of the write operation. Append data to a previously written waveform by using the same waveform in the **name** parameter. Set **MORE_DATA_PENDING** to False to indicate that this data block contains the end of the waveform. If the waveform is already allocated, this parameter is ignored. - - Note: - One or more of the referenced properties are not in the Python API for this driver. - - ''' - if str(type(waveform_data_array)).find("'numpy.ndarray'") != -1: - import numpy - if waveform_data_array.dtype == numpy.complex128: - return self._write_arb_waveform_complex_f64(waveform_name, waveform_data_array, more_data_pending) - elif waveform_data_array.dtype == numpy.complex64: - return self._write_arb_waveform_complex_f32(waveform_name, waveform_data_array, more_data_pending) - elif waveform_data_array.dtype == numpy.int16: - return self._write_arb_waveform_complex_i16(waveform_name, waveform_data_array, more_data_pending) - else: - raise TypeError("Unsupported dtype. Is {}, expected {} or {} or {}".format(waveform_data_array.dtype, numpy.complex128, numpy.complex64, numpy.int16)) - else: - raise TypeError("Unsupported dtype. Is {}, expected {} or {} or {}".format(waveform_data_array.dtype, numpy.complex128, numpy.complex64, numpy.int16)) - - return self._write_arb_waveform_complex_f64(waveform_name, waveform_data_array, more_data_pending) - def write_p2_p_endpoint_i16(self, stream_endpoint, number_of_samples, endpoint_data): r'''write_p2_p_endpoint_i16 diff --git a/generated/nirfsg/nirfsg/unit_tests/_mock_helper.py b/generated/nirfsg/nirfsg/unit_tests/_mock_helper.py index 9568297dae..e7a01aadde 100644 --- a/generated/nirfsg/nirfsg/unit_tests/_mock_helper.py +++ b/generated/nirfsg/nirfsg/unit_tests/_mock_helper.py @@ -231,12 +231,6 @@ def __init__(self): self._defaults['UnlockSession']['callerHasLock'] = None self._defaults['WaitUntilSettled'] = {} self._defaults['WaitUntilSettled']['return'] = 0 - self._defaults['WriteArbWaveformComplexF32'] = {} - self._defaults['WriteArbWaveformComplexF32']['return'] = 0 - self._defaults['WriteArbWaveformComplexF64'] = {} - self._defaults['WriteArbWaveformComplexF64']['return'] = 0 - self._defaults['WriteArbWaveformComplexI16'] = {} - self._defaults['WriteArbWaveformComplexI16']['return'] = 0 self._defaults['WriteP2PEndpointI16'] = {} self._defaults['WriteP2PEndpointI16']['return'] = 0 self._defaults['WriteScript'] = {} @@ -897,21 +891,6 @@ def niRFSG_WaitUntilSettled(self, vi, max_time_milliseconds): # noqa: N802 return self._defaults['WaitUntilSettled']['return'] return self._defaults['WaitUntilSettled']['return'] - def niRFSG_WriteArbWaveformComplexF32(self, vi, waveform_name, number_of_samples, waveform_data_array, more_data_pending): # noqa: N802 - if self._defaults['WriteArbWaveformComplexF32']['return'] != 0: - return self._defaults['WriteArbWaveformComplexF32']['return'] - return self._defaults['WriteArbWaveformComplexF32']['return'] - - def niRFSG_WriteArbWaveformComplexF64(self, vi, waveform_name, number_of_samples, waveform_data_array, more_data_pending): # noqa: N802 - if self._defaults['WriteArbWaveformComplexF64']['return'] != 0: - return self._defaults['WriteArbWaveformComplexF64']['return'] - return self._defaults['WriteArbWaveformComplexF64']['return'] - - def niRFSG_WriteArbWaveformComplexI16(self, vi, waveform_name, number_of_samples, waveform_data_array): # noqa: N802 - if self._defaults['WriteArbWaveformComplexI16']['return'] != 0: - return self._defaults['WriteArbWaveformComplexI16']['return'] - return self._defaults['WriteArbWaveformComplexI16']['return'] - def niRFSG_WriteP2PEndpointI16(self, vi, stream_endpoint, number_of_samples, endpoint_data): # noqa: N802 if self._defaults['WriteP2PEndpointI16']['return'] != 0: return self._defaults['WriteP2PEndpointI16']['return'] @@ -1101,12 +1080,6 @@ def set_side_effects_and_return_values(self, mock_library): mock_library.niRFSG_UnlockSession.return_value = 0 mock_library.niRFSG_WaitUntilSettled.side_effect = MockFunctionCallError("niRFSG_WaitUntilSettled") mock_library.niRFSG_WaitUntilSettled.return_value = 0 - mock_library.niRFSG_WriteArbWaveformComplexF32.side_effect = MockFunctionCallError("niRFSG_WriteArbWaveformComplexF32") - mock_library.niRFSG_WriteArbWaveformComplexF32.return_value = 0 - mock_library.niRFSG_WriteArbWaveformComplexF64.side_effect = MockFunctionCallError("niRFSG_WriteArbWaveformComplexF64") - mock_library.niRFSG_WriteArbWaveformComplexF64.return_value = 0 - mock_library.niRFSG_WriteArbWaveformComplexI16.side_effect = MockFunctionCallError("niRFSG_WriteArbWaveformComplexI16") - mock_library.niRFSG_WriteArbWaveformComplexI16.return_value = 0 mock_library.niRFSG_WriteP2PEndpointI16.side_effect = MockFunctionCallError("niRFSG_WriteP2PEndpointI16") mock_library.niRFSG_WriteP2PEndpointI16.return_value = 0 mock_library.niRFSG_WriteScript.side_effect = MockFunctionCallError("niRFSG_WriteScript") diff --git a/generated/niscope/niscope/_library.py b/generated/niscope/niscope/_library.py index c0cc59caa0..da85e7765a 100644 --- a/generated/niscope/niscope/_library.py +++ b/generated/niscope/niscope/_library.py @@ -5,7 +5,6 @@ import niscope.errors as errors import threading -from niscope._complextype import * # noqa: F401,F403,H303 from niscope._visatype import * # noqa: F403,H303 import niscope.waveform_info as waveform_info # noqa: F401 diff --git a/generated/niscope/niscope/_library_interpreter.py b/generated/niscope/niscope/_library_interpreter.py index c4068b7dce..1cb9a7d26a 100644 --- a/generated/niscope/niscope/_library_interpreter.py +++ b/generated/niscope/niscope/_library_interpreter.py @@ -6,7 +6,6 @@ import hightime # noqa: F401 import platform -import niscope._complextype as _complextype # noqa: F401 import niscope._library_singleton as _library_singleton import niscope._visatype as _visatype import niscope.enums as enums # noqa: F401 @@ -28,12 +27,7 @@ def _get_ctypes_pointer_for_buffer(value=None, library_type=None, size=None): return ctypes.cast(addr, ctypes.POINTER(library_type)) elif str(type(value)).find("'numpy.ndarray'") != -1: import numpy - if library_type in (_complextype.ComplexViInt16, _complextype.ComplexViReal32, _complextype.ComplexViReal64): - complex_dtype = numpy.dtype(library_type) - structured_array = value.view(complex_dtype) - return structured_array.ctypes.data_as(ctypes.POINTER(library_type)) - else: - return numpy.ctypeslib.as_ctypes(value) + return numpy.ctypeslib.as_ctypes(value) elif isinstance(value, bytes): return ctypes.cast(value, ctypes.POINTER(library_type)) elif isinstance(value, list): diff --git a/generated/nise/nise/_library.py b/generated/nise/nise/_library.py index b0e66f1136..05af687c9c 100644 --- a/generated/nise/nise/_library.py +++ b/generated/nise/nise/_library.py @@ -5,7 +5,6 @@ import nise.errors as errors import threading -from nise._complextype import * # noqa: F401,F403,H303 from nise._visatype import * # noqa: F403,H303 diff --git a/generated/nise/nise/_library_interpreter.py b/generated/nise/nise/_library_interpreter.py index ca29757e6d..ad3f07dd8d 100644 --- a/generated/nise/nise/_library_interpreter.py +++ b/generated/nise/nise/_library_interpreter.py @@ -4,7 +4,6 @@ import array import ctypes import hightime # noqa: F401 -import nise._complextype as _complextype # noqa: F401 import nise._library_singleton as _library_singleton import nise._visatype as _visatype import nise.enums as enums # noqa: F401 @@ -19,12 +18,7 @@ def _get_ctypes_pointer_for_buffer(value=None, library_type=None, size=None): return ctypes.cast(addr, ctypes.POINTER(library_type)) elif str(type(value)).find("'numpy.ndarray'") != -1: import numpy - if library_type in (_complextype.ComplexViInt16, _complextype.ComplexViReal32, _complextype.ComplexViReal64): - complex_dtype = numpy.dtype(library_type) - structured_array = value.view(complex_dtype) - return structured_array.ctypes.data_as(ctypes.POINTER(library_type)) - else: - return numpy.ctypeslib.as_ctypes(value) + return numpy.ctypeslib.as_ctypes(value) elif isinstance(value, bytes): return ctypes.cast(value, ctypes.POINTER(library_type)) elif isinstance(value, list): diff --git a/generated/niswitch/niswitch/_library.py b/generated/niswitch/niswitch/_library.py index 3b9a9d4238..a91d25167b 100644 --- a/generated/niswitch/niswitch/_library.py +++ b/generated/niswitch/niswitch/_library.py @@ -5,7 +5,6 @@ import niswitch.errors as errors import threading -from niswitch._complextype import * # noqa: F401,F403,H303 from niswitch._visatype import * # noqa: F403,H303 diff --git a/generated/niswitch/niswitch/_library_interpreter.py b/generated/niswitch/niswitch/_library_interpreter.py index 2f075d8b99..4d7dc8ea7c 100644 --- a/generated/niswitch/niswitch/_library_interpreter.py +++ b/generated/niswitch/niswitch/_library_interpreter.py @@ -6,7 +6,6 @@ import hightime # noqa: F401 import platform -import niswitch._complextype as _complextype # noqa: F401 import niswitch._library_singleton as _library_singleton import niswitch._visatype as _visatype import niswitch.enums as enums # noqa: F401 @@ -24,12 +23,7 @@ def _get_ctypes_pointer_for_buffer(value=None, library_type=None, size=None): return ctypes.cast(addr, ctypes.POINTER(library_type)) elif str(type(value)).find("'numpy.ndarray'") != -1: import numpy - if library_type in (_complextype.ComplexViInt16, _complextype.ComplexViReal32, _complextype.ComplexViReal64): - complex_dtype = numpy.dtype(library_type) - structured_array = value.view(complex_dtype) - return structured_array.ctypes.data_as(ctypes.POINTER(library_type)) - else: - return numpy.ctypeslib.as_ctypes(value) + return numpy.ctypeslib.as_ctypes(value) elif isinstance(value, bytes): return ctypes.cast(value, ctypes.POINTER(library_type)) elif isinstance(value, list): diff --git a/generated/nitclk/nitclk/_library.py b/generated/nitclk/nitclk/_library.py index 232168e79f..f8e44eae65 100644 --- a/generated/nitclk/nitclk/_library.py +++ b/generated/nitclk/nitclk/_library.py @@ -5,7 +5,6 @@ import nitclk.errors as errors import threading -from nitclk._complextype import * # noqa: F401,F403,H303 from nitclk._visatype import * # noqa: F403,H303 diff --git a/generated/nitclk/nitclk/_library_interpreter.py b/generated/nitclk/nitclk/_library_interpreter.py index 9de15347a9..8a23273dd6 100644 --- a/generated/nitclk/nitclk/_library_interpreter.py +++ b/generated/nitclk/nitclk/_library_interpreter.py @@ -4,7 +4,6 @@ import array import ctypes import hightime # noqa: F401 -import nitclk._complextype as _complextype # noqa: F401 import nitclk._library_singleton as _library_singleton import nitclk._visatype as _visatype import nitclk.errors as errors @@ -18,12 +17,7 @@ def _get_ctypes_pointer_for_buffer(value=None, library_type=None, size=None): return ctypes.cast(addr, ctypes.POINTER(library_type)) elif str(type(value)).find("'numpy.ndarray'") != -1: import numpy - if library_type in (_complextype.ComplexViInt16, _complextype.ComplexViReal32, _complextype.ComplexViReal64): - complex_dtype = numpy.dtype(library_type) - structured_array = value.view(complex_dtype) - return structured_array.ctypes.data_as(ctypes.POINTER(library_type)) - else: - return numpy.ctypeslib.as_ctypes(value) + return numpy.ctypeslib.as_ctypes(value) elif isinstance(value, bytes): return ctypes.cast(value, ctypes.POINTER(library_type)) elif isinstance(value, list): From 2d030ce1b9c5e8d0a5d9983a7dea806a6f38ccbe Mon Sep 17 00:00:00 2001 From: Rahul R Date: Mon, 9 Jun 2025 15:03:50 +0530 Subject: [PATCH 17/33] Updated matchers and complextype file to be generated bsaed on condition if complex is used --- build/defines.mak | 1 - build/templates/_matchers.py.mako | 12 ++++ generated/nidcpower/nidcpower/_complextype.py | 16 ----- .../nidcpower/unit_tests/_matchers.py | 61 ------------------- generated/nidigital/nidigital/_complextype.py | 16 ----- .../nidigital/unit_tests/_matchers.py | 61 ------------------- generated/nidmm/nidmm/_complextype.py | 16 ----- generated/nidmm/nidmm/unit_tests/_matchers.py | 61 ------------------- generated/nifgen/nifgen/_complextype.py | 16 ----- .../nifgen/nifgen/unit_tests/_matchers.py | 61 ------------------- generated/nimodinst/nimodinst/_complextype.py | 16 ----- .../nimodinst/unit_tests/_matchers.py | 61 ------------------- generated/nirfsg/nirfsg/_complextype.py | 16 ----- .../nirfsg/nirfsg/unit_tests/_matchers.py | 61 ------------------- generated/niscope/niscope/_complextype.py | 16 ----- .../niscope/niscope/unit_tests/_matchers.py | 61 ------------------- generated/nise/nise/_complextype.py | 16 ----- generated/nise/nise/unit_tests/_matchers.py | 61 ------------------- generated/niswitch/niswitch/_complextype.py | 16 ----- .../niswitch/niswitch/unit_tests/_matchers.py | 61 ------------------- generated/nitclk/nitclk/_complextype.py | 16 ----- .../nitclk/nitclk/unit_tests/_matchers.py | 61 ------------------- .../_complextype.py:Zone.Identifier | 0 src/nifake/nifake.mak | 3 +- 24 files changed, 14 insertions(+), 772 deletions(-) delete mode 100644 generated/nidcpower/nidcpower/_complextype.py delete mode 100644 generated/nidigital/nidigital/_complextype.py delete mode 100644 generated/nidmm/nidmm/_complextype.py delete mode 100644 generated/nifgen/nifgen/_complextype.py delete mode 100644 generated/nimodinst/nimodinst/_complextype.py delete mode 100644 generated/nirfsg/nirfsg/_complextype.py delete mode 100644 generated/niscope/niscope/_complextype.py delete mode 100644 generated/nise/nise/_complextype.py delete mode 100644 generated/niswitch/niswitch/_complextype.py delete mode 100644 generated/nitclk/nitclk/_complextype.py create mode 100644 src/nifake/custom_types/_complextype.py:Zone.Identifier diff --git a/build/defines.mak b/build/defines.mak index 07018c79e2..d3f05f999e 100644 --- a/build/defines.mak +++ b/build/defines.mak @@ -59,7 +59,6 @@ DEFAULT_PY_FILES_TO_GENERATE := \ unit_tests/_matchers.py \ __init__.py \ _converters.py \ - _complextype.py \ VERSION \ $(if $(GRPC_SUPPORTED), \ _grpc_stub_interpreter.py \ diff --git a/build/templates/_matchers.py.mako b/build/templates/_matchers.py.mako index da587f9379..238ac18a5b 100644 --- a/build/templates/_matchers.py.mako +++ b/build/templates/_matchers.py.mako @@ -3,9 +3,19 @@ ${template_parameters['encoding_tag']} '''Matcher classes used by unit tests in order to set mock expectations. These work well with our visatype definitions. ''' +<% +import build.helper as helper + +config = template_parameters['metadata'].config +functions = config['functions'] +functions = helper.filter_codegen_functions(functions) +are_complex_parameters_used = helper.are_complex_parameters_used(functions) +%>\ import ctypes +% if are_complex_parameters_used: import ${template_parameters['metadata'].config['module_name']}._complextype as _complextype +% endif import ${template_parameters['metadata'].config['module_name']}._visatype as _visatype import pprint @@ -271,6 +281,7 @@ class ViReal64PointerMatcher(_PointerMatcher): def __init__(self): _PointerMatcher.__init__(self, _visatype.ViReal64) +% if are_complex_parameters_used: class ComplexViReal64PointerMatcher(_PointerMatcher): def __init__(self, expected_data, expected_size): @@ -331,6 +342,7 @@ class ComplexViInt16PointerMatcher(_PointerMatcher): def __repr__(self): return f"ComplexViInt16PointerMatcher({self.expected_data})" +% endif # Buffers diff --git a/generated/nidcpower/nidcpower/_complextype.py b/generated/nidcpower/nidcpower/_complextype.py deleted file mode 100644 index 18fa25bc9f..0000000000 --- a/generated/nidcpower/nidcpower/_complextype.py +++ /dev/null @@ -1,16 +0,0 @@ -# -*- coding: utf-8 -*- -# This file was generated -import ctypes -import nidcpower._visatype as _visatype - - -class ComplexViReal64(ctypes.Structure): - _fields_ = [("real", _visatype.ViReal64), ("imag", _visatype.ViReal64)] - - -class ComplexViReal32(ctypes.Structure): - _fields_ = [("real", _visatype.ViReal32), ("imag", _visatype.ViReal32)] - - -class ComplexViInt16(ctypes.Structure): - _fields_ = [("real", _visatype.ViInt16), ("imag", _visatype.ViInt16)] diff --git a/generated/nidcpower/nidcpower/unit_tests/_matchers.py b/generated/nidcpower/nidcpower/unit_tests/_matchers.py index 0ed854fd83..6d99d60a36 100644 --- a/generated/nidcpower/nidcpower/unit_tests/_matchers.py +++ b/generated/nidcpower/nidcpower/unit_tests/_matchers.py @@ -5,7 +5,6 @@ ''' import ctypes -import nidcpower._complextype as _complextype import nidcpower._visatype as _visatype import pprint @@ -271,66 +270,6 @@ class ViReal64PointerMatcher(_PointerMatcher): def __init__(self): _PointerMatcher.__init__(self, _visatype.ViReal64) - -class ComplexViReal64PointerMatcher(_PointerMatcher): - def __init__(self, expected_data, expected_size): - _PointerMatcher.__init__(self, _complextype.ComplexViReal64) - self.expected_data = expected_data - self.expected_size = expected_size - - def __eq__(self, other): - _PointerMatcher.__eq__(self, other) - - for i in range(self.expected_size): - expected_value = self.expected_data[i] - actual_value = other[i] - if expected_value.real != actual_value.real or expected_value.imag != actual_value.imag: - return False - return True - - def __repr__(self): - return f"ComplexViReal64PointerMatcher({self.expected_data})" - - -class ComplexViReal32PointerMatcher(_PointerMatcher): - def __init__(self, expected_data, expected_size): - _PointerMatcher.__init__(self, _complextype.ComplexViReal32) - self.expected_data = expected_data - self.expected_size = expected_size - - def __eq__(self, other): - _PointerMatcher.__eq__(self, other) - - for i in range(self.expected_size): - expected_value = self.expected_data[i] - actual_value = other[i] - if expected_value.real != actual_value.real or expected_value.imag != actual_value.imag: - return False - return True - - def __repr__(self): - return f"ComplexViReal32PointerMatcher({self.expected_data})" - - -class ComplexViInt16PointerMatcher(_PointerMatcher): - def __init__(self, expected_data, expected_size): - _PointerMatcher.__init__(self, _complextype.ComplexViInt16) - self.expected_data = expected_data - self.expected_size = expected_size - - def __eq__(self, other): - _PointerMatcher.__eq__(self, other) - - for i in range(self.expected_size): - expected_value = self.expected_data[i] - actual_value = other[i] - if expected_value.real != actual_value.real or expected_value.imag != actual_value.imag: - return False - return True - - def __repr__(self): - return f"ComplexViInt16PointerMatcher({self.expected_data})" - # Buffers diff --git a/generated/nidigital/nidigital/_complextype.py b/generated/nidigital/nidigital/_complextype.py deleted file mode 100644 index f1bf040d0a..0000000000 --- a/generated/nidigital/nidigital/_complextype.py +++ /dev/null @@ -1,16 +0,0 @@ -# -*- coding: utf-8 -*- -# This file was generated -import ctypes -import nidigital._visatype as _visatype - - -class ComplexViReal64(ctypes.Structure): - _fields_ = [("real", _visatype.ViReal64), ("imag", _visatype.ViReal64)] - - -class ComplexViReal32(ctypes.Structure): - _fields_ = [("real", _visatype.ViReal32), ("imag", _visatype.ViReal32)] - - -class ComplexViInt16(ctypes.Structure): - _fields_ = [("real", _visatype.ViInt16), ("imag", _visatype.ViInt16)] diff --git a/generated/nidigital/nidigital/unit_tests/_matchers.py b/generated/nidigital/nidigital/unit_tests/_matchers.py index 0db630f6cb..bcad5ef58a 100644 --- a/generated/nidigital/nidigital/unit_tests/_matchers.py +++ b/generated/nidigital/nidigital/unit_tests/_matchers.py @@ -5,7 +5,6 @@ ''' import ctypes -import nidigital._complextype as _complextype import nidigital._visatype as _visatype import pprint @@ -271,66 +270,6 @@ class ViReal64PointerMatcher(_PointerMatcher): def __init__(self): _PointerMatcher.__init__(self, _visatype.ViReal64) - -class ComplexViReal64PointerMatcher(_PointerMatcher): - def __init__(self, expected_data, expected_size): - _PointerMatcher.__init__(self, _complextype.ComplexViReal64) - self.expected_data = expected_data - self.expected_size = expected_size - - def __eq__(self, other): - _PointerMatcher.__eq__(self, other) - - for i in range(self.expected_size): - expected_value = self.expected_data[i] - actual_value = other[i] - if expected_value.real != actual_value.real or expected_value.imag != actual_value.imag: - return False - return True - - def __repr__(self): - return f"ComplexViReal64PointerMatcher({self.expected_data})" - - -class ComplexViReal32PointerMatcher(_PointerMatcher): - def __init__(self, expected_data, expected_size): - _PointerMatcher.__init__(self, _complextype.ComplexViReal32) - self.expected_data = expected_data - self.expected_size = expected_size - - def __eq__(self, other): - _PointerMatcher.__eq__(self, other) - - for i in range(self.expected_size): - expected_value = self.expected_data[i] - actual_value = other[i] - if expected_value.real != actual_value.real or expected_value.imag != actual_value.imag: - return False - return True - - def __repr__(self): - return f"ComplexViReal32PointerMatcher({self.expected_data})" - - -class ComplexViInt16PointerMatcher(_PointerMatcher): - def __init__(self, expected_data, expected_size): - _PointerMatcher.__init__(self, _complextype.ComplexViInt16) - self.expected_data = expected_data - self.expected_size = expected_size - - def __eq__(self, other): - _PointerMatcher.__eq__(self, other) - - for i in range(self.expected_size): - expected_value = self.expected_data[i] - actual_value = other[i] - if expected_value.real != actual_value.real or expected_value.imag != actual_value.imag: - return False - return True - - def __repr__(self): - return f"ComplexViInt16PointerMatcher({self.expected_data})" - # Buffers diff --git a/generated/nidmm/nidmm/_complextype.py b/generated/nidmm/nidmm/_complextype.py deleted file mode 100644 index cce49cf095..0000000000 --- a/generated/nidmm/nidmm/_complextype.py +++ /dev/null @@ -1,16 +0,0 @@ -# -*- coding: utf-8 -*- -# This file was generated -import ctypes -import nidmm._visatype as _visatype - - -class ComplexViReal64(ctypes.Structure): - _fields_ = [("real", _visatype.ViReal64), ("imag", _visatype.ViReal64)] - - -class ComplexViReal32(ctypes.Structure): - _fields_ = [("real", _visatype.ViReal32), ("imag", _visatype.ViReal32)] - - -class ComplexViInt16(ctypes.Structure): - _fields_ = [("real", _visatype.ViInt16), ("imag", _visatype.ViInt16)] diff --git a/generated/nidmm/nidmm/unit_tests/_matchers.py b/generated/nidmm/nidmm/unit_tests/_matchers.py index 82d1e5f4be..7fd11be95b 100644 --- a/generated/nidmm/nidmm/unit_tests/_matchers.py +++ b/generated/nidmm/nidmm/unit_tests/_matchers.py @@ -5,7 +5,6 @@ ''' import ctypes -import nidmm._complextype as _complextype import nidmm._visatype as _visatype import pprint @@ -271,66 +270,6 @@ class ViReal64PointerMatcher(_PointerMatcher): def __init__(self): _PointerMatcher.__init__(self, _visatype.ViReal64) - -class ComplexViReal64PointerMatcher(_PointerMatcher): - def __init__(self, expected_data, expected_size): - _PointerMatcher.__init__(self, _complextype.ComplexViReal64) - self.expected_data = expected_data - self.expected_size = expected_size - - def __eq__(self, other): - _PointerMatcher.__eq__(self, other) - - for i in range(self.expected_size): - expected_value = self.expected_data[i] - actual_value = other[i] - if expected_value.real != actual_value.real or expected_value.imag != actual_value.imag: - return False - return True - - def __repr__(self): - return f"ComplexViReal64PointerMatcher({self.expected_data})" - - -class ComplexViReal32PointerMatcher(_PointerMatcher): - def __init__(self, expected_data, expected_size): - _PointerMatcher.__init__(self, _complextype.ComplexViReal32) - self.expected_data = expected_data - self.expected_size = expected_size - - def __eq__(self, other): - _PointerMatcher.__eq__(self, other) - - for i in range(self.expected_size): - expected_value = self.expected_data[i] - actual_value = other[i] - if expected_value.real != actual_value.real or expected_value.imag != actual_value.imag: - return False - return True - - def __repr__(self): - return f"ComplexViReal32PointerMatcher({self.expected_data})" - - -class ComplexViInt16PointerMatcher(_PointerMatcher): - def __init__(self, expected_data, expected_size): - _PointerMatcher.__init__(self, _complextype.ComplexViInt16) - self.expected_data = expected_data - self.expected_size = expected_size - - def __eq__(self, other): - _PointerMatcher.__eq__(self, other) - - for i in range(self.expected_size): - expected_value = self.expected_data[i] - actual_value = other[i] - if expected_value.real != actual_value.real or expected_value.imag != actual_value.imag: - return False - return True - - def __repr__(self): - return f"ComplexViInt16PointerMatcher({self.expected_data})" - # Buffers diff --git a/generated/nifgen/nifgen/_complextype.py b/generated/nifgen/nifgen/_complextype.py deleted file mode 100644 index 54ea0a9d36..0000000000 --- a/generated/nifgen/nifgen/_complextype.py +++ /dev/null @@ -1,16 +0,0 @@ -# -*- coding: utf-8 -*- -# This file was generated -import ctypes -import nifgen._visatype as _visatype - - -class ComplexViReal64(ctypes.Structure): - _fields_ = [("real", _visatype.ViReal64), ("imag", _visatype.ViReal64)] - - -class ComplexViReal32(ctypes.Structure): - _fields_ = [("real", _visatype.ViReal32), ("imag", _visatype.ViReal32)] - - -class ComplexViInt16(ctypes.Structure): - _fields_ = [("real", _visatype.ViInt16), ("imag", _visatype.ViInt16)] diff --git a/generated/nifgen/nifgen/unit_tests/_matchers.py b/generated/nifgen/nifgen/unit_tests/_matchers.py index 44444cbecd..d43f895502 100644 --- a/generated/nifgen/nifgen/unit_tests/_matchers.py +++ b/generated/nifgen/nifgen/unit_tests/_matchers.py @@ -5,7 +5,6 @@ ''' import ctypes -import nifgen._complextype as _complextype import nifgen._visatype as _visatype import pprint @@ -271,66 +270,6 @@ class ViReal64PointerMatcher(_PointerMatcher): def __init__(self): _PointerMatcher.__init__(self, _visatype.ViReal64) - -class ComplexViReal64PointerMatcher(_PointerMatcher): - def __init__(self, expected_data, expected_size): - _PointerMatcher.__init__(self, _complextype.ComplexViReal64) - self.expected_data = expected_data - self.expected_size = expected_size - - def __eq__(self, other): - _PointerMatcher.__eq__(self, other) - - for i in range(self.expected_size): - expected_value = self.expected_data[i] - actual_value = other[i] - if expected_value.real != actual_value.real or expected_value.imag != actual_value.imag: - return False - return True - - def __repr__(self): - return f"ComplexViReal64PointerMatcher({self.expected_data})" - - -class ComplexViReal32PointerMatcher(_PointerMatcher): - def __init__(self, expected_data, expected_size): - _PointerMatcher.__init__(self, _complextype.ComplexViReal32) - self.expected_data = expected_data - self.expected_size = expected_size - - def __eq__(self, other): - _PointerMatcher.__eq__(self, other) - - for i in range(self.expected_size): - expected_value = self.expected_data[i] - actual_value = other[i] - if expected_value.real != actual_value.real or expected_value.imag != actual_value.imag: - return False - return True - - def __repr__(self): - return f"ComplexViReal32PointerMatcher({self.expected_data})" - - -class ComplexViInt16PointerMatcher(_PointerMatcher): - def __init__(self, expected_data, expected_size): - _PointerMatcher.__init__(self, _complextype.ComplexViInt16) - self.expected_data = expected_data - self.expected_size = expected_size - - def __eq__(self, other): - _PointerMatcher.__eq__(self, other) - - for i in range(self.expected_size): - expected_value = self.expected_data[i] - actual_value = other[i] - if expected_value.real != actual_value.real or expected_value.imag != actual_value.imag: - return False - return True - - def __repr__(self): - return f"ComplexViInt16PointerMatcher({self.expected_data})" - # Buffers diff --git a/generated/nimodinst/nimodinst/_complextype.py b/generated/nimodinst/nimodinst/_complextype.py deleted file mode 100644 index e41e3d86b6..0000000000 --- a/generated/nimodinst/nimodinst/_complextype.py +++ /dev/null @@ -1,16 +0,0 @@ -# -*- coding: utf-8 -*- -# This file was generated -import ctypes -import nimodinst._visatype as _visatype - - -class ComplexViReal64(ctypes.Structure): - _fields_ = [("real", _visatype.ViReal64), ("imag", _visatype.ViReal64)] - - -class ComplexViReal32(ctypes.Structure): - _fields_ = [("real", _visatype.ViReal32), ("imag", _visatype.ViReal32)] - - -class ComplexViInt16(ctypes.Structure): - _fields_ = [("real", _visatype.ViInt16), ("imag", _visatype.ViInt16)] diff --git a/generated/nimodinst/nimodinst/unit_tests/_matchers.py b/generated/nimodinst/nimodinst/unit_tests/_matchers.py index 41958c8b62..2266d31144 100644 --- a/generated/nimodinst/nimodinst/unit_tests/_matchers.py +++ b/generated/nimodinst/nimodinst/unit_tests/_matchers.py @@ -5,7 +5,6 @@ ''' import ctypes -import nimodinst._complextype as _complextype import nimodinst._visatype as _visatype import pprint @@ -271,66 +270,6 @@ class ViReal64PointerMatcher(_PointerMatcher): def __init__(self): _PointerMatcher.__init__(self, _visatype.ViReal64) - -class ComplexViReal64PointerMatcher(_PointerMatcher): - def __init__(self, expected_data, expected_size): - _PointerMatcher.__init__(self, _complextype.ComplexViReal64) - self.expected_data = expected_data - self.expected_size = expected_size - - def __eq__(self, other): - _PointerMatcher.__eq__(self, other) - - for i in range(self.expected_size): - expected_value = self.expected_data[i] - actual_value = other[i] - if expected_value.real != actual_value.real or expected_value.imag != actual_value.imag: - return False - return True - - def __repr__(self): - return f"ComplexViReal64PointerMatcher({self.expected_data})" - - -class ComplexViReal32PointerMatcher(_PointerMatcher): - def __init__(self, expected_data, expected_size): - _PointerMatcher.__init__(self, _complextype.ComplexViReal32) - self.expected_data = expected_data - self.expected_size = expected_size - - def __eq__(self, other): - _PointerMatcher.__eq__(self, other) - - for i in range(self.expected_size): - expected_value = self.expected_data[i] - actual_value = other[i] - if expected_value.real != actual_value.real or expected_value.imag != actual_value.imag: - return False - return True - - def __repr__(self): - return f"ComplexViReal32PointerMatcher({self.expected_data})" - - -class ComplexViInt16PointerMatcher(_PointerMatcher): - def __init__(self, expected_data, expected_size): - _PointerMatcher.__init__(self, _complextype.ComplexViInt16) - self.expected_data = expected_data - self.expected_size = expected_size - - def __eq__(self, other): - _PointerMatcher.__eq__(self, other) - - for i in range(self.expected_size): - expected_value = self.expected_data[i] - actual_value = other[i] - if expected_value.real != actual_value.real or expected_value.imag != actual_value.imag: - return False - return True - - def __repr__(self): - return f"ComplexViInt16PointerMatcher({self.expected_data})" - # Buffers diff --git a/generated/nirfsg/nirfsg/_complextype.py b/generated/nirfsg/nirfsg/_complextype.py deleted file mode 100644 index 5592aec215..0000000000 --- a/generated/nirfsg/nirfsg/_complextype.py +++ /dev/null @@ -1,16 +0,0 @@ -# -*- coding: utf-8 -*- -# This file was generated -import ctypes -import nirfsg._visatype as _visatype - - -class ComplexViReal64(ctypes.Structure): - _fields_ = [("real", _visatype.ViReal64), ("imag", _visatype.ViReal64)] - - -class ComplexViReal32(ctypes.Structure): - _fields_ = [("real", _visatype.ViReal32), ("imag", _visatype.ViReal32)] - - -class ComplexViInt16(ctypes.Structure): - _fields_ = [("real", _visatype.ViInt16), ("imag", _visatype.ViInt16)] diff --git a/generated/nirfsg/nirfsg/unit_tests/_matchers.py b/generated/nirfsg/nirfsg/unit_tests/_matchers.py index 73aa445f06..9d25e383c0 100644 --- a/generated/nirfsg/nirfsg/unit_tests/_matchers.py +++ b/generated/nirfsg/nirfsg/unit_tests/_matchers.py @@ -5,7 +5,6 @@ ''' import ctypes -import nirfsg._complextype as _complextype import nirfsg._visatype as _visatype import pprint @@ -271,66 +270,6 @@ class ViReal64PointerMatcher(_PointerMatcher): def __init__(self): _PointerMatcher.__init__(self, _visatype.ViReal64) - -class ComplexViReal64PointerMatcher(_PointerMatcher): - def __init__(self, expected_data, expected_size): - _PointerMatcher.__init__(self, _complextype.ComplexViReal64) - self.expected_data = expected_data - self.expected_size = expected_size - - def __eq__(self, other): - _PointerMatcher.__eq__(self, other) - - for i in range(self.expected_size): - expected_value = self.expected_data[i] - actual_value = other[i] - if expected_value.real != actual_value.real or expected_value.imag != actual_value.imag: - return False - return True - - def __repr__(self): - return f"ComplexViReal64PointerMatcher({self.expected_data})" - - -class ComplexViReal32PointerMatcher(_PointerMatcher): - def __init__(self, expected_data, expected_size): - _PointerMatcher.__init__(self, _complextype.ComplexViReal32) - self.expected_data = expected_data - self.expected_size = expected_size - - def __eq__(self, other): - _PointerMatcher.__eq__(self, other) - - for i in range(self.expected_size): - expected_value = self.expected_data[i] - actual_value = other[i] - if expected_value.real != actual_value.real or expected_value.imag != actual_value.imag: - return False - return True - - def __repr__(self): - return f"ComplexViReal32PointerMatcher({self.expected_data})" - - -class ComplexViInt16PointerMatcher(_PointerMatcher): - def __init__(self, expected_data, expected_size): - _PointerMatcher.__init__(self, _complextype.ComplexViInt16) - self.expected_data = expected_data - self.expected_size = expected_size - - def __eq__(self, other): - _PointerMatcher.__eq__(self, other) - - for i in range(self.expected_size): - expected_value = self.expected_data[i] - actual_value = other[i] - if expected_value.real != actual_value.real or expected_value.imag != actual_value.imag: - return False - return True - - def __repr__(self): - return f"ComplexViInt16PointerMatcher({self.expected_data})" - # Buffers diff --git a/generated/niscope/niscope/_complextype.py b/generated/niscope/niscope/_complextype.py deleted file mode 100644 index f4a7c682c7..0000000000 --- a/generated/niscope/niscope/_complextype.py +++ /dev/null @@ -1,16 +0,0 @@ -# -*- coding: utf-8 -*- -# This file was generated -import ctypes -import niscope._visatype as _visatype - - -class ComplexViReal64(ctypes.Structure): - _fields_ = [("real", _visatype.ViReal64), ("imag", _visatype.ViReal64)] - - -class ComplexViReal32(ctypes.Structure): - _fields_ = [("real", _visatype.ViReal32), ("imag", _visatype.ViReal32)] - - -class ComplexViInt16(ctypes.Structure): - _fields_ = [("real", _visatype.ViInt16), ("imag", _visatype.ViInt16)] diff --git a/generated/niscope/niscope/unit_tests/_matchers.py b/generated/niscope/niscope/unit_tests/_matchers.py index 26bacb7c5d..d987853fdc 100644 --- a/generated/niscope/niscope/unit_tests/_matchers.py +++ b/generated/niscope/niscope/unit_tests/_matchers.py @@ -5,7 +5,6 @@ ''' import ctypes -import niscope._complextype as _complextype import niscope._visatype as _visatype import pprint @@ -271,66 +270,6 @@ class ViReal64PointerMatcher(_PointerMatcher): def __init__(self): _PointerMatcher.__init__(self, _visatype.ViReal64) - -class ComplexViReal64PointerMatcher(_PointerMatcher): - def __init__(self, expected_data, expected_size): - _PointerMatcher.__init__(self, _complextype.ComplexViReal64) - self.expected_data = expected_data - self.expected_size = expected_size - - def __eq__(self, other): - _PointerMatcher.__eq__(self, other) - - for i in range(self.expected_size): - expected_value = self.expected_data[i] - actual_value = other[i] - if expected_value.real != actual_value.real or expected_value.imag != actual_value.imag: - return False - return True - - def __repr__(self): - return f"ComplexViReal64PointerMatcher({self.expected_data})" - - -class ComplexViReal32PointerMatcher(_PointerMatcher): - def __init__(self, expected_data, expected_size): - _PointerMatcher.__init__(self, _complextype.ComplexViReal32) - self.expected_data = expected_data - self.expected_size = expected_size - - def __eq__(self, other): - _PointerMatcher.__eq__(self, other) - - for i in range(self.expected_size): - expected_value = self.expected_data[i] - actual_value = other[i] - if expected_value.real != actual_value.real or expected_value.imag != actual_value.imag: - return False - return True - - def __repr__(self): - return f"ComplexViReal32PointerMatcher({self.expected_data})" - - -class ComplexViInt16PointerMatcher(_PointerMatcher): - def __init__(self, expected_data, expected_size): - _PointerMatcher.__init__(self, _complextype.ComplexViInt16) - self.expected_data = expected_data - self.expected_size = expected_size - - def __eq__(self, other): - _PointerMatcher.__eq__(self, other) - - for i in range(self.expected_size): - expected_value = self.expected_data[i] - actual_value = other[i] - if expected_value.real != actual_value.real or expected_value.imag != actual_value.imag: - return False - return True - - def __repr__(self): - return f"ComplexViInt16PointerMatcher({self.expected_data})" - # Buffers diff --git a/generated/nise/nise/_complextype.py b/generated/nise/nise/_complextype.py deleted file mode 100644 index f10c1c6954..0000000000 --- a/generated/nise/nise/_complextype.py +++ /dev/null @@ -1,16 +0,0 @@ -# -*- coding: utf-8 -*- -# This file was generated -import ctypes -import nise._visatype as _visatype - - -class ComplexViReal64(ctypes.Structure): - _fields_ = [("real", _visatype.ViReal64), ("imag", _visatype.ViReal64)] - - -class ComplexViReal32(ctypes.Structure): - _fields_ = [("real", _visatype.ViReal32), ("imag", _visatype.ViReal32)] - - -class ComplexViInt16(ctypes.Structure): - _fields_ = [("real", _visatype.ViInt16), ("imag", _visatype.ViInt16)] diff --git a/generated/nise/nise/unit_tests/_matchers.py b/generated/nise/nise/unit_tests/_matchers.py index e0ba4d41c2..6cf8ccc9ae 100644 --- a/generated/nise/nise/unit_tests/_matchers.py +++ b/generated/nise/nise/unit_tests/_matchers.py @@ -5,7 +5,6 @@ ''' import ctypes -import nise._complextype as _complextype import nise._visatype as _visatype import pprint @@ -271,66 +270,6 @@ class ViReal64PointerMatcher(_PointerMatcher): def __init__(self): _PointerMatcher.__init__(self, _visatype.ViReal64) - -class ComplexViReal64PointerMatcher(_PointerMatcher): - def __init__(self, expected_data, expected_size): - _PointerMatcher.__init__(self, _complextype.ComplexViReal64) - self.expected_data = expected_data - self.expected_size = expected_size - - def __eq__(self, other): - _PointerMatcher.__eq__(self, other) - - for i in range(self.expected_size): - expected_value = self.expected_data[i] - actual_value = other[i] - if expected_value.real != actual_value.real or expected_value.imag != actual_value.imag: - return False - return True - - def __repr__(self): - return f"ComplexViReal64PointerMatcher({self.expected_data})" - - -class ComplexViReal32PointerMatcher(_PointerMatcher): - def __init__(self, expected_data, expected_size): - _PointerMatcher.__init__(self, _complextype.ComplexViReal32) - self.expected_data = expected_data - self.expected_size = expected_size - - def __eq__(self, other): - _PointerMatcher.__eq__(self, other) - - for i in range(self.expected_size): - expected_value = self.expected_data[i] - actual_value = other[i] - if expected_value.real != actual_value.real or expected_value.imag != actual_value.imag: - return False - return True - - def __repr__(self): - return f"ComplexViReal32PointerMatcher({self.expected_data})" - - -class ComplexViInt16PointerMatcher(_PointerMatcher): - def __init__(self, expected_data, expected_size): - _PointerMatcher.__init__(self, _complextype.ComplexViInt16) - self.expected_data = expected_data - self.expected_size = expected_size - - def __eq__(self, other): - _PointerMatcher.__eq__(self, other) - - for i in range(self.expected_size): - expected_value = self.expected_data[i] - actual_value = other[i] - if expected_value.real != actual_value.real or expected_value.imag != actual_value.imag: - return False - return True - - def __repr__(self): - return f"ComplexViInt16PointerMatcher({self.expected_data})" - # Buffers diff --git a/generated/niswitch/niswitch/_complextype.py b/generated/niswitch/niswitch/_complextype.py deleted file mode 100644 index 85f96c6856..0000000000 --- a/generated/niswitch/niswitch/_complextype.py +++ /dev/null @@ -1,16 +0,0 @@ -# -*- coding: utf-8 -*- -# This file was generated -import ctypes -import niswitch._visatype as _visatype - - -class ComplexViReal64(ctypes.Structure): - _fields_ = [("real", _visatype.ViReal64), ("imag", _visatype.ViReal64)] - - -class ComplexViReal32(ctypes.Structure): - _fields_ = [("real", _visatype.ViReal32), ("imag", _visatype.ViReal32)] - - -class ComplexViInt16(ctypes.Structure): - _fields_ = [("real", _visatype.ViInt16), ("imag", _visatype.ViInt16)] diff --git a/generated/niswitch/niswitch/unit_tests/_matchers.py b/generated/niswitch/niswitch/unit_tests/_matchers.py index d8d076538e..03a817978d 100644 --- a/generated/niswitch/niswitch/unit_tests/_matchers.py +++ b/generated/niswitch/niswitch/unit_tests/_matchers.py @@ -5,7 +5,6 @@ ''' import ctypes -import niswitch._complextype as _complextype import niswitch._visatype as _visatype import pprint @@ -271,66 +270,6 @@ class ViReal64PointerMatcher(_PointerMatcher): def __init__(self): _PointerMatcher.__init__(self, _visatype.ViReal64) - -class ComplexViReal64PointerMatcher(_PointerMatcher): - def __init__(self, expected_data, expected_size): - _PointerMatcher.__init__(self, _complextype.ComplexViReal64) - self.expected_data = expected_data - self.expected_size = expected_size - - def __eq__(self, other): - _PointerMatcher.__eq__(self, other) - - for i in range(self.expected_size): - expected_value = self.expected_data[i] - actual_value = other[i] - if expected_value.real != actual_value.real or expected_value.imag != actual_value.imag: - return False - return True - - def __repr__(self): - return f"ComplexViReal64PointerMatcher({self.expected_data})" - - -class ComplexViReal32PointerMatcher(_PointerMatcher): - def __init__(self, expected_data, expected_size): - _PointerMatcher.__init__(self, _complextype.ComplexViReal32) - self.expected_data = expected_data - self.expected_size = expected_size - - def __eq__(self, other): - _PointerMatcher.__eq__(self, other) - - for i in range(self.expected_size): - expected_value = self.expected_data[i] - actual_value = other[i] - if expected_value.real != actual_value.real or expected_value.imag != actual_value.imag: - return False - return True - - def __repr__(self): - return f"ComplexViReal32PointerMatcher({self.expected_data})" - - -class ComplexViInt16PointerMatcher(_PointerMatcher): - def __init__(self, expected_data, expected_size): - _PointerMatcher.__init__(self, _complextype.ComplexViInt16) - self.expected_data = expected_data - self.expected_size = expected_size - - def __eq__(self, other): - _PointerMatcher.__eq__(self, other) - - for i in range(self.expected_size): - expected_value = self.expected_data[i] - actual_value = other[i] - if expected_value.real != actual_value.real or expected_value.imag != actual_value.imag: - return False - return True - - def __repr__(self): - return f"ComplexViInt16PointerMatcher({self.expected_data})" - # Buffers diff --git a/generated/nitclk/nitclk/_complextype.py b/generated/nitclk/nitclk/_complextype.py deleted file mode 100644 index af2db0026c..0000000000 --- a/generated/nitclk/nitclk/_complextype.py +++ /dev/null @@ -1,16 +0,0 @@ -# -*- coding: utf-8 -*- -# This file was generated -import ctypes -import nitclk._visatype as _visatype - - -class ComplexViReal64(ctypes.Structure): - _fields_ = [("real", _visatype.ViReal64), ("imag", _visatype.ViReal64)] - - -class ComplexViReal32(ctypes.Structure): - _fields_ = [("real", _visatype.ViReal32), ("imag", _visatype.ViReal32)] - - -class ComplexViInt16(ctypes.Structure): - _fields_ = [("real", _visatype.ViInt16), ("imag", _visatype.ViInt16)] diff --git a/generated/nitclk/nitclk/unit_tests/_matchers.py b/generated/nitclk/nitclk/unit_tests/_matchers.py index 359749fec4..a529ddbc42 100644 --- a/generated/nitclk/nitclk/unit_tests/_matchers.py +++ b/generated/nitclk/nitclk/unit_tests/_matchers.py @@ -5,7 +5,6 @@ ''' import ctypes -import nitclk._complextype as _complextype import nitclk._visatype as _visatype import pprint @@ -271,66 +270,6 @@ class ViReal64PointerMatcher(_PointerMatcher): def __init__(self): _PointerMatcher.__init__(self, _visatype.ViReal64) - -class ComplexViReal64PointerMatcher(_PointerMatcher): - def __init__(self, expected_data, expected_size): - _PointerMatcher.__init__(self, _complextype.ComplexViReal64) - self.expected_data = expected_data - self.expected_size = expected_size - - def __eq__(self, other): - _PointerMatcher.__eq__(self, other) - - for i in range(self.expected_size): - expected_value = self.expected_data[i] - actual_value = other[i] - if expected_value.real != actual_value.real or expected_value.imag != actual_value.imag: - return False - return True - - def __repr__(self): - return f"ComplexViReal64PointerMatcher({self.expected_data})" - - -class ComplexViReal32PointerMatcher(_PointerMatcher): - def __init__(self, expected_data, expected_size): - _PointerMatcher.__init__(self, _complextype.ComplexViReal32) - self.expected_data = expected_data - self.expected_size = expected_size - - def __eq__(self, other): - _PointerMatcher.__eq__(self, other) - - for i in range(self.expected_size): - expected_value = self.expected_data[i] - actual_value = other[i] - if expected_value.real != actual_value.real or expected_value.imag != actual_value.imag: - return False - return True - - def __repr__(self): - return f"ComplexViReal32PointerMatcher({self.expected_data})" - - -class ComplexViInt16PointerMatcher(_PointerMatcher): - def __init__(self, expected_data, expected_size): - _PointerMatcher.__init__(self, _complextype.ComplexViInt16) - self.expected_data = expected_data - self.expected_size = expected_size - - def __eq__(self, other): - _PointerMatcher.__eq__(self, other) - - for i in range(self.expected_size): - expected_value = self.expected_data[i] - actual_value = other[i] - if expected_value.real != actual_value.real or expected_value.imag != actual_value.imag: - return False - return True - - def __repr__(self): - return f"ComplexViInt16PointerMatcher({self.expected_data})" - # Buffers diff --git a/src/nifake/custom_types/_complextype.py:Zone.Identifier b/src/nifake/custom_types/_complextype.py:Zone.Identifier new file mode 100644 index 0000000000..e69de29bb2 diff --git a/src/nifake/nifake.mak b/src/nifake/nifake.mak index a9f456f553..6e1a87dc04 100644 --- a/src/nifake/nifake.mak +++ b/src/nifake/nifake.mak @@ -2,7 +2,7 @@ include $(BUILD_HELPER_DIR)/defines.mak -MODULE_FILES_TO_GENERATE := $(DEFAULT_PY_FILES_TO_GENERATE) +MODULE_FILES_TO_GENERATE := $(DEFAULT_PY_FILES_TO_GENERATE) _complextype.py MODULE_FILES_TO_COPY := $(DEFAULT_PY_FILES_TO_COPY) @@ -14,6 +14,7 @@ CUSTOM_TYPES_TO_COPY += \ custom_struct.py \ custom_struct_typedef.py \ custom_struct_nested_typedef.py \ + _complextype.py \ include $(BUILD_HELPER_DIR)/rules.mak From 3cfb37d6738a060c9f8d27798d2b8b9373dbccf9 Mon Sep 17 00:00:00 2001 From: Rahul R Date: Mon, 9 Jun 2025 15:07:20 +0530 Subject: [PATCH 18/33] Updating spacing issue --- build/templates/_matchers.py.mako | 3 ++- generated/nidcpower/nidcpower/unit_tests/_matchers.py | 1 + generated/nidigital/nidigital/unit_tests/_matchers.py | 1 + generated/nidmm/nidmm/unit_tests/_matchers.py | 1 + generated/nifake/nifake/unit_tests/_matchers.py | 1 + generated/nifgen/nifgen/unit_tests/_matchers.py | 1 + generated/nimodinst/nimodinst/unit_tests/_matchers.py | 1 + generated/nirfsg/nirfsg/unit_tests/_matchers.py | 1 + generated/niscope/niscope/unit_tests/_matchers.py | 1 + generated/nise/nise/unit_tests/_matchers.py | 1 + generated/niswitch/niswitch/unit_tests/_matchers.py | 1 + generated/nitclk/nitclk/unit_tests/_matchers.py | 1 + 12 files changed, 13 insertions(+), 1 deletion(-) diff --git a/build/templates/_matchers.py.mako b/build/templates/_matchers.py.mako index 238ac18a5b..e76d548253 100644 --- a/build/templates/_matchers.py.mako +++ b/build/templates/_matchers.py.mako @@ -281,8 +281,8 @@ class ViReal64PointerMatcher(_PointerMatcher): def __init__(self): _PointerMatcher.__init__(self, _visatype.ViReal64) -% if are_complex_parameters_used: +% if are_complex_parameters_used: class ComplexViReal64PointerMatcher(_PointerMatcher): def __init__(self, expected_data, expected_size): _PointerMatcher.__init__(self, _complextype.ComplexViReal64) @@ -342,6 +342,7 @@ class ComplexViInt16PointerMatcher(_PointerMatcher): def __repr__(self): return f"ComplexViInt16PointerMatcher({self.expected_data})" + % endif # Buffers diff --git a/generated/nidcpower/nidcpower/unit_tests/_matchers.py b/generated/nidcpower/nidcpower/unit_tests/_matchers.py index 6d99d60a36..6e8e651bf0 100644 --- a/generated/nidcpower/nidcpower/unit_tests/_matchers.py +++ b/generated/nidcpower/nidcpower/unit_tests/_matchers.py @@ -270,6 +270,7 @@ class ViReal64PointerMatcher(_PointerMatcher): def __init__(self): _PointerMatcher.__init__(self, _visatype.ViReal64) + # Buffers diff --git a/generated/nidigital/nidigital/unit_tests/_matchers.py b/generated/nidigital/nidigital/unit_tests/_matchers.py index bcad5ef58a..2832a0b8f3 100644 --- a/generated/nidigital/nidigital/unit_tests/_matchers.py +++ b/generated/nidigital/nidigital/unit_tests/_matchers.py @@ -270,6 +270,7 @@ class ViReal64PointerMatcher(_PointerMatcher): def __init__(self): _PointerMatcher.__init__(self, _visatype.ViReal64) + # Buffers diff --git a/generated/nidmm/nidmm/unit_tests/_matchers.py b/generated/nidmm/nidmm/unit_tests/_matchers.py index 7fd11be95b..fa56c4cc55 100644 --- a/generated/nidmm/nidmm/unit_tests/_matchers.py +++ b/generated/nidmm/nidmm/unit_tests/_matchers.py @@ -270,6 +270,7 @@ class ViReal64PointerMatcher(_PointerMatcher): def __init__(self): _PointerMatcher.__init__(self, _visatype.ViReal64) + # Buffers diff --git a/generated/nifake/nifake/unit_tests/_matchers.py b/generated/nifake/nifake/unit_tests/_matchers.py index 751a463e93..54c002d5ba 100644 --- a/generated/nifake/nifake/unit_tests/_matchers.py +++ b/generated/nifake/nifake/unit_tests/_matchers.py @@ -331,6 +331,7 @@ def __eq__(self, other): def __repr__(self): return f"ComplexViInt16PointerMatcher({self.expected_data})" + # Buffers diff --git a/generated/nifgen/nifgen/unit_tests/_matchers.py b/generated/nifgen/nifgen/unit_tests/_matchers.py index d43f895502..d2bcbe40dc 100644 --- a/generated/nifgen/nifgen/unit_tests/_matchers.py +++ b/generated/nifgen/nifgen/unit_tests/_matchers.py @@ -270,6 +270,7 @@ class ViReal64PointerMatcher(_PointerMatcher): def __init__(self): _PointerMatcher.__init__(self, _visatype.ViReal64) + # Buffers diff --git a/generated/nimodinst/nimodinst/unit_tests/_matchers.py b/generated/nimodinst/nimodinst/unit_tests/_matchers.py index 2266d31144..4e0efc7343 100644 --- a/generated/nimodinst/nimodinst/unit_tests/_matchers.py +++ b/generated/nimodinst/nimodinst/unit_tests/_matchers.py @@ -270,6 +270,7 @@ class ViReal64PointerMatcher(_PointerMatcher): def __init__(self): _PointerMatcher.__init__(self, _visatype.ViReal64) + # Buffers diff --git a/generated/nirfsg/nirfsg/unit_tests/_matchers.py b/generated/nirfsg/nirfsg/unit_tests/_matchers.py index 9d25e383c0..4a8ac9681e 100644 --- a/generated/nirfsg/nirfsg/unit_tests/_matchers.py +++ b/generated/nirfsg/nirfsg/unit_tests/_matchers.py @@ -270,6 +270,7 @@ class ViReal64PointerMatcher(_PointerMatcher): def __init__(self): _PointerMatcher.__init__(self, _visatype.ViReal64) + # Buffers diff --git a/generated/niscope/niscope/unit_tests/_matchers.py b/generated/niscope/niscope/unit_tests/_matchers.py index d987853fdc..9f46f7d6a4 100644 --- a/generated/niscope/niscope/unit_tests/_matchers.py +++ b/generated/niscope/niscope/unit_tests/_matchers.py @@ -270,6 +270,7 @@ class ViReal64PointerMatcher(_PointerMatcher): def __init__(self): _PointerMatcher.__init__(self, _visatype.ViReal64) + # Buffers diff --git a/generated/nise/nise/unit_tests/_matchers.py b/generated/nise/nise/unit_tests/_matchers.py index 6cf8ccc9ae..696c4cb342 100644 --- a/generated/nise/nise/unit_tests/_matchers.py +++ b/generated/nise/nise/unit_tests/_matchers.py @@ -270,6 +270,7 @@ class ViReal64PointerMatcher(_PointerMatcher): def __init__(self): _PointerMatcher.__init__(self, _visatype.ViReal64) + # Buffers diff --git a/generated/niswitch/niswitch/unit_tests/_matchers.py b/generated/niswitch/niswitch/unit_tests/_matchers.py index 03a817978d..87ccdfae68 100644 --- a/generated/niswitch/niswitch/unit_tests/_matchers.py +++ b/generated/niswitch/niswitch/unit_tests/_matchers.py @@ -270,6 +270,7 @@ class ViReal64PointerMatcher(_PointerMatcher): def __init__(self): _PointerMatcher.__init__(self, _visatype.ViReal64) + # Buffers diff --git a/generated/nitclk/nitclk/unit_tests/_matchers.py b/generated/nitclk/nitclk/unit_tests/_matchers.py index a529ddbc42..a8740388d6 100644 --- a/generated/nitclk/nitclk/unit_tests/_matchers.py +++ b/generated/nitclk/nitclk/unit_tests/_matchers.py @@ -270,6 +270,7 @@ class ViReal64PointerMatcher(_PointerMatcher): def __init__(self): _PointerMatcher.__init__(self, _visatype.ViReal64) + # Buffers From 6aeda17d3cf9f48ecff0d0a1300ff79f79efa6b9 Mon Sep 17 00:00:00 2001 From: Rahul R Date: Mon, 9 Jun 2025 16:30:49 +0530 Subject: [PATCH 19/33] Updating the complex variables and code review comments incorporated --- build/helper/codegen_helper.py | 4 +- build/helper/helper.py | 44 +++++++++---------- build/templates/_complextype.py.mako | 6 +-- build/templates/_library_interpreter.py.mako | 2 +- build/templates/_matchers.py.mako | 18 ++++---- generated/nifake/nifake/_complextype.py | 6 +-- generated/nifake/nifake/_library.py | 6 +-- .../nifake/nifake/_library_interpreter.py | 8 ++-- .../nifake/nifake/unit_tests/_matchers.py | 18 ++++---- .../unit_tests/test_library_interpreter.py | 24 +++++----- src/nifake/metadata/functions.py | 6 +-- .../unit_tests/test_library_interpreter.py | 24 +++++----- tox-travis.ini | 1 - tox.ini | 1 - 14 files changed, 83 insertions(+), 85 deletions(-) diff --git a/build/helper/codegen_helper.py b/build/helper/codegen_helper.py index 33ab3f09f7..a4ed2ebb23 100644 --- a/build/helper/codegen_helper.py +++ b/build/helper/codegen_helper.py @@ -366,8 +366,8 @@ def _get_ctype_variable_definition_snippet_for_scalar(parameter, parameters, ivi definition = '{}.{}({}) # case S150'.format(module_name, parameter['ctypes_type'], parameter['python_name']) elif corresponding_buffer_parameters and corresponding_buffer_parameters[0]['direction'] == 'in': # We are only looking at the first one to see if it is 'in'. Assumes all are the same here, assert below if not # Parameter denotes the size of another (the "corresponding") parameter. - - # Interleaved array length is going to be double the length of number of samples + # Interleaved array length is going to be double the length of number of samples. + # This is used for complex waveforms, where the real and imaginary parts are interleaved in the array. if 'interleaved' in corresponding_buffer_parameters[0]['complex_type']: definitions.append(parameter['ctypes_variable_name'] + ' = {0}.{1}(0 if {2} is None else len({2}) // 2) # case S160'.format(module_name, parameter['ctypes_type'], corresponding_buffer_parameters[0]['python_name'])) else: diff --git a/build/helper/helper.py b/build/helper/helper.py index 4f79143a4b..42d295b097 100644 --- a/build/helper/helper.py +++ b/build/helper/helper.py @@ -7,28 +7,28 @@ # noqa statements because we want to format the table in a readable way _type_map = { - 'ViConstString': { 'array_type': None, 'python_type': 'str', 'numpy_type': None, }, # noqa: E201, E202, E241 - 'ViString': { 'array_type': None, 'python_type': 'str', 'numpy_type': None, }, # noqa: E201, E202, E241 - 'ViInt8': { 'array_type': 'b', 'python_type': 'int', 'numpy_type': 'int8', }, # noqa: E201, E202, E241 - 'ViUInt8': { 'array_type': 'B', 'python_type': 'int', 'numpy_type': 'uint8', }, # noqa: E201, E202, E241 - 'ViInt16': { 'array_type': 'h', 'python_type': 'int', 'numpy_type': 'int16', }, # noqa: E201, E202, E241 - 'ViUInt16': { 'array_type': 'H', 'python_type': 'int', 'numpy_type': 'uint16', }, # noqa: E201, E202, E241 - 'ViInt32': { 'array_type': 'l', 'python_type': 'int', 'numpy_type': 'int32', }, # noqa: E201, E202, E241 - 'ViUInt32': { 'array_type': 'L', 'python_type': 'int', 'numpy_type': 'uint32', }, # noqa: E201, E202, E241 - 'ViInt64': { 'array_type': 'q', 'python_type': 'int', 'numpy_type': 'int64', }, # noqa: E201, E202, E241 - 'ViUInt64': { 'array_type': 'Q', 'python_type': 'int', 'numpy_type': 'uint64', }, # noqa: E201, E202, E241 - 'ViReal32': { 'array_type': 'f', 'python_type': 'float', 'numpy_type': 'float32', }, # noqa: E201, E202, E241 - 'ViReal64': { 'array_type': 'd', 'python_type': 'float', 'numpy_type': 'float64', }, # noqa: E201, E202, E241 - 'ViStatus': { 'array_type': None, 'python_type': 'int', 'numpy_type': None, }, # noqa: E201, E202, E241 - 'ViSession': { 'array_type': None, 'python_type': 'int', 'numpy_type': None, }, # noqa: E201, E202, E241 - 'ViAttr': { 'array_type': None, 'python_type': 'int', 'numpy_type': None, }, # noqa: E201, E202, E241 - 'ViChar': { 'array_type': None, 'python_type': 'int', 'numpy_type': None, }, # noqa: E201, E202, E241 - 'ViChar[]': { 'array_type': None, 'python_type': 'str', 'numpy_type': None, }, # noqa: E201, E202, E241 - 'ViBoolean': { 'array_type': None, 'python_type': 'bool', 'numpy_type': None, }, # noqa: E201, E202, E241 - 'ViRsrc': { 'array_type': None, 'python_type': 'str', 'numpy_type': 'bool_', }, # noqa: E201, E202, E241 - 'ComplexViReal64': { 'array_type': None, 'python_type': None, 'numpy_type': 'complex128', }, # noqa: E201, E202, E241 - 'ComplexViReal32': { 'array_type': None, 'python_type': None, 'numpy_type': 'complex64', }, # noqa: E201, E202, E241 - 'ComplexViInt16': { 'array_type': None, 'python_type': None, 'numpy_type': 'int16', }, # noqa: E201, E202, E241 + 'ViConstString': { 'array_type': None, 'python_type': 'str', 'numpy_type': None, }, # noqa: E201, E202, E241 + 'ViString': { 'array_type': None, 'python_type': 'str', 'numpy_type': None, }, # noqa: E201, E202, E241 + 'ViInt8': { 'array_type': 'b', 'python_type': 'int', 'numpy_type': 'int8', }, # noqa: E201, E202, E241 + 'ViUInt8': { 'array_type': 'B', 'python_type': 'int', 'numpy_type': 'uint8', }, # noqa: E201, E202, E241 + 'ViInt16': { 'array_type': 'h', 'python_type': 'int', 'numpy_type': 'int16', }, # noqa: E201, E202, E241 + 'ViUInt16': { 'array_type': 'H', 'python_type': 'int', 'numpy_type': 'uint16', }, # noqa: E201, E202, E241 + 'ViInt32': { 'array_type': 'l', 'python_type': 'int', 'numpy_type': 'int32', }, # noqa: E201, E202, E241 + 'ViUInt32': { 'array_type': 'L', 'python_type': 'int', 'numpy_type': 'uint32', }, # noqa: E201, E202, E241 + 'ViInt64': { 'array_type': 'q', 'python_type': 'int', 'numpy_type': 'int64', }, # noqa: E201, E202, E241 + 'ViUInt64': { 'array_type': 'Q', 'python_type': 'int', 'numpy_type': 'uint64', }, # noqa: E201, E202, E241 + 'ViReal32': { 'array_type': 'f', 'python_type': 'float', 'numpy_type': 'float32', }, # noqa: E201, E202, E241 + 'ViReal64': { 'array_type': 'd', 'python_type': 'float', 'numpy_type': 'float64', }, # noqa: E201, E202, E241 + 'ViStatus': { 'array_type': None, 'python_type': 'int', 'numpy_type': None, }, # noqa: E201, E202, E241 + 'ViSession': { 'array_type': None, 'python_type': 'int', 'numpy_type': None, }, # noqa: E201, E202, E241 + 'ViAttr': { 'array_type': None, 'python_type': 'int', 'numpy_type': None, }, # noqa: E201, E202, E241 + 'ViChar': { 'array_type': None, 'python_type': 'int', 'numpy_type': None, }, # noqa: E201, E202, E241 + 'ViChar[]': { 'array_type': None, 'python_type': 'str', 'numpy_type': None, }, # noqa: E201, E202, E241 + 'ViBoolean': { 'array_type': None, 'python_type': 'bool', 'numpy_type': None, }, # noqa: E201, E202, E241 + 'ViRsrc': { 'array_type': None, 'python_type': 'str', 'numpy_type': 'bool_', }, # noqa: E201, E202, E241 + 'NIComplexNumber': { 'array_type': None, 'python_type': None, 'numpy_type': 'complex128', }, # noqa: E201, E202, E241 + 'NIComplexNumberF32': { 'array_type': None, 'python_type': None, 'numpy_type': 'complex64', }, # noqa: E201, E202, E241 + 'NIComplexI16': { 'array_type': None, 'python_type': None, 'numpy_type': 'int16', }, # noqa: E201, E202, E241 } diff --git a/build/templates/_complextype.py.mako b/build/templates/_complextype.py.mako index a821597854..83060bd4c4 100644 --- a/build/templates/_complextype.py.mako +++ b/build/templates/_complextype.py.mako @@ -9,13 +9,13 @@ import ctypes import ${module_name}._visatype as _visatype -class ComplexViReal64(ctypes.Structure): +class NIComplexNumber(ctypes.Structure): _fields_ = [("real", _visatype.ViReal64), ("imag", _visatype.ViReal64)] -class ComplexViReal32(ctypes.Structure): +class NIComplexNumberF32(ctypes.Structure): _fields_ = [("real", _visatype.ViReal32), ("imag", _visatype.ViReal32)] -class ComplexViInt16(ctypes.Structure): +class NIComplexI16(ctypes.Structure): _fields_ = [("real", _visatype.ViInt16), ("imag", _visatype.ViInt16)] diff --git a/build/templates/_library_interpreter.py.mako b/build/templates/_library_interpreter.py.mako index 6c99c0b276..8407b7ea3f 100644 --- a/build/templates/_library_interpreter.py.mako +++ b/build/templates/_library_interpreter.py.mako @@ -51,7 +51,7 @@ def _get_ctypes_pointer_for_buffer(value=None, library_type=None, size=None): elif str(type(value)).find("'numpy.ndarray'") != -1: import numpy % if are_complex_parameters_used: - if library_type in (_complextype.ComplexViInt16, _complextype.ComplexViReal32, _complextype.ComplexViReal64): + if library_type in (_complextype.NIComplexI16, _complextype.NIComplexNumberF32, _complextype.NIComplexNumber): complex_dtype = numpy.dtype(library_type) structured_array = value.view(complex_dtype) return structured_array.ctypes.data_as(ctypes.POINTER(library_type)) diff --git a/build/templates/_matchers.py.mako b/build/templates/_matchers.py.mako index e76d548253..53f3006dab 100644 --- a/build/templates/_matchers.py.mako +++ b/build/templates/_matchers.py.mako @@ -283,9 +283,9 @@ class ViReal64PointerMatcher(_PointerMatcher): % if are_complex_parameters_used: -class ComplexViReal64PointerMatcher(_PointerMatcher): +class NIComplexNumberPointerMatcher(_PointerMatcher): def __init__(self, expected_data, expected_size): - _PointerMatcher.__init__(self, _complextype.ComplexViReal64) + _PointerMatcher.__init__(self, _complextype.NIComplexNumber) self.expected_data = expected_data self.expected_size = expected_size @@ -300,12 +300,12 @@ class ComplexViReal64PointerMatcher(_PointerMatcher): return True def __repr__(self): - return f"ComplexViReal64PointerMatcher({self.expected_data})" + return f"NIComplexNumberPointerMatcher({self.expected_data})" -class ComplexViReal32PointerMatcher(_PointerMatcher): +class NIComplexNumberF32PointerMatcher(_PointerMatcher): def __init__(self, expected_data, expected_size): - _PointerMatcher.__init__(self, _complextype.ComplexViReal32) + _PointerMatcher.__init__(self, _complextype.NIComplexNumberF32) self.expected_data = expected_data self.expected_size = expected_size @@ -320,12 +320,12 @@ class ComplexViReal32PointerMatcher(_PointerMatcher): return True def __repr__(self): - return f"ComplexViReal32PointerMatcher({self.expected_data})" + return f"NIComplexNumberF32PointerMatcher({self.expected_data})" -class ComplexViInt16PointerMatcher(_PointerMatcher): +class NIComplexI16PointerMatcher(_PointerMatcher): def __init__(self, expected_data, expected_size): - _PointerMatcher.__init__(self, _complextype.ComplexViInt16) + _PointerMatcher.__init__(self, _complextype.NIComplexI16) self.expected_data = expected_data self.expected_size = expected_size @@ -340,7 +340,7 @@ class ComplexViInt16PointerMatcher(_PointerMatcher): return True def __repr__(self): - return f"ComplexViInt16PointerMatcher({self.expected_data})" + return f"NIComplexI16PointerMatcher({self.expected_data})" % endif diff --git a/generated/nifake/nifake/_complextype.py b/generated/nifake/nifake/_complextype.py index 270ecac82a..e23fa1b7e2 100644 --- a/generated/nifake/nifake/_complextype.py +++ b/generated/nifake/nifake/_complextype.py @@ -4,13 +4,13 @@ import nifake._visatype as _visatype -class ComplexViReal64(ctypes.Structure): +class NIComplexNumber(ctypes.Structure): _fields_ = [("real", _visatype.ViReal64), ("imag", _visatype.ViReal64)] -class ComplexViReal32(ctypes.Structure): +class NIComplexNumberF32(ctypes.Structure): _fields_ = [("real", _visatype.ViReal32), ("imag", _visatype.ViReal32)] -class ComplexViInt16(ctypes.Structure): +class NIComplexI16(ctypes.Structure): _fields_ = [("real", _visatype.ViInt16), ("imag", _visatype.ViInt16)] diff --git a/generated/nifake/nifake/_library.py b/generated/nifake/nifake/_library.py index 028527957a..6b5aa2f595 100644 --- a/generated/nifake/nifake/_library.py +++ b/generated/nifake/nifake/_library.py @@ -647,7 +647,7 @@ def niFake_WriteWaveformComplexF32(self, vi, number_of_samples, waveform_data_ar with self._func_lock: if self.niFake_WriteWaveformComplexF32_cfunc is None: self.niFake_WriteWaveformComplexF32_cfunc = self._get_library_function('niFake_WriteWaveformComplexF32') - self.niFake_WriteWaveformComplexF32_cfunc.argtypes = [ViSession, ViInt32, ctypes.POINTER(ComplexViReal32)] # noqa: F405 + self.niFake_WriteWaveformComplexF32_cfunc.argtypes = [ViSession, ViInt32, ctypes.POINTER(NIComplexNumberF32)] # noqa: F405 self.niFake_WriteWaveformComplexF32_cfunc.restype = ViStatus # noqa: F405 return self.niFake_WriteWaveformComplexF32_cfunc(vi, number_of_samples, waveform_data_array) @@ -655,7 +655,7 @@ def niFake_WriteWaveformComplexF64(self, vi, number_of_samples, waveform_data_ar with self._func_lock: if self.niFake_WriteWaveformComplexF64_cfunc is None: self.niFake_WriteWaveformComplexF64_cfunc = self._get_library_function('niFake_WriteWaveformComplexF64') - self.niFake_WriteWaveformComplexF64_cfunc.argtypes = [ViSession, ViInt32, ctypes.POINTER(ComplexViReal64)] # noqa: F405 + self.niFake_WriteWaveformComplexF64_cfunc.argtypes = [ViSession, ViInt32, ctypes.POINTER(NIComplexNumber)] # noqa: F405 self.niFake_WriteWaveformComplexF64_cfunc.restype = ViStatus # noqa: F405 return self.niFake_WriteWaveformComplexF64_cfunc(vi, number_of_samples, waveform_data_array) @@ -663,7 +663,7 @@ def niFake_WriteWaveformComplexI16(self, vi, number_of_samples, waveform_data_ar with self._func_lock: if self.niFake_WriteWaveformComplexI16_cfunc is None: self.niFake_WriteWaveformComplexI16_cfunc = self._get_library_function('niFake_WriteWaveformComplexI16') - self.niFake_WriteWaveformComplexI16_cfunc.argtypes = [ViSession, ViInt32, ctypes.POINTER(ComplexViInt16)] # noqa: F405 + self.niFake_WriteWaveformComplexI16_cfunc.argtypes = [ViSession, ViInt32, ctypes.POINTER(NIComplexI16)] # noqa: F405 self.niFake_WriteWaveformComplexI16_cfunc.restype = ViStatus # noqa: F405 return self.niFake_WriteWaveformComplexI16_cfunc(vi, number_of_samples, waveform_data_array) diff --git a/generated/nifake/nifake/_library_interpreter.py b/generated/nifake/nifake/_library_interpreter.py index c88cbc632f..798ba9bf4a 100644 --- a/generated/nifake/nifake/_library_interpreter.py +++ b/generated/nifake/nifake/_library_interpreter.py @@ -30,7 +30,7 @@ def _get_ctypes_pointer_for_buffer(value=None, library_type=None, size=None): return ctypes.cast(addr, ctypes.POINTER(library_type)) elif str(type(value)).find("'numpy.ndarray'") != -1: import numpy - if library_type in (_complextype.ComplexViInt16, _complextype.ComplexViReal32, _complextype.ComplexViReal64): + if library_type in (_complextype.NIComplexI16, _complextype.NIComplexNumberF32, _complextype.NIComplexNumber): complex_dtype = numpy.dtype(library_type) structured_array = value.view(complex_dtype) return structured_array.ctypes.data_as(ctypes.POINTER(library_type)) @@ -741,7 +741,7 @@ def write_waveform_numpy(self, waveform): # noqa: N802 def write_waveform_complex_f32(self, waveform_data_array): # noqa: N802 vi_ctype = _visatype.ViSession(self._vi) # case S110 number_of_samples_ctype = _visatype.ViInt32(0 if waveform_data_array is None else len(waveform_data_array)) # case S160 - waveform_data_array_ctype = _get_ctypes_pointer_for_buffer(value=waveform_data_array, library_type=_complextype.ComplexViReal32) # case B510 + waveform_data_array_ctype = _get_ctypes_pointer_for_buffer(value=waveform_data_array, library_type=_complextype.NIComplexNumberF32) # case B510 error_code = self._library.niFake_WriteWaveformComplexF32(vi_ctype, number_of_samples_ctype, waveform_data_array_ctype) errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) return @@ -749,7 +749,7 @@ def write_waveform_complex_f32(self, waveform_data_array): # noqa: N802 def write_waveform_complex_f64(self, waveform_data_array): # noqa: N802 vi_ctype = _visatype.ViSession(self._vi) # case S110 number_of_samples_ctype = _visatype.ViInt32(0 if waveform_data_array is None else len(waveform_data_array)) # case S160 - waveform_data_array_ctype = _get_ctypes_pointer_for_buffer(value=waveform_data_array, library_type=_complextype.ComplexViReal64) # case B510 + waveform_data_array_ctype = _get_ctypes_pointer_for_buffer(value=waveform_data_array, library_type=_complextype.NIComplexNumber) # case B510 error_code = self._library.niFake_WriteWaveformComplexF64(vi_ctype, number_of_samples_ctype, waveform_data_array_ctype) errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) return @@ -757,7 +757,7 @@ def write_waveform_complex_f64(self, waveform_data_array): # noqa: N802 def write_waveform_complex_i16(self, waveform_data_array): # noqa: N802 vi_ctype = _visatype.ViSession(self._vi) # case S110 number_of_samples_ctype = _visatype.ViInt32(0 if waveform_data_array is None else len(waveform_data_array) // 2) # case S160 - waveform_data_array_ctype = _get_ctypes_pointer_for_buffer(value=waveform_data_array, library_type=_complextype.ComplexViInt16) # case B510 + waveform_data_array_ctype = _get_ctypes_pointer_for_buffer(value=waveform_data_array, library_type=_complextype.NIComplexI16) # case B510 error_code = self._library.niFake_WriteWaveformComplexI16(vi_ctype, number_of_samples_ctype, waveform_data_array_ctype) errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) return diff --git a/generated/nifake/nifake/unit_tests/_matchers.py b/generated/nifake/nifake/unit_tests/_matchers.py index 54c002d5ba..5371181e3d 100644 --- a/generated/nifake/nifake/unit_tests/_matchers.py +++ b/generated/nifake/nifake/unit_tests/_matchers.py @@ -272,9 +272,9 @@ def __init__(self): _PointerMatcher.__init__(self, _visatype.ViReal64) -class ComplexViReal64PointerMatcher(_PointerMatcher): +class NIComplexNumberPointerMatcher(_PointerMatcher): def __init__(self, expected_data, expected_size): - _PointerMatcher.__init__(self, _complextype.ComplexViReal64) + _PointerMatcher.__init__(self, _complextype.NIComplexNumber) self.expected_data = expected_data self.expected_size = expected_size @@ -289,12 +289,12 @@ def __eq__(self, other): return True def __repr__(self): - return f"ComplexViReal64PointerMatcher({self.expected_data})" + return f"NIComplexNumberPointerMatcher({self.expected_data})" -class ComplexViReal32PointerMatcher(_PointerMatcher): +class NIComplexNumberF32PointerMatcher(_PointerMatcher): def __init__(self, expected_data, expected_size): - _PointerMatcher.__init__(self, _complextype.ComplexViReal32) + _PointerMatcher.__init__(self, _complextype.NIComplexNumberF32) self.expected_data = expected_data self.expected_size = expected_size @@ -309,12 +309,12 @@ def __eq__(self, other): return True def __repr__(self): - return f"ComplexViReal32PointerMatcher({self.expected_data})" + return f"NIComplexNumberF32PointerMatcher({self.expected_data})" -class ComplexViInt16PointerMatcher(_PointerMatcher): +class NIComplexI16PointerMatcher(_PointerMatcher): def __init__(self, expected_data, expected_size): - _PointerMatcher.__init__(self, _complextype.ComplexViInt16) + _PointerMatcher.__init__(self, _complextype.NIComplexI16) self.expected_data = expected_data self.expected_size = expected_size @@ -329,7 +329,7 @@ def __eq__(self, other): return True def __repr__(self): - return f"ComplexViInt16PointerMatcher({self.expected_data})" + return f"NIComplexI16PointerMatcher({self.expected_data})" # Buffers diff --git a/generated/nifake/nifake/unit_tests/test_library_interpreter.py b/generated/nifake/nifake/unit_tests/test_library_interpreter.py index 4e0af2dc93..81ed73d159 100644 --- a/generated/nifake/nifake/unit_tests/test_library_interpreter.py +++ b/generated/nifake/nifake/unit_tests/test_library_interpreter.py @@ -843,29 +843,29 @@ def test_import_attribute_configuration_buffer_str(self): interpreter.import_attribute_configuration_buffer(configuration) self.patched_library.niFake_ImportAttributeConfigurationBuffer.assert_called_once_with(_matchers.ViSessionMatcher(SESSION_NUM_FOR_TEST), _matchers.ViInt32Matcher(len(configuration)), _matchers.ViInt8BufferMatcher(expected_list)) - def test_write_numpy_complex128_valid_input(self): + def test_write_waveform_numpy_complex128_valid_input(self): import ctypes import numpy as np - from nifake._complextype import ComplexViReal64 + from nifake._complextype import NIComplexNumber waveform_data = np.full(1000, 0.707 + 0.707j, dtype=np.complex128) number_of_samples = len(waveform_data) - waveform_data_ctypes = (ComplexViReal64 * number_of_samples)( - *[ComplexViReal64(real=0.707, imag=0.707) for _ in range(number_of_samples)] + waveform_data_ctypes = (NIComplexNumber * number_of_samples)( + *[NIComplexNumber(real=0.707, imag=0.707) for _ in range(number_of_samples)] ) - waveform_data_pointer = ctypes.cast(waveform_data_ctypes, ctypes.POINTER(ComplexViReal64)) + waveform_data_pointer = ctypes.cast(waveform_data_ctypes, ctypes.POINTER(NIComplexNumber)) self.patched_library.niFake_WriteWaveformComplexF64.side_effect = self.side_effects_helper.niFake_WriteWaveformComplexF64 interpreter = self.get_initialized_library_interpreter() interpreter.write_waveform_complex_f64(waveform_data) self.patched_library.niFake_WriteWaveformComplexF64.assert_called_once_with( _matchers.ViSessionMatcher(SESSION_NUM_FOR_TEST), _matchers.ViInt32Matcher(number_of_samples), - _matchers.ComplexViReal64PointerMatcher(waveform_data_pointer, number_of_samples) + _matchers.NIComplexNumberPointerMatcher(waveform_data_pointer, number_of_samples) ) - def test_write_waveform_complex_f64_invalid_input(self): + def test_write_waveform_numpy_complex64_invalid_input(self): import numpy as np invalid_waveform_data = np.full(1000, 0.707 + 0.707j, dtype=np.complex128) @@ -893,21 +893,21 @@ def test_write_interleaved_complexi16_valid_input(self): import ctypes import numpy as np - from nifake._complextype import ComplexViInt16 + from nifake._complextype import NIComplexI16 waveform_data = np.array([32767, 0] * 1000, dtype=np.int16) number_of_samples = len(waveform_data) // 2 - waveform_data_ctypes = (ComplexViInt16 * number_of_samples)( - *[ComplexViInt16(real=32767, imag=0) for _ in range(number_of_samples)] + waveform_data_ctypes = (NIComplexI16 * number_of_samples)( + *[NIComplexI16(real=32767, imag=0) for _ in range(number_of_samples)] ) - waveform_data_pointer = ctypes.cast(waveform_data_ctypes, ctypes.POINTER(ComplexViInt16)) + waveform_data_pointer = ctypes.cast(waveform_data_ctypes, ctypes.POINTER(NIComplexI16)) self.patched_library.niFake_WriteWaveformComplexI16.side_effect = self.side_effects_helper.niFake_WriteWaveformComplexI16 interpreter = self.get_initialized_library_interpreter() interpreter.write_waveform_complex_i16(waveform_data) self.patched_library.niFake_WriteWaveformComplexI16.assert_called_once_with( _matchers.ViSessionMatcher(SESSION_NUM_FOR_TEST), _matchers.ViInt32Matcher(number_of_samples), - _matchers.ComplexViInt16PointerMatcher(waveform_data_pointer, number_of_samples) + _matchers.NIComplexI16PointerMatcher(waveform_data_pointer, number_of_samples) ) def test_matcher_prints(self): diff --git a/src/nifake/metadata/functions.py b/src/nifake/metadata/functions.py index a244882ca8..60e58d8199 100644 --- a/src/nifake/metadata/functions.py +++ b/src/nifake/metadata/functions.py @@ -2845,7 +2845,7 @@ 'mechanism': 'len', 'value': 'numberOfSamples' }, - 'type': 'ComplexViReal32[]', + 'type': 'NIComplexNumberF32[]', 'use_in_python_api': True, 'use_numpy_array': True } @@ -2900,7 +2900,7 @@ 'mechanism': 'len', 'value': 'numberOfSamples' }, - 'type': 'ComplexViReal64[]', + 'type': 'NIComplexNumber[]', 'use_in_python_api': True, 'use_numpy_array': True } @@ -2955,7 +2955,7 @@ 'mechanism': 'len', 'value': 'numberOfSamples' }, - 'type': 'ComplexViInt16[]', + 'type': 'NIComplexI16[]', 'use_in_python_api': True, 'use_numpy_array': True } diff --git a/src/nifake/unit_tests/test_library_interpreter.py b/src/nifake/unit_tests/test_library_interpreter.py index 4e0af2dc93..81ed73d159 100644 --- a/src/nifake/unit_tests/test_library_interpreter.py +++ b/src/nifake/unit_tests/test_library_interpreter.py @@ -843,29 +843,29 @@ def test_import_attribute_configuration_buffer_str(self): interpreter.import_attribute_configuration_buffer(configuration) self.patched_library.niFake_ImportAttributeConfigurationBuffer.assert_called_once_with(_matchers.ViSessionMatcher(SESSION_NUM_FOR_TEST), _matchers.ViInt32Matcher(len(configuration)), _matchers.ViInt8BufferMatcher(expected_list)) - def test_write_numpy_complex128_valid_input(self): + def test_write_waveform_numpy_complex128_valid_input(self): import ctypes import numpy as np - from nifake._complextype import ComplexViReal64 + from nifake._complextype import NIComplexNumber waveform_data = np.full(1000, 0.707 + 0.707j, dtype=np.complex128) number_of_samples = len(waveform_data) - waveform_data_ctypes = (ComplexViReal64 * number_of_samples)( - *[ComplexViReal64(real=0.707, imag=0.707) for _ in range(number_of_samples)] + waveform_data_ctypes = (NIComplexNumber * number_of_samples)( + *[NIComplexNumber(real=0.707, imag=0.707) for _ in range(number_of_samples)] ) - waveform_data_pointer = ctypes.cast(waveform_data_ctypes, ctypes.POINTER(ComplexViReal64)) + waveform_data_pointer = ctypes.cast(waveform_data_ctypes, ctypes.POINTER(NIComplexNumber)) self.patched_library.niFake_WriteWaveformComplexF64.side_effect = self.side_effects_helper.niFake_WriteWaveformComplexF64 interpreter = self.get_initialized_library_interpreter() interpreter.write_waveform_complex_f64(waveform_data) self.patched_library.niFake_WriteWaveformComplexF64.assert_called_once_with( _matchers.ViSessionMatcher(SESSION_NUM_FOR_TEST), _matchers.ViInt32Matcher(number_of_samples), - _matchers.ComplexViReal64PointerMatcher(waveform_data_pointer, number_of_samples) + _matchers.NIComplexNumberPointerMatcher(waveform_data_pointer, number_of_samples) ) - def test_write_waveform_complex_f64_invalid_input(self): + def test_write_waveform_numpy_complex64_invalid_input(self): import numpy as np invalid_waveform_data = np.full(1000, 0.707 + 0.707j, dtype=np.complex128) @@ -893,21 +893,21 @@ def test_write_interleaved_complexi16_valid_input(self): import ctypes import numpy as np - from nifake._complextype import ComplexViInt16 + from nifake._complextype import NIComplexI16 waveform_data = np.array([32767, 0] * 1000, dtype=np.int16) number_of_samples = len(waveform_data) // 2 - waveform_data_ctypes = (ComplexViInt16 * number_of_samples)( - *[ComplexViInt16(real=32767, imag=0) for _ in range(number_of_samples)] + waveform_data_ctypes = (NIComplexI16 * number_of_samples)( + *[NIComplexI16(real=32767, imag=0) for _ in range(number_of_samples)] ) - waveform_data_pointer = ctypes.cast(waveform_data_ctypes, ctypes.POINTER(ComplexViInt16)) + waveform_data_pointer = ctypes.cast(waveform_data_ctypes, ctypes.POINTER(NIComplexI16)) self.patched_library.niFake_WriteWaveformComplexI16.side_effect = self.side_effects_helper.niFake_WriteWaveformComplexI16 interpreter = self.get_initialized_library_interpreter() interpreter.write_waveform_complex_i16(waveform_data) self.patched_library.niFake_WriteWaveformComplexI16.assert_called_once_with( _matchers.ViSessionMatcher(SESSION_NUM_FOR_TEST), _matchers.ViInt32Matcher(number_of_samples), - _matchers.ComplexViInt16PointerMatcher(waveform_data_pointer, number_of_samples) + _matchers.NIComplexI16PointerMatcher(waveform_data_pointer, number_of_samples) ) def test_matcher_prints(self): diff --git a/tox-travis.ini b/tox-travis.ini index 9c08695d4e..c7b847edd8 100644 --- a/tox-travis.ini +++ b/tox-travis.ini @@ -156,7 +156,6 @@ deps = installers: build flake8: hacking flake8: pep8-naming - docs: snowballstemmer == 2.2.0 # Hardcoding due to https://github.com/sphinx-doc/sphinx/issues/13533 docs: sphinx docs: sphinx-rtd-theme pkg: check-manifest diff --git a/tox.ini b/tox.ini index 6bfaca0c86..517c919d94 100644 --- a/tox.ini +++ b/tox.ini @@ -156,7 +156,6 @@ deps = installers: build flake8: hacking flake8: pep8-naming - docs: snowballstemmer == 2.2.0 # Hardcoding due to https://github.com/sphinx-doc/sphinx/issues/13533 docs: sphinx docs: sphinx-rtd-theme pkg: check-manifest From ebb27fa4f92e8db732bbc457ad2e95c41e0f1d29 Mon Sep 17 00:00:00 2001 From: Rahul R Date: Mon, 9 Jun 2025 16:42:42 +0530 Subject: [PATCH 20/33] Test case name change --- generated/nifake/nifake/unit_tests/test_library_interpreter.py | 2 +- src/nifake/unit_tests/test_library_interpreter.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/generated/nifake/nifake/unit_tests/test_library_interpreter.py b/generated/nifake/nifake/unit_tests/test_library_interpreter.py index 81ed73d159..1ef8149bfa 100644 --- a/generated/nifake/nifake/unit_tests/test_library_interpreter.py +++ b/generated/nifake/nifake/unit_tests/test_library_interpreter.py @@ -889,7 +889,7 @@ def test_write_interleaved_complexi16_invalid_input(self): interpreter.write_waveform_complex_i16(invalid_waveform_data) assert str(exc_info.value) == expected_error_message - def test_write_interleaved_complexi16_valid_input(self): + def test_write_waveform_complexi16_valid_input(self): import ctypes import numpy as np diff --git a/src/nifake/unit_tests/test_library_interpreter.py b/src/nifake/unit_tests/test_library_interpreter.py index 81ed73d159..1ef8149bfa 100644 --- a/src/nifake/unit_tests/test_library_interpreter.py +++ b/src/nifake/unit_tests/test_library_interpreter.py @@ -889,7 +889,7 @@ def test_write_interleaved_complexi16_invalid_input(self): interpreter.write_waveform_complex_i16(invalid_waveform_data) assert str(exc_info.value) == expected_error_message - def test_write_interleaved_complexi16_valid_input(self): + def test_write_waveform_complexi16_valid_input(self): import ctypes import numpy as np From 5394faf9b0a0702be0d1559f37bd69ef8ae8f272 Mon Sep 17 00:00:00 2001 From: Rahul R Date: Mon, 9 Jun 2025 18:36:06 +0530 Subject: [PATCH 21/33] Updating minor fixes --- build/templates/_library.py.mako | 4 ---- generated/nifake/nifake/_library.py | 1 - .../nifake/nifake/unit_tests/test_library_interpreter.py | 2 +- src/nifake/nifake.mak | 1 - src/nifake/unit_tests/test_library_interpreter.py | 2 +- 5 files changed, 2 insertions(+), 8 deletions(-) diff --git a/build/templates/_library.py.mako b/build/templates/_library.py.mako index d997e2ff8a..e77a7bb624 100644 --- a/build/templates/_library.py.mako +++ b/build/templates/_library.py.mako @@ -12,16 +12,12 @@ driver_name = config['driver_name'] functions = config['functions'] functions = helper.filter_library_functions(functions) -are_complex_parameters_used = helper.are_complex_parameters_used(functions) %>\ import ctypes import ${module_name}.errors as errors import threading -% if are_complex_parameters_used: -import ${module_name}._complextype as _complextype # noqa: F401 -% endif from ${module_name}._visatype import * # noqa: F403,H303 % for c in config['custom_types']: diff --git a/generated/nifake/nifake/_library.py b/generated/nifake/nifake/_library.py index 6b5aa2f595..a26204881c 100644 --- a/generated/nifake/nifake/_library.py +++ b/generated/nifake/nifake/_library.py @@ -5,7 +5,6 @@ import nifake.errors as errors import threading -import nifake._complextype as _complextype # noqa: F401 from nifake._visatype import * # noqa: F403,H303 import nifake.custom_struct as custom_struct # noqa: F401 diff --git a/generated/nifake/nifake/unit_tests/test_library_interpreter.py b/generated/nifake/nifake/unit_tests/test_library_interpreter.py index 1ef8149bfa..53cfe68f11 100644 --- a/generated/nifake/nifake/unit_tests/test_library_interpreter.py +++ b/generated/nifake/nifake/unit_tests/test_library_interpreter.py @@ -51,7 +51,7 @@ def niFake_read_warning(self, vi, maximum_time, reading): # noqa: N802 reading.contents.value = self.reading return self.error_code_return - def get_ctypes_pointer_for_buffer_side_effect(self, value, library_type=None, complex_type=None): + def get_ctypes_pointer_for_buffer_side_effect(self, value, library_type=None): ret_val = self.get_ctypes_pointer_for_buffer_side_effect_items[self.get_ctypes_pointer_for_buffer_side_effect_count] self.get_ctypes_pointer_for_buffer_side_effect_count += 1 return ret_val diff --git a/src/nifake/nifake.mak b/src/nifake/nifake.mak index 6e1a87dc04..85386b617a 100644 --- a/src/nifake/nifake.mak +++ b/src/nifake/nifake.mak @@ -14,7 +14,6 @@ CUSTOM_TYPES_TO_COPY += \ custom_struct.py \ custom_struct_typedef.py \ custom_struct_nested_typedef.py \ - _complextype.py \ include $(BUILD_HELPER_DIR)/rules.mak diff --git a/src/nifake/unit_tests/test_library_interpreter.py b/src/nifake/unit_tests/test_library_interpreter.py index 1ef8149bfa..53cfe68f11 100644 --- a/src/nifake/unit_tests/test_library_interpreter.py +++ b/src/nifake/unit_tests/test_library_interpreter.py @@ -51,7 +51,7 @@ def niFake_read_warning(self, vi, maximum_time, reading): # noqa: N802 reading.contents.value = self.reading return self.error_code_return - def get_ctypes_pointer_for_buffer_side_effect(self, value, library_type=None, complex_type=None): + def get_ctypes_pointer_for_buffer_side_effect(self, value, library_type=None): ret_val = self.get_ctypes_pointer_for_buffer_side_effect_items[self.get_ctypes_pointer_for_buffer_side_effect_count] self.get_ctypes_pointer_for_buffer_side_effect_count += 1 return ret_val From 59f87fcfd13db1aec1b654110182d93508a558d2 Mon Sep 17 00:00:00 2001 From: Rahul R Date: Mon, 9 Jun 2025 20:10:38 +0530 Subject: [PATCH 22/33] Updating the test cases --- .../unit_tests/test_library_interpreter.py | 24 ------------------- .../nifake/nifake/unit_tests/test_session.py | 20 ++++++++++++++++ .../unit_tests/test_library_interpreter.py | 24 ------------------- src/nifake/unit_tests/test_session.py | 20 ++++++++++++++++ 4 files changed, 40 insertions(+), 48 deletions(-) diff --git a/generated/nifake/nifake/unit_tests/test_library_interpreter.py b/generated/nifake/nifake/unit_tests/test_library_interpreter.py index 53cfe68f11..0046db31a9 100644 --- a/generated/nifake/nifake/unit_tests/test_library_interpreter.py +++ b/generated/nifake/nifake/unit_tests/test_library_interpreter.py @@ -865,30 +865,6 @@ def test_write_waveform_numpy_complex128_valid_input(self): _matchers.NIComplexNumberPointerMatcher(waveform_data_pointer, number_of_samples) ) - def test_write_waveform_numpy_complex64_invalid_input(self): - import numpy as np - - invalid_waveform_data = np.full(1000, 0.707 + 0.707j, dtype=np.complex128) - expected_error_message = "Invalid waveform data provided. Expected a non-empty array of complex64." - interpreter = self.get_initialized_library_interpreter() - self.patched_library.niFake_WriteWaveformComplexF32.side_effect = ValueError("Invalid waveform data provided. Expected a non-empty array of complex64.") - with pytest.raises(ValueError) as exc_info: - interpreter.write_waveform_complex_f32(invalid_waveform_data) - - assert str(exc_info.value) == expected_error_message - - def test_write_interleaved_complexi16_invalid_input(self): - import numpy as np - - invalid_waveform_data = np.array([], dtype=np.complex64) - expected_error_message = "Invalid waveform data provided. Expected a non-empty array of Int16." - - interpreter = self.get_initialized_library_interpreter() - self.patched_library.niFake_WriteWaveformComplexI16.side_effect = ValueError("Invalid waveform data provided. Expected a non-empty array of Int16.") - with pytest.raises(ValueError) as exc_info: - interpreter.write_waveform_complex_i16(invalid_waveform_data) - assert str(exc_info.value) == expected_error_message - def test_write_waveform_complexi16_valid_input(self): import ctypes import numpy as np diff --git a/generated/nifake/nifake/unit_tests/test_session.py b/generated/nifake/nifake/unit_tests/test_session.py index 7f243dcf8a..414a1070cf 100644 --- a/generated/nifake/nifake/unit_tests/test_session.py +++ b/generated/nifake/nifake/unit_tests/test_session.py @@ -926,6 +926,26 @@ def test_export_attribute_configuration_buffer(self): assert actual_configuration == bytes(expected_buffer) self.patched_grpc_interpreter.export_attribute_configuration_buffer.assert_called_once_with() + def test_session_write_waveform_complex_f32_invalid_dtype(self): + import numpy as np + invalid_waveform_data = np.full(10, 1.0 + 1.0j, dtype=np.complex128) + expected_error_message = "waveform_data_array must be numpy.ndarray of dtype=complex64, is complex128" + import pytest + with nifake.Session('dev1', grpc_options=nifake.GrpcSessionOptions(object(), '')) as session: + with pytest.raises(TypeError) as exc_info: + session.write_waveform_complex_f32(invalid_waveform_data) + assert str(exc_info.value) == expected_error_message + + def test_session_write_waveform_complex_i16_invalid_dtype(self): + import numpy as np + invalid_waveform_data = np.full(10, 1.0 + 1.0j, dtype=np.complex64) + expected_error_message = "waveform_data_array must be numpy.ndarray of dtype=int16, is complex64" + import pytest + with nifake.Session('dev1', grpc_options=nifake.GrpcSessionOptions(object(), '')) as session: + with pytest.raises(TypeError) as exc_info: + session.write_waveform_complex_i16(invalid_waveform_data) + assert str(exc_info.value) == expected_error_message + # Attributes def test_get_attribute_int32(self): diff --git a/src/nifake/unit_tests/test_library_interpreter.py b/src/nifake/unit_tests/test_library_interpreter.py index 53cfe68f11..0046db31a9 100644 --- a/src/nifake/unit_tests/test_library_interpreter.py +++ b/src/nifake/unit_tests/test_library_interpreter.py @@ -865,30 +865,6 @@ def test_write_waveform_numpy_complex128_valid_input(self): _matchers.NIComplexNumberPointerMatcher(waveform_data_pointer, number_of_samples) ) - def test_write_waveform_numpy_complex64_invalid_input(self): - import numpy as np - - invalid_waveform_data = np.full(1000, 0.707 + 0.707j, dtype=np.complex128) - expected_error_message = "Invalid waveform data provided. Expected a non-empty array of complex64." - interpreter = self.get_initialized_library_interpreter() - self.patched_library.niFake_WriteWaveformComplexF32.side_effect = ValueError("Invalid waveform data provided. Expected a non-empty array of complex64.") - with pytest.raises(ValueError) as exc_info: - interpreter.write_waveform_complex_f32(invalid_waveform_data) - - assert str(exc_info.value) == expected_error_message - - def test_write_interleaved_complexi16_invalid_input(self): - import numpy as np - - invalid_waveform_data = np.array([], dtype=np.complex64) - expected_error_message = "Invalid waveform data provided. Expected a non-empty array of Int16." - - interpreter = self.get_initialized_library_interpreter() - self.patched_library.niFake_WriteWaveformComplexI16.side_effect = ValueError("Invalid waveform data provided. Expected a non-empty array of Int16.") - with pytest.raises(ValueError) as exc_info: - interpreter.write_waveform_complex_i16(invalid_waveform_data) - assert str(exc_info.value) == expected_error_message - def test_write_waveform_complexi16_valid_input(self): import ctypes import numpy as np diff --git a/src/nifake/unit_tests/test_session.py b/src/nifake/unit_tests/test_session.py index 7f243dcf8a..414a1070cf 100644 --- a/src/nifake/unit_tests/test_session.py +++ b/src/nifake/unit_tests/test_session.py @@ -926,6 +926,26 @@ def test_export_attribute_configuration_buffer(self): assert actual_configuration == bytes(expected_buffer) self.patched_grpc_interpreter.export_attribute_configuration_buffer.assert_called_once_with() + def test_session_write_waveform_complex_f32_invalid_dtype(self): + import numpy as np + invalid_waveform_data = np.full(10, 1.0 + 1.0j, dtype=np.complex128) + expected_error_message = "waveform_data_array must be numpy.ndarray of dtype=complex64, is complex128" + import pytest + with nifake.Session('dev1', grpc_options=nifake.GrpcSessionOptions(object(), '')) as session: + with pytest.raises(TypeError) as exc_info: + session.write_waveform_complex_f32(invalid_waveform_data) + assert str(exc_info.value) == expected_error_message + + def test_session_write_waveform_complex_i16_invalid_dtype(self): + import numpy as np + invalid_waveform_data = np.full(10, 1.0 + 1.0j, dtype=np.complex64) + expected_error_message = "waveform_data_array must be numpy.ndarray of dtype=int16, is complex64" + import pytest + with nifake.Session('dev1', grpc_options=nifake.GrpcSessionOptions(object(), '')) as session: + with pytest.raises(TypeError) as exc_info: + session.write_waveform_complex_i16(invalid_waveform_data) + assert str(exc_info.value) == expected_error_message + # Attributes def test_get_attribute_int32(self): From d77892daef66eb72d2e0c6350e8fbf6b9563b880 Mon Sep 17 00:00:00 2001 From: Rahul R Date: Mon, 9 Jun 2025 21:36:13 +0530 Subject: [PATCH 23/33] Update i16 functions --- .../nifake/nifake/_grpc_stub_interpreter.py | 2 +- generated/nifake/nifake/_library.py | 14 +++++++------- generated/nifake/nifake/_library_interpreter.py | 4 ++-- generated/nifake/nifake/session.py | 6 +++--- .../nifake/nifake/unit_tests/_mock_helper.py | 16 ++++++++-------- .../unit_tests/test_library_interpreter.py | 6 +++--- .../nifake/nifake/unit_tests/test_session.py | 2 +- src/nifake/metadata/functions.py | 2 +- .../unit_tests/test_library_interpreter.py | 6 +++--- src/nifake/unit_tests/test_session.py | 2 +- 10 files changed, 30 insertions(+), 30 deletions(-) diff --git a/generated/nifake/nifake/_grpc_stub_interpreter.py b/generated/nifake/nifake/_grpc_stub_interpreter.py index 58728ea0ee..dcefa0ef95 100644 --- a/generated/nifake/nifake/_grpc_stub_interpreter.py +++ b/generated/nifake/nifake/_grpc_stub_interpreter.py @@ -495,7 +495,7 @@ def write_waveform_complex_f32(self, waveform_data_array): # noqa: N802 def write_waveform_complex_f64(self, waveform_data_array): # noqa: N802 raise NotImplementedError('numpy-specific methods are not supported over gRPC') - def write_waveform_complex_i16(self, waveform_data_array): # noqa: N802 + def write_waveform_numpy_complex_i16(self, waveform_data_array): # noqa: N802 raise NotImplementedError('numpy-specific methods are not supported over gRPC') def close(self): # noqa: N802 diff --git a/generated/nifake/nifake/_library.py b/generated/nifake/nifake/_library.py index a26204881c..4dabf53b87 100644 --- a/generated/nifake/nifake/_library.py +++ b/generated/nifake/nifake/_library.py @@ -94,7 +94,7 @@ def __init__(self, ctypes_library): self.niFake_WriteWaveform_cfunc = None self.niFake_WriteWaveformComplexF32_cfunc = None self.niFake_WriteWaveformComplexF64_cfunc = None - self.niFake_WriteWaveformComplexI16_cfunc = None + self.niFake_WriteWaveformNumpyComplexI16_cfunc = None self.niFake_close_cfunc = None self.niFake_error_message_cfunc = None self.niFake_self_test_cfunc = None @@ -658,13 +658,13 @@ def niFake_WriteWaveformComplexF64(self, vi, number_of_samples, waveform_data_ar self.niFake_WriteWaveformComplexF64_cfunc.restype = ViStatus # noqa: F405 return self.niFake_WriteWaveformComplexF64_cfunc(vi, number_of_samples, waveform_data_array) - def niFake_WriteWaveformComplexI16(self, vi, number_of_samples, waveform_data_array): # noqa: N802 + def niFake_WriteWaveformNumpyComplexI16(self, vi, number_of_samples, waveform_data_array): # noqa: N802 with self._func_lock: - if self.niFake_WriteWaveformComplexI16_cfunc is None: - self.niFake_WriteWaveformComplexI16_cfunc = self._get_library_function('niFake_WriteWaveformComplexI16') - self.niFake_WriteWaveformComplexI16_cfunc.argtypes = [ViSession, ViInt32, ctypes.POINTER(NIComplexI16)] # noqa: F405 - self.niFake_WriteWaveformComplexI16_cfunc.restype = ViStatus # noqa: F405 - return self.niFake_WriteWaveformComplexI16_cfunc(vi, number_of_samples, waveform_data_array) + if self.niFake_WriteWaveformNumpyComplexI16_cfunc is None: + self.niFake_WriteWaveformNumpyComplexI16_cfunc = self._get_library_function('niFake_WriteWaveformNumpyComplexI16') + self.niFake_WriteWaveformNumpyComplexI16_cfunc.argtypes = [ViSession, ViInt32, ctypes.POINTER(NIComplexI16)] # noqa: F405 + self.niFake_WriteWaveformNumpyComplexI16_cfunc.restype = ViStatus # noqa: F405 + return self.niFake_WriteWaveformNumpyComplexI16_cfunc(vi, number_of_samples, waveform_data_array) def niFake_close(self, vi): # noqa: N802 with self._func_lock: diff --git a/generated/nifake/nifake/_library_interpreter.py b/generated/nifake/nifake/_library_interpreter.py index 798ba9bf4a..b769500a52 100644 --- a/generated/nifake/nifake/_library_interpreter.py +++ b/generated/nifake/nifake/_library_interpreter.py @@ -754,11 +754,11 @@ def write_waveform_complex_f64(self, waveform_data_array): # noqa: N802 errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) return - def write_waveform_complex_i16(self, waveform_data_array): # noqa: N802 + def write_waveform_numpy_complex_i16(self, waveform_data_array): # noqa: N802 vi_ctype = _visatype.ViSession(self._vi) # case S110 number_of_samples_ctype = _visatype.ViInt32(0 if waveform_data_array is None else len(waveform_data_array) // 2) # case S160 waveform_data_array_ctype = _get_ctypes_pointer_for_buffer(value=waveform_data_array, library_type=_complextype.NIComplexI16) # case B510 - error_code = self._library.niFake_WriteWaveformComplexI16(vi_ctype, number_of_samples_ctype, waveform_data_array_ctype) + error_code = self._library.niFake_WriteWaveformNumpyComplexI16(vi_ctype, number_of_samples_ctype, waveform_data_array_ctype) errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) return diff --git a/generated/nifake/nifake/session.py b/generated/nifake/nifake/session.py index 3f5a682c2d..ca78b7f29d 100644 --- a/generated/nifake/nifake/session.py +++ b/generated/nifake/nifake/session.py @@ -1711,8 +1711,8 @@ def write_waveform_complex_f64(self, waveform_data_array): self._interpreter.write_waveform_complex_f64(waveform_data_array) @ivi_synchronized - def write_waveform_complex_i16(self, waveform_data_array): - r'''write_waveform_complex_i16 + def write_waveform_numpy_complex_i16(self, waveform_data_array): + r'''write_waveform_numpy_complex_i16 A method that writes a waveform of i16 numbers. @@ -1728,7 +1728,7 @@ def write_waveform_complex_i16(self, waveform_data_array): raise TypeError('waveform_data_array must be in C-order') if waveform_data_array.dtype is not numpy.dtype('int16'): raise TypeError('waveform_data_array must be numpy.ndarray of dtype=int16, is ' + str(waveform_data_array.dtype)) - self._interpreter.write_waveform_complex_i16(waveform_data_array) + self._interpreter.write_waveform_numpy_complex_i16(waveform_data_array) def _close(self): r'''_close diff --git a/generated/nifake/nifake/unit_tests/_mock_helper.py b/generated/nifake/nifake/unit_tests/_mock_helper.py index 21dc9cd715..2208ccd410 100644 --- a/generated/nifake/nifake/unit_tests/_mock_helper.py +++ b/generated/nifake/nifake/unit_tests/_mock_helper.py @@ -214,8 +214,8 @@ def __init__(self): self._defaults['WriteWaveformComplexF32']['return'] = 0 self._defaults['WriteWaveformComplexF64'] = {} self._defaults['WriteWaveformComplexF64']['return'] = 0 - self._defaults['WriteWaveformComplexI16'] = {} - self._defaults['WriteWaveformComplexI16']['return'] = 0 + self._defaults['WriteWaveformNumpyComplexI16'] = {} + self._defaults['WriteWaveformNumpyComplexI16']['return'] = 0 self._defaults['close'] = {} self._defaults['close']['return'] = 0 self._defaults['error_message'] = {} @@ -971,10 +971,10 @@ def niFake_WriteWaveformComplexF64(self, vi, number_of_samples, waveform_data_ar return self._defaults['WriteWaveformComplexF64']['return'] return self._defaults['WriteWaveformComplexF64']['return'] - def niFake_WriteWaveformComplexI16(self, vi, number_of_samples, waveform_data_array): # noqa: N802 - if self._defaults['WriteWaveformComplexI16']['return'] != 0: - return self._defaults['WriteWaveformComplexI16']['return'] - return self._defaults['WriteWaveformComplexI16']['return'] + def niFake_WriteWaveformNumpyComplexI16(self, vi, number_of_samples, waveform_data_array): # noqa: N802 + if self._defaults['WriteWaveformNumpyComplexI16']['return'] != 0: + return self._defaults['WriteWaveformNumpyComplexI16']['return'] + return self._defaults['WriteWaveformNumpyComplexI16']['return'] def niFake_close(self, vi): # noqa: N802 if self._defaults['close']['return'] != 0: @@ -1154,8 +1154,8 @@ def set_side_effects_and_return_values(self, mock_library): mock_library.niFake_WriteWaveformComplexF32.return_value = 0 mock_library.niFake_WriteWaveformComplexF64.side_effect = MockFunctionCallError("niFake_WriteWaveformComplexF64") mock_library.niFake_WriteWaveformComplexF64.return_value = 0 - mock_library.niFake_WriteWaveformComplexI16.side_effect = MockFunctionCallError("niFake_WriteWaveformComplexI16") - mock_library.niFake_WriteWaveformComplexI16.return_value = 0 + mock_library.niFake_WriteWaveformNumpyComplexI16.side_effect = MockFunctionCallError("niFake_WriteWaveformNumpyComplexI16") + mock_library.niFake_WriteWaveformNumpyComplexI16.return_value = 0 mock_library.niFake_close.side_effect = MockFunctionCallError("niFake_close") mock_library.niFake_close.return_value = 0 mock_library.niFake_error_message.side_effect = MockFunctionCallError("niFake_error_message") diff --git a/generated/nifake/nifake/unit_tests/test_library_interpreter.py b/generated/nifake/nifake/unit_tests/test_library_interpreter.py index 0046db31a9..be4d5be784 100644 --- a/generated/nifake/nifake/unit_tests/test_library_interpreter.py +++ b/generated/nifake/nifake/unit_tests/test_library_interpreter.py @@ -877,10 +877,10 @@ def test_write_waveform_complexi16_valid_input(self): *[NIComplexI16(real=32767, imag=0) for _ in range(number_of_samples)] ) waveform_data_pointer = ctypes.cast(waveform_data_ctypes, ctypes.POINTER(NIComplexI16)) - self.patched_library.niFake_WriteWaveformComplexI16.side_effect = self.side_effects_helper.niFake_WriteWaveformComplexI16 + self.patched_library.niFake_WriteWaveformNumpyComplexI16.side_effect = self.side_effects_helper.niFake_WriteWaveformNumpyComplexI16 interpreter = self.get_initialized_library_interpreter() - interpreter.write_waveform_complex_i16(waveform_data) - self.patched_library.niFake_WriteWaveformComplexI16.assert_called_once_with( + interpreter.write_waveform_numpy_complex_i16(waveform_data) + self.patched_library.niFake_WriteWaveformNumpyComplexI16.assert_called_once_with( _matchers.ViSessionMatcher(SESSION_NUM_FOR_TEST), _matchers.ViInt32Matcher(number_of_samples), _matchers.NIComplexI16PointerMatcher(waveform_data_pointer, number_of_samples) diff --git a/generated/nifake/nifake/unit_tests/test_session.py b/generated/nifake/nifake/unit_tests/test_session.py index 414a1070cf..b86a371ae1 100644 --- a/generated/nifake/nifake/unit_tests/test_session.py +++ b/generated/nifake/nifake/unit_tests/test_session.py @@ -943,7 +943,7 @@ def test_session_write_waveform_complex_i16_invalid_dtype(self): import pytest with nifake.Session('dev1', grpc_options=nifake.GrpcSessionOptions(object(), '')) as session: with pytest.raises(TypeError) as exc_info: - session.write_waveform_complex_i16(invalid_waveform_data) + session.write_waveform_numpy_complex_i16(invalid_waveform_data) assert str(exc_info.value) == expected_error_message # Attributes diff --git a/src/nifake/metadata/functions.py b/src/nifake/metadata/functions.py index 60e58d8199..c275e4aebc 100644 --- a/src/nifake/metadata/functions.py +++ b/src/nifake/metadata/functions.py @@ -2907,7 +2907,7 @@ ], 'returns': 'ViStatus' }, - 'WriteWaveformComplexI16': { + 'WriteWaveformNumpyComplexI16': { 'codegen_method': 'public', 'documentation': { 'description': 'A function that writes a waveform of i16 numbers.' diff --git a/src/nifake/unit_tests/test_library_interpreter.py b/src/nifake/unit_tests/test_library_interpreter.py index 0046db31a9..be4d5be784 100644 --- a/src/nifake/unit_tests/test_library_interpreter.py +++ b/src/nifake/unit_tests/test_library_interpreter.py @@ -877,10 +877,10 @@ def test_write_waveform_complexi16_valid_input(self): *[NIComplexI16(real=32767, imag=0) for _ in range(number_of_samples)] ) waveform_data_pointer = ctypes.cast(waveform_data_ctypes, ctypes.POINTER(NIComplexI16)) - self.patched_library.niFake_WriteWaveformComplexI16.side_effect = self.side_effects_helper.niFake_WriteWaveformComplexI16 + self.patched_library.niFake_WriteWaveformNumpyComplexI16.side_effect = self.side_effects_helper.niFake_WriteWaveformNumpyComplexI16 interpreter = self.get_initialized_library_interpreter() - interpreter.write_waveform_complex_i16(waveform_data) - self.patched_library.niFake_WriteWaveformComplexI16.assert_called_once_with( + interpreter.write_waveform_numpy_complex_i16(waveform_data) + self.patched_library.niFake_WriteWaveformNumpyComplexI16.assert_called_once_with( _matchers.ViSessionMatcher(SESSION_NUM_FOR_TEST), _matchers.ViInt32Matcher(number_of_samples), _matchers.NIComplexI16PointerMatcher(waveform_data_pointer, number_of_samples) diff --git a/src/nifake/unit_tests/test_session.py b/src/nifake/unit_tests/test_session.py index 414a1070cf..b86a371ae1 100644 --- a/src/nifake/unit_tests/test_session.py +++ b/src/nifake/unit_tests/test_session.py @@ -943,7 +943,7 @@ def test_session_write_waveform_complex_i16_invalid_dtype(self): import pytest with nifake.Session('dev1', grpc_options=nifake.GrpcSessionOptions(object(), '')) as session: with pytest.raises(TypeError) as exc_info: - session.write_waveform_complex_i16(invalid_waveform_data) + session.write_waveform_numpy_complex_i16(invalid_waveform_data) assert str(exc_info.value) == expected_error_message # Attributes From 27db04c0b96dda8103ed762a1cccf1c603f95f79 Mon Sep 17 00:00:00 2001 From: Rahul R Date: Tue, 10 Jun 2025 05:17:47 +0530 Subject: [PATCH 24/33] Update duplicate entries --- build/helper/metadata_filters.py | 1 - build/templates/_library_interpreter.py.mako | 2 +- generated/nifake/nifake/_library_interpreter.py | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/build/helper/metadata_filters.py b/build/helper/metadata_filters.py index a8bb7a24d6..65669e4f28 100644 --- a/build/helper/metadata_filters.py +++ b/build/helper/metadata_filters.py @@ -320,7 +320,6 @@ 'mechanism': 'any', 'python_api_list': True, 'skip_all_except_complex_type_parameters': True, - 'skip_all_except_complex_type_parameters': True, }, } diff --git a/build/templates/_library_interpreter.py.mako b/build/templates/_library_interpreter.py.mako index 8407b7ea3f..24e5e12a42 100644 --- a/build/templates/_library_interpreter.py.mako +++ b/build/templates/_library_interpreter.py.mako @@ -23,7 +23,7 @@ import platform % endif % if are_complex_parameters_used: -import ${module_name}._complextype as _complextype # noqa: F401 +import ${module_name}._complextype as _complextype % endif import ${module_name}._library_singleton as _library_singleton import ${module_name}._visatype as _visatype diff --git a/generated/nifake/nifake/_library_interpreter.py b/generated/nifake/nifake/_library_interpreter.py index b769500a52..7927682f34 100644 --- a/generated/nifake/nifake/_library_interpreter.py +++ b/generated/nifake/nifake/_library_interpreter.py @@ -6,7 +6,7 @@ import hightime # noqa: F401 import platform -import nifake._complextype as _complextype # noqa: F401 +import nifake._complextype as _complextype import nifake._library_singleton as _library_singleton import nifake._visatype as _visatype import nifake.enums as enums # noqa: F401 From 53232bf6f155f74a563aa30f882dd85d3ba40074 Mon Sep 17 00:00:00 2001 From: Rahul R Date: Tue, 10 Jun 2025 05:30:08 +0530 Subject: [PATCH 25/33] remove zone.identifier file changes. --- src/nifake/custom_types/_complextype.py:Zone.Identifier | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 src/nifake/custom_types/_complextype.py:Zone.Identifier diff --git a/src/nifake/custom_types/_complextype.py:Zone.Identifier b/src/nifake/custom_types/_complextype.py:Zone.Identifier deleted file mode 100644 index e69de29bb2..0000000000 From 8071d7dabb93bf3c63cf3cf63667b8560cf2fdbb Mon Sep 17 00:00:00 2001 From: Rahul R Date: Tue, 10 Jun 2025 11:05:23 +0530 Subject: [PATCH 26/33] Updaed comments for are_complex_parameters_used --- build/helper/metadata_filters.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/helper/metadata_filters.py b/build/helper/metadata_filters.py index 65669e4f28..d391dd64cb 100644 --- a/build/helper/metadata_filters.py +++ b/build/helper/metadata_filters.py @@ -489,7 +489,7 @@ def filter_codegen_enums(enums): def are_complex_parameters_used(functions): - '''Returns function metadata only for those functions to included the library layer (library.py and mock_helper.py)''' + '''Returns bool based on whether any complex parameters are used in the functions metadata.''' are_complex_parameters_used = False complex_parameters = [] for k, v in functions.items(): From e883c469416027111f555be287f1d46dfcae37d7 Mon Sep 17 00:00:00 2001 From: Rahul R Date: Tue, 10 Jun 2025 12:03:32 +0530 Subject: [PATCH 27/33] Updated the numpy api names and description. --- generated/nifake/nifake/session.py | 6 +++--- .../nifake/nifake/unit_tests/test_library_interpreter.py | 2 +- src/nifake/metadata/functions.py | 6 +++--- src/nifake/unit_tests/test_library_interpreter.py | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/generated/nifake/nifake/session.py b/generated/nifake/nifake/session.py index ca78b7f29d..93393e031f 100644 --- a/generated/nifake/nifake/session.py +++ b/generated/nifake/nifake/session.py @@ -1674,7 +1674,7 @@ def write_waveform_numpy(self, waveform): def write_waveform_complex_f32(self, waveform_data_array): r'''write_waveform_complex_f32 - A method that writes a waveform of complex64 numbers. + A method that writes a waveform of numpy complex64 numbers. Args: waveform_data_array (numpy.array(dtype=numpy.complex64)): Specifies the array of data to load into the waveform. Array should be numberOfSamples big. @@ -1694,7 +1694,7 @@ def write_waveform_complex_f32(self, waveform_data_array): def write_waveform_complex_f64(self, waveform_data_array): r'''write_waveform_complex_f64 - A method that writes a waveform of complex128 numbers + A method that writes a waveform of numpy complex128 numbers Args: waveform_data_array (numpy.array(dtype=numpy.complex128)): Specifies the array of data to load into the waveform. Array should be numberOfSamples big. @@ -1714,7 +1714,7 @@ def write_waveform_complex_f64(self, waveform_data_array): def write_waveform_numpy_complex_i16(self, waveform_data_array): r'''write_waveform_numpy_complex_i16 - A method that writes a waveform of i16 numbers. + A method that writes a waveform of numpy complex i16 numbers. Args: waveform_data_array (numpy.array(dtype=numpy.int16)): Specifies the array of data to load into the waveform. Array should be numberOfSamples big. diff --git a/generated/nifake/nifake/unit_tests/test_library_interpreter.py b/generated/nifake/nifake/unit_tests/test_library_interpreter.py index be4d5be784..3890bf1800 100644 --- a/generated/nifake/nifake/unit_tests/test_library_interpreter.py +++ b/generated/nifake/nifake/unit_tests/test_library_interpreter.py @@ -865,7 +865,7 @@ def test_write_waveform_numpy_complex128_valid_input(self): _matchers.NIComplexNumberPointerMatcher(waveform_data_pointer, number_of_samples) ) - def test_write_waveform_complexi16_valid_input(self): + def test_write_waveform_numpy_complexi16_valid_input(self): import ctypes import numpy as np diff --git a/src/nifake/metadata/functions.py b/src/nifake/metadata/functions.py index c275e4aebc..18f94d156f 100644 --- a/src/nifake/metadata/functions.py +++ b/src/nifake/metadata/functions.py @@ -2800,7 +2800,7 @@ 'WriteWaveformComplexF32': { 'codegen_method': 'public', 'documentation': { - 'description': 'A function that writes a waveform of complex64 numbers.' + 'description': 'A function that writes a waveform of numpy complex64 numbers.' }, 'included_in_proto': False, 'is_error_handling': False, @@ -2855,7 +2855,7 @@ 'WriteWaveformComplexF64': { 'codegen_method': 'public', 'documentation': { - 'description': 'A function that writes a waveform of complex128 numbers' + 'description': 'A function that writes a waveform of numpy complex128 numbers' }, 'included_in_proto': False, 'is_error_handling': False, @@ -2910,7 +2910,7 @@ 'WriteWaveformNumpyComplexI16': { 'codegen_method': 'public', 'documentation': { - 'description': 'A function that writes a waveform of i16 numbers.' + 'description': 'A function that writes a waveform of numpy complex i16 numbers.' }, 'included_in_proto': False, 'is_error_handling': False, diff --git a/src/nifake/unit_tests/test_library_interpreter.py b/src/nifake/unit_tests/test_library_interpreter.py index be4d5be784..3890bf1800 100644 --- a/src/nifake/unit_tests/test_library_interpreter.py +++ b/src/nifake/unit_tests/test_library_interpreter.py @@ -865,7 +865,7 @@ def test_write_waveform_numpy_complex128_valid_input(self): _matchers.NIComplexNumberPointerMatcher(waveform_data_pointer, number_of_samples) ) - def test_write_waveform_complexi16_valid_input(self): + def test_write_waveform_numpy_complexi16_valid_input(self): import ctypes import numpy as np From f2fc8247ca76bcc7e7b7e5fe454c2925ea3b2ffc Mon Sep 17 00:00:00 2001 From: Rahul R Date: Tue, 10 Jun 2025 14:54:50 +0530 Subject: [PATCH 28/33] Updating default value of complext type as None rather than 'none' --- build/helper/codegen_helper.py | 6 +- build/helper/metadata_add_all.py | 2 +- build/helper/metadata_filters.py | 2 +- build/unit_tests/test_codegen_helper.py | 74 +++++++++++------------ build/unit_tests/test_metadata_add_all.py | 28 ++++----- 5 files changed, 56 insertions(+), 56 deletions(-) diff --git a/build/helper/codegen_helper.py b/build/helper/codegen_helper.py index a4ed2ebb23..86b83c476a 100644 --- a/build/helper/codegen_helper.py +++ b/build/helper/codegen_helper.py @@ -257,7 +257,7 @@ def get_ctype_variable_declaration_snippet(parameter, parameters, ivi_dance_step module_name = '_visatype' # Use _complextype.py file for complex parameter - if parameter['complex_type'] != 'none': + if parameter['complex_type'] is not None: module_name = '_complextype' if parameter['is_string'] is True: @@ -368,7 +368,7 @@ def _get_ctype_variable_definition_snippet_for_scalar(parameter, parameters, ivi # Parameter denotes the size of another (the "corresponding") parameter. # Interleaved array length is going to be double the length of number of samples. # This is used for complex waveforms, where the real and imaginary parts are interleaved in the array. - if 'interleaved' in corresponding_buffer_parameters[0]['complex_type']: + if corresponding_buffer_parameters[0]['complex_type'] == 'interleaved': definitions.append(parameter['ctypes_variable_name'] + ' = {0}.{1}(0 if {2} is None else len({2}) // 2) # case S160'.format(module_name, parameter['ctypes_type'], corresponding_buffer_parameters[0]['python_name'])) else: definitions.append(parameter['ctypes_variable_name'] + ' = {0}.{1}(0 if {2} is None else len({2})) # case S160'.format(module_name, parameter['ctypes_type'], corresponding_buffer_parameters[0]['python_name'])) @@ -435,7 +435,7 @@ def _get_ctype_variable_definition_snippet_for_buffers(parameter, parameters, iv definition = None if parameter['numpy'] is True and use_numpy_array is True: - if parameter['complex_type'] == 'none': + if parameter['complex_type'] is None: definition = '_get_ctypes_pointer_for_buffer(value={}) # case B510'.format(parameter['python_name']) else: definition = '_get_ctypes_pointer_for_buffer(value={}, library_type={}.{}) # case B510'.format(parameter['python_name'], module_name, parameter['ctypes_type']) diff --git a/build/helper/metadata_add_all.py b/build/helper/metadata_add_all.py index 929aafa912..a9e2f0a0d0 100644 --- a/build/helper/metadata_add_all.py +++ b/build/helper/metadata_add_all.py @@ -129,7 +129,7 @@ def _add_ctypes_type(parameter, config): def _add_complex_type(parameter): '''Adds a complex_type parameter to the metadata for complex numbers''' if 'complex_type' not in parameter: - parameter['complex_type'] = 'none' + parameter['complex_type'] = None def _add_numpy_info(parameter, parameters, config): diff --git a/build/helper/metadata_filters.py b/build/helper/metadata_filters.py index d391dd64cb..9c1f6ee6a6 100644 --- a/build/helper/metadata_filters.py +++ b/build/helper/metadata_filters.py @@ -384,7 +384,7 @@ def filter_parameters(parameters, parameter_usage_options): skip = False if not options_to_use['python_api_list'] and not x['use_in_python_api']: skip = True - if options_to_use['skip_all_except_complex_type_parameters'] and x['complex_type'] == 'none': + if options_to_use['skip_all_except_complex_type_parameters'] and x['complex_type'] is None: skip = True if not skip: parameters_to_use.append(x) diff --git a/build/unit_tests/test_codegen_helper.py b/build/unit_tests/test_codegen_helper.py index 0079606079..fb38c03683 100644 --- a/build/unit_tests/test_codegen_helper.py +++ b/build/unit_tests/test_codegen_helper.py @@ -41,7 +41,7 @@ 'size': {'mechanism': 'fixed', 'value': 1}, 'type': 'ViSession', 'numpy': False, - 'complex_type': 'none', + 'complex_type': None, 'use_in_python_api': True, }, { # 1 @@ -70,7 +70,7 @@ 'size': {'mechanism': 'fixed', 'value': 1}, 'type': 'ViInt64', 'numpy': False, - 'complex_type': 'none', + 'complex_type': None, 'use_in_python_api': True, }, { # 2 @@ -98,7 +98,7 @@ 'size': {'mechanism': 'fixed', 'value': 256}, 'type': 'ViString', 'numpy': False, - 'complex_type': 'none', + 'complex_type': None, 'use_in_python_api': True, }, { # 3 @@ -127,7 +127,7 @@ 'size': {'mechanism': 'python-code', 'value': 'self.get_array_size_for_python_code()'}, 'type': 'custom_struct', 'numpy': False, - 'complex_type': 'none', + 'complex_type': None, 'use_in_python_api': True, }, { # 4 @@ -153,7 +153,7 @@ 'size': {'mechanism': 'fixed', 'value': 1}, 'type': 'ViInt32', 'numpy': False, - 'complex_type': 'none', + 'complex_type': None, 'use_in_python_api': True, }, { # 5 @@ -181,7 +181,7 @@ 'size': {'mechanism': 'passed-in', 'value': 'numberOfElements'}, 'type': 'ViInt16', 'numpy': False, - 'complex_type': 'none', + 'complex_type': None, 'use_in_python_api': True, }, { # 6 @@ -210,7 +210,7 @@ 'size': {'mechanism': 'fixed', 'value': 1}, 'type': 'ViInt16', 'numpy': False, - 'complex_type': 'none', + 'complex_type': None, 'use_in_python_api': True, }, { # 7 @@ -238,7 +238,7 @@ 'size': {'mechanism': 'passed-in', 'value': 'numberOfElements'}, 'type': 'ViInt64', 'numpy': True, - 'complex_type': 'none', + 'complex_type': None, 'numpy_type': 'int64', 'numpy_type_library_call': 'numpy.int64', 'use_in_python_api': True, @@ -260,7 +260,7 @@ 'interpreter_method_call_snippet': 'number_of_elements_python_code', 'name': 'numberOfElementsPythonCode', 'numpy': False, - 'complex_type': 'none', + 'complex_type': None, 'python_name': 'number_of_elements_python_code', 'python_name_with_default': 'number_of_elements_python_code', 'python_name_with_doc_default': 'number_of_elements_python_code', @@ -286,7 +286,7 @@ 'interpreter_method_call_snippet': 'input', 'name': 'input', 'numpy': False, - 'complex_type': 'none', + 'complex_type': None, 'python_name': 'input', 'python_name_with_default': 'input', 'python_name_with_doc_default': 'input', @@ -315,7 +315,7 @@ 'interpreter_method_call_snippet': 'input_array', 'name': 'inputArray', 'numpy': False, - 'complex_type': 'none', + 'complex_type': None, 'python_name': 'input_array', 'python_name_with_default': 'input_array=None', 'python_name_with_doc_default': 'input_array=None', @@ -341,7 +341,7 @@ 'interpreter_method_call_snippet': 'input_array_size', 'name': 'inputArraySize', 'numpy': False, - 'complex_type': 'none', + 'complex_type': None, 'python_name': 'input_array_size', 'python_name_with_default': 'input_array_size', 'python_name_with_doc_default': 'input_array_size', @@ -367,7 +367,7 @@ 'interpreter_method_call_snippet': 'string_size', 'name': 'stringSize', 'numpy': False, - 'complex_type': 'none', + 'complex_type': None, 'python_name': 'string_size', 'python_name_with_default': 'string_size', 'python_name_with_doc_default': 'string_size', @@ -393,7 +393,7 @@ 'interpreter_method_call_snippet': 'a_string', 'name': 'aString', 'numpy': False, - 'complex_type': 'none', + 'complex_type': None, 'python_name': 'a_string', 'python_name_with_default': 'a_string', 'python_name_with_doc_default': 'a_string', @@ -420,7 +420,7 @@ 'interpreter_method_call_snippet': 'timeout', 'name': 'Timeout', 'numpy': False, - 'complex_type': 'none', + 'complex_type': None, 'python_name': 'timeout', 'python_name_with_default': 'timeout=1.0', 'python_name_with_doc_default': 'timeout=1.0', @@ -449,7 +449,7 @@ 'interpreter_method_call_snippet': 'self._repeated_capability', 'name': 'channelList', 'numpy': False, - 'complex_type': 'none', + 'complex_type': None, 'original_type': 'ViChar[]', 'python_name': 'channel_list', 'python_name_with_default': 'channel_list', @@ -476,7 +476,7 @@ 'interpreter_method_call_snippet': 'a_string', 'name': 'aString', 'numpy': False, - 'complex_type': 'none', + 'complex_type': None, 'python_name': 'a_string', 'python_name_with_default': 'a_string', 'python_name_with_doc_default': 'a_string', @@ -509,7 +509,7 @@ 'size': {'mechanism': 'len', 'value': 'array_in'}, 'type': 'custom_struct', 'numpy': False, - 'complex_type': 'none', + 'complex_type': None, 'use_in_python_api': True, }, { # 18 @@ -539,7 +539,7 @@ 'size': {'mechanism': 'fixed', 'value': 256}, 'type': 'ViInt16', 'numpy': False, - 'complex_type': 'none', + 'complex_type': None, 'use_in_python_api': True, }, { # 19 @@ -559,7 +559,7 @@ 'interpreter_method_call_snippet': 'a_string_2', 'name': 'aString2', 'numpy': False, - 'complex_type': 'none', + 'complex_type': None, 'python_name': 'a_string_2', 'python_name_with_default': 'a_string_2', 'python_name_with_doc_default': 'a_string_2', @@ -585,7 +585,7 @@ 'interpreter_method_call_snippet': 'a_string_3', 'name': 'aStrin3g', 'numpy': False, - 'complex_type': 'none', + 'complex_type': None, 'python_name': 'a_string_3', 'python_name_with_default': 'a_string_3', 'python_name_with_doc_default': 'a_string_3', @@ -611,7 +611,7 @@ 'interpreter_method_call_snippet': 'a_string_twist', 'name': 'aStringTwist', 'numpy': False, - 'complex_type': 'none', + 'complex_type': None, 'python_name': 'a_string_twist', 'python_name_with_default': 'a_string_twist', 'python_name_with_doc_default': 'a_string_twist', @@ -646,7 +646,7 @@ 'size': {'mechanism': 'fixed', 'value': 1}, 'type': 'ViInt64', 'numpy': False, - 'complex_type': 'none', + 'complex_type': None, 'use_in_python_api': True, }, { # 23 @@ -666,7 +666,7 @@ 'interpreter_method_call_snippet': 'string_size_twist', 'name': 'stringSizeTwist', 'numpy': False, - 'complex_type': 'none', + 'complex_type': None, 'python_name': 'string_size_twist', 'python_name_with_default': 'string_size_twist', 'python_name_with_doc_default': 'string_size_twist', @@ -692,7 +692,7 @@ 'interpreter_method_call_snippet': 'a_buffer', 'name': 'aBufferArray', 'numpy': False, - 'complex_type': 'none', + 'complex_type': None, 'python_name': 'a_buffer_array', 'python_name_with_default': 'a_buffer_array', 'python_name_with_doc_default': 'a_buffer_array', @@ -720,7 +720,7 @@ 'interpreter_method_call_snippet': 'a_buffer', 'name': 'aBufferList', 'numpy': False, - 'complex_type': 'none', + 'complex_type': None, 'python_name': 'a_buffer_list', 'python_name_with_default': 'a_buffer_list', 'python_name_with_doc_default': 'a_buffer_list', @@ -748,7 +748,7 @@ 'interpreter_method_call_snippet': 'a_buffer', 'name': 'aBufferTwistArray', 'numpy': False, - 'complex_type': 'none', + 'complex_type': None, 'python_name': 'a_buffer_twist_array', 'python_name_with_default': 'a_buffer_twist_array', 'python_name_with_doc_default': 'a_buffer_twist_array', @@ -776,7 +776,7 @@ 'interpreter_method_call_snippet': 'a_buffer', 'name': 'aBufferTwistList', 'numpy': False, - 'complex_type': 'none', + 'complex_type': None, 'python_name': 'a_buffer_twist_list', 'python_name_with_default': 'a_buffer_twist_list', 'python_name_with_doc_default': 'a_buffer_twist_list', @@ -807,7 +807,7 @@ 'interpreter_method_call_snippet': 'input_array_2', 'name': 'inputArray2', 'numpy': False, - 'complex_type': 'none', + 'complex_type': None, 'python_name': 'input_array_2', 'python_name_with_default': 'input_array_2=None', 'python_name_with_doc_default': 'input_array_2=None', @@ -836,7 +836,7 @@ 'interpreter_method_call_snippet': 'input_array_2', 'name': 'inputArray2', 'numpy': False, - 'complex_type': 'none', + 'complex_type': None, 'python_api_converter_name': 'convert_to_nitclk_session_num_list', 'python_name': 'input_array_2', 'python_name_with_default': 'input_array_2=None', @@ -866,7 +866,7 @@ 'interpreter_method_call_snippet': 'input_array_3', 'name': 'inputArray3', 'numpy': False, - 'complex_type': 'none', + 'complex_type': None, 'python_api_converter_name': 'convert_to_nitclk_session_num_list', 'python_name': 'input_array_3', 'python_name_with_default': 'input_array_3=None', @@ -896,7 +896,7 @@ 'interpreter_method_call_snippet': 'input_array_3', 'name': 'inputArray4', 'numpy': False, - 'complex_type': 'none', + 'complex_type': None, 'python_api_converter_name': 'convert_to_nitclk_session_num_list', 'python_name': 'input_array_4', 'python_name_with_default': 'input_array_4=None', @@ -926,7 +926,7 @@ 'interpreter_method_call_snippet': 'input_array_3', 'name': 'inputArray4', 'numpy': False, - 'complex_type': 'none', + 'complex_type': None, 'python_api_converter_name': 'convert_to_nitclk_session_num_list', 'python_name': 'input_array_4', 'python_name_with_default': 'input_array_4=None', @@ -953,7 +953,7 @@ 'interpreter_method_call_snippet': 'a_string_enum', 'name': 'aStringEnum', 'numpy': False, - 'complex_type': 'none', + 'complex_type': None, 'python_name': 'a_string_enum', 'python_name_with_default': 'a_string_enum', 'python_name_with_doc_default': 'a_string_enum', @@ -981,7 +981,7 @@ 'interpreter_method_call_snippet': 'indices', 'name': 'indices', 'numpy': False, - 'complex_type': 'none', + 'complex_type': None, 'original_type': 'ViChar[]', 'python_api_converter_name': 'convert_repeated_capabilities_without_prefix', 'python_name': 'indices', @@ -1018,7 +1018,7 @@ 'size': {'mechanism': 'passed-in', 'value': 'numberOfElements'}, 'type': 'ViInt8', 'numpy': False, - 'complex_type': 'none', + 'complex_type': None, 'use_in_python_api': True, }, ] @@ -1217,7 +1217,7 @@ def test_get_ctype_variable_declaration_snippet_case_s220(): def test_get_ctype_variable_declaration_snippet_case_b510(): snippet = get_ctype_variable_declaration_snippet(parameters_for_testing[7], parameters_for_testing, IviDanceStep.NOT_APPLICABLE, config_for_testing, use_numpy_array=True) - assert snippet == ["output_ctype = _get_ctypes_pointer_for_buffer(value=output) # case B510"] + assert snippet == ["output_ctype = _get_ctypes_pointer_for_buffer(value=output, library_type=numpy.ViInt64) # case B510"] def test_get_ctype_variable_declaration_snippet_case_b540(): diff --git a/build/unit_tests/test_metadata_add_all.py b/build/unit_tests/test_metadata_add_all.py index ae0249a31c..f32828c641 100644 --- a/build/unit_tests/test_metadata_add_all.py +++ b/build/unit_tests/test_metadata_add_all.py @@ -259,7 +259,7 @@ def _compare_dicts(actual, expected): 'grpc_request_snippet': 'vi=self._vi', 'use_in_python_api': True, 'python_name_or_default_for_init': 'vi', - 'complex_type': 'none', + 'complex_type': None, }, { 'ctypes_method_call_snippet': 'name_ctype', @@ -293,7 +293,7 @@ def _compare_dicts(actual, expected): 'grpc_request_snippet': 'name=name', 'use_in_python_api': True, 'python_name_or_default_for_init': 'name', - 'complex_type': 'none', + 'complex_type': None, }, { 'ctypes_method_call_snippet': 'pin_data_buffer_size_ctype', @@ -330,7 +330,7 @@ def _compare_dicts(actual, expected): 'grpc_request_snippet': 'pin_data_buffer_size=pin_data_buffer_size', 'use_in_python_api': False, 'python_name_or_default_for_init': 'pin_data_buffer_size', - 'complex_type': 'none', + 'complex_type': None, }, { 'ctypes_method_call_snippet': 'python_code_input_ctype', @@ -367,7 +367,7 @@ def _compare_dicts(actual, expected): 'grpc_request_snippet': 'python_code_input=2 ** 14', 'use_in_python_api': True, 'python_name_or_default_for_init': 'python_code_input', - 'complex_type': 'none', + 'complex_type': None, }, { 'ctypes_method_call_snippet': 'None if actual_num_pin_data_ctype is None else (ctypes.pointer(actual_num_pin_data_ctype))', @@ -404,7 +404,7 @@ def _compare_dicts(actual, expected): 'grpc_request_snippet': 'actual_num_pin_data=actual_num_pin_data', 'use_in_python_api': False, 'python_name_or_default_for_init': 'actual_num_pin_data', - 'complex_type': 'none', + 'complex_type': None, }, { 'ctypes_method_call_snippet': 'expected_pin_states_ctype', @@ -443,7 +443,7 @@ def _compare_dicts(actual, expected): 'grpc_request_snippet': 'expected_pin_states=expected_pin_states', 'use_in_python_api': True, 'python_name_or_default_for_init': 'expected_pin_states', - 'complex_type': 'none', + 'complex_type': None, }, { 'ctypes_method_call_snippet': 'custom_type_input_ctype', @@ -480,7 +480,7 @@ def _compare_dicts(actual, expected): 'grpc_request_snippet': 'custom_type_input=custom_type_input._create_copy(grpc_types.CustomStruct)', 'use_in_python_api': True, 'python_name_or_default_for_init': 'custom_type_input', - 'complex_type': 'none', + 'complex_type': None, }, { 'ctypes_method_call_snippet': 'None if custom_type_output_ctype is None else (ctypes.pointer(custom_type_output_ctype))', @@ -517,7 +517,7 @@ def _compare_dicts(actual, expected): 'grpc_request_snippet': 'custom_type_output=custom_type_output._create_copy(grpc_types.CustomStruct)', 'use_in_python_api': True, 'python_name_or_default_for_init': 'custom_type_output', - 'complex_type': 'none', + 'complex_type': None, }, { 'ctypes_method_call_snippet': 'custom_type_without_struct_prefix_input_ctype', @@ -554,7 +554,7 @@ def _compare_dicts(actual, expected): 'grpc_request_snippet': 'custom_type_without_struct_prefix_input=custom_type_without_struct_prefix_input._create_copy(grpc_types.CustomStruct)', 'use_in_python_api': True, 'python_name_or_default_for_init': 'custom_type_without_struct_prefix_input', - 'complex_type': 'none', + 'complex_type': None, }, { 'ctypes_method_call_snippet': 'None if custom_type_without_struct_prefix_output_ctype is None else (ctypes.pointer(custom_type_without_struct_prefix_output_ctype))', @@ -591,7 +591,7 @@ def _compare_dicts(actual, expected): 'grpc_request_snippet': 'custom_type_without_struct_prefix_output=custom_type_without_struct_prefix_output._create_copy(grpc_types.CustomStruct)', 'use_in_python_api': True, 'python_name_or_default_for_init': 'custom_type_without_struct_prefix_output', - 'complex_type': 'none', + 'complex_type': None, }, ], 'python_name': 'make_a_foo', @@ -639,7 +639,7 @@ def _compare_dicts(actual, expected): 'grpc_request_snippet': 'vi=self._vi', 'use_in_python_api': True, 'python_name_or_default_for_init': 'vi', - 'complex_type': 'none', + 'complex_type': None, }, { 'ctypes_method_call_snippet': 'status_ctype', @@ -676,7 +676,7 @@ def _compare_dicts(actual, expected): 'grpc_request_snippet': 'status=status', 'use_in_python_api': True, 'python_name_or_default_for_init': 'status', - 'complex_type': 'none', + 'complex_type': None, }, { 'ctypes_method_call_snippet': 'data_buffer_size_ctype', @@ -713,7 +713,7 @@ def _compare_dicts(actual, expected): 'grpc_request_snippet': 'data_buffer_size=data_buffer_size', 'use_in_python_api': False, 'python_name_or_default_for_init': 'data_buffer_size', - 'complex_type': 'none', + 'complex_type': None, }, { 'ctypes_method_call_snippet': 'data_ctype', @@ -751,7 +751,7 @@ def _compare_dicts(actual, expected): 'grpc_request_snippet': 'data=data', 'use_in_python_api': True, 'python_name_or_default_for_init': 'data', - 'complex_type': 'none', + 'complex_type': None, }, ], 'documentation': { From d2681cd6e6cacaaa4b5ee624be8c2e028e9254af Mon Sep 17 00:00:00 2001 From: Rahul R Date: Tue, 10 Jun 2025 15:42:07 +0530 Subject: [PATCH 29/33] Moving the common lines in complex matchers into a function --- build/templates/_matchers.py.mako | 33 +++++++------------ build/unit_tests/test_codegen_helper.py | 2 +- .../nifake/nifake/unit_tests/_matchers.py | 33 +++++++------------ 3 files changed, 25 insertions(+), 43 deletions(-) diff --git a/build/templates/_matchers.py.mako b/build/templates/_matchers.py.mako index 53f3006dab..4c9d42768f 100644 --- a/build/templates/_matchers.py.mako +++ b/build/templates/_matchers.py.mako @@ -283,6 +283,15 @@ class ViReal64PointerMatcher(_PointerMatcher): % if are_complex_parameters_used: +def _compare_complex_number_arrays(expected, actual): + for i in range(expected.expected_size): + expected_value = expected.expected_data[i] + actual_value = actual[i] + if expected_value.real != actual_value.real or expected_value.imag != actual_value.imag: + return False + return True + + class NIComplexNumberPointerMatcher(_PointerMatcher): def __init__(self, expected_data, expected_size): _PointerMatcher.__init__(self, _complextype.NIComplexNumber) @@ -291,13 +300,7 @@ class NIComplexNumberPointerMatcher(_PointerMatcher): def __eq__(self, other): _PointerMatcher.__eq__(self, other) - - for i in range(self.expected_size): - expected_value = self.expected_data[i] - actual_value = other[i] - if expected_value.real != actual_value.real or expected_value.imag != actual_value.imag: - return False - return True + return _compare_complex_number_arrays(self, other) def __repr__(self): return f"NIComplexNumberPointerMatcher({self.expected_data})" @@ -311,13 +314,7 @@ class NIComplexNumberF32PointerMatcher(_PointerMatcher): def __eq__(self, other): _PointerMatcher.__eq__(self, other) - - for i in range(self.expected_size): - expected_value = self.expected_data[i] - actual_value = other[i] - if expected_value.real != actual_value.real or expected_value.imag != actual_value.imag: - return False - return True + return _compare_complex_number_arrays(self, other) def __repr__(self): return f"NIComplexNumberF32PointerMatcher({self.expected_data})" @@ -331,13 +328,7 @@ class NIComplexI16PointerMatcher(_PointerMatcher): def __eq__(self, other): _PointerMatcher.__eq__(self, other) - - for i in range(self.expected_size): - expected_value = self.expected_data[i] - actual_value = other[i] - if expected_value.real != actual_value.real or expected_value.imag != actual_value.imag: - return False - return True + return _compare_complex_number_arrays(self, other) def __repr__(self): return f"NIComplexI16PointerMatcher({self.expected_data})" diff --git a/build/unit_tests/test_codegen_helper.py b/build/unit_tests/test_codegen_helper.py index fb38c03683..4b5f504664 100644 --- a/build/unit_tests/test_codegen_helper.py +++ b/build/unit_tests/test_codegen_helper.py @@ -1217,7 +1217,7 @@ def test_get_ctype_variable_declaration_snippet_case_s220(): def test_get_ctype_variable_declaration_snippet_case_b510(): snippet = get_ctype_variable_declaration_snippet(parameters_for_testing[7], parameters_for_testing, IviDanceStep.NOT_APPLICABLE, config_for_testing, use_numpy_array=True) - assert snippet == ["output_ctype = _get_ctypes_pointer_for_buffer(value=output, library_type=numpy.ViInt64) # case B510"] + assert snippet == ["output_ctype = _get_ctypes_pointer_for_buffer(value=output) # case B510"] def test_get_ctype_variable_declaration_snippet_case_b540(): diff --git a/generated/nifake/nifake/unit_tests/_matchers.py b/generated/nifake/nifake/unit_tests/_matchers.py index 5371181e3d..f95383417b 100644 --- a/generated/nifake/nifake/unit_tests/_matchers.py +++ b/generated/nifake/nifake/unit_tests/_matchers.py @@ -272,6 +272,15 @@ def __init__(self): _PointerMatcher.__init__(self, _visatype.ViReal64) +def _compare_complex_number_arrays(expected, actual): + for i in range(expected.expected_size): + expected_value = expected.expected_data[i] + actual_value = actual[i] + if expected_value.real != actual_value.real or expected_value.imag != actual_value.imag: + return False + return True + + class NIComplexNumberPointerMatcher(_PointerMatcher): def __init__(self, expected_data, expected_size): _PointerMatcher.__init__(self, _complextype.NIComplexNumber) @@ -280,13 +289,7 @@ def __init__(self, expected_data, expected_size): def __eq__(self, other): _PointerMatcher.__eq__(self, other) - - for i in range(self.expected_size): - expected_value = self.expected_data[i] - actual_value = other[i] - if expected_value.real != actual_value.real or expected_value.imag != actual_value.imag: - return False - return True + return _compare_complex_number_arrays(self, other) def __repr__(self): return f"NIComplexNumberPointerMatcher({self.expected_data})" @@ -300,13 +303,7 @@ def __init__(self, expected_data, expected_size): def __eq__(self, other): _PointerMatcher.__eq__(self, other) - - for i in range(self.expected_size): - expected_value = self.expected_data[i] - actual_value = other[i] - if expected_value.real != actual_value.real or expected_value.imag != actual_value.imag: - return False - return True + return _compare_complex_number_arrays(self, other) def __repr__(self): return f"NIComplexNumberF32PointerMatcher({self.expected_data})" @@ -320,13 +317,7 @@ def __init__(self, expected_data, expected_size): def __eq__(self, other): _PointerMatcher.__eq__(self, other) - - for i in range(self.expected_size): - expected_value = self.expected_data[i] - actual_value = other[i] - if expected_value.real != actual_value.real or expected_value.imag != actual_value.imag: - return False - return True + return _compare_complex_number_arrays(self, other) def __repr__(self): return f"NIComplexI16PointerMatcher({self.expected_data})" From f52aef8be5cbdd504ee915a5d2a260073288081d Mon Sep 17 00:00:00 2001 From: Rahul R Date: Mon, 23 Jun 2025 19:09:45 +0530 Subject: [PATCH 30/33] Updaing the library.py.mako file to import complex type --- build/templates/_library.py.mako | 4 ++++ generated/nifake/nifake/_library.py | 1 + 2 files changed, 5 insertions(+) diff --git a/build/templates/_library.py.mako b/build/templates/_library.py.mako index e77a7bb624..a4c2422833 100644 --- a/build/templates/_library.py.mako +++ b/build/templates/_library.py.mako @@ -12,12 +12,16 @@ driver_name = config['driver_name'] functions = config['functions'] functions = helper.filter_library_functions(functions) +are_complex_parameters_used = helper.are_complex_parameters_used(functions) %>\ import ctypes import ${module_name}.errors as errors import threading +% if are_complex_parameters_used: +from ${module_name}._complextype import * # noqa: F403 +% endif from ${module_name}._visatype import * # noqa: F403,H303 % for c in config['custom_types']: diff --git a/generated/nifake/nifake/_library.py b/generated/nifake/nifake/_library.py index 4dabf53b87..d34f3a8bbe 100644 --- a/generated/nifake/nifake/_library.py +++ b/generated/nifake/nifake/_library.py @@ -5,6 +5,7 @@ import nifake.errors as errors import threading +from nifake._complextype import * # noqa: F403 from nifake._visatype import * # noqa: F403,H303 import nifake.custom_struct as custom_struct # noqa: F401 From 23ff306c762bf059151ce700eb99f95a134b6d36 Mon Sep 17 00:00:00 2001 From: Rahul R Date: Mon, 30 Jun 2025 11:10:06 +0530 Subject: [PATCH 31/33] Code Reivew Changes --- .../unit_tests/test_library_interpreter.py | 10 +---- .../nifake/nifake/unit_tests/test_session.py | 38 +++++++++---------- .../unit_tests/test_library_interpreter.py | 10 +---- src/nifake/unit_tests/test_session.py | 38 +++++++++---------- 4 files changed, 40 insertions(+), 56 deletions(-) diff --git a/generated/nifake/nifake/unit_tests/test_library_interpreter.py b/generated/nifake/nifake/unit_tests/test_library_interpreter.py index 3890bf1800..25b463b0a5 100644 --- a/generated/nifake/nifake/unit_tests/test_library_interpreter.py +++ b/generated/nifake/nifake/unit_tests/test_library_interpreter.py @@ -844,12 +844,9 @@ def test_import_attribute_configuration_buffer_str(self): self.patched_library.niFake_ImportAttributeConfigurationBuffer.assert_called_once_with(_matchers.ViSessionMatcher(SESSION_NUM_FOR_TEST), _matchers.ViInt32Matcher(len(configuration)), _matchers.ViInt8BufferMatcher(expected_list)) def test_write_waveform_numpy_complex128_valid_input(self): - import ctypes - import numpy as np - from nifake._complextype import NIComplexNumber - waveform_data = np.full(1000, 0.707 + 0.707j, dtype=np.complex128) + waveform_data = numpy.full(1000, 0.707 + 0.707j, dtype=numpy.complex128) number_of_samples = len(waveform_data) waveform_data_ctypes = (NIComplexNumber * number_of_samples)( @@ -866,12 +863,9 @@ def test_write_waveform_numpy_complex128_valid_input(self): ) def test_write_waveform_numpy_complexi16_valid_input(self): - import ctypes - import numpy as np - from nifake._complextype import NIComplexI16 - waveform_data = np.array([32767, 0] * 1000, dtype=np.int16) + waveform_data = numpy.array([32767, 0] * 1000, dtype=numpy.int16) number_of_samples = len(waveform_data) // 2 waveform_data_ctypes = (NIComplexI16 * number_of_samples)( *[NIComplexI16(real=32767, imag=0) for _ in range(number_of_samples)] diff --git a/generated/nifake/nifake/unit_tests/test_session.py b/generated/nifake/nifake/unit_tests/test_session.py index b86a371ae1..e54720d28a 100644 --- a/generated/nifake/nifake/unit_tests/test_session.py +++ b/generated/nifake/nifake/unit_tests/test_session.py @@ -837,6 +837,24 @@ def test_return_timedeltas(self): assert returned_timedeltas == expected_timedeltas self.patched_library_interpreter.return_list_of_durations_in_seconds.assert_called_once_with(len(time_values)) + def test_session_write_waveform_complex_f32_invalid_dtype(self): + invalid_waveform_data = numpy.full(10, 1.0 + 1.0j, dtype=numpy.complex128) + expected_error_message = "waveform_data_array must be numpy.ndarray of dtype=complex64, is complex128" + import pytest + with nifake.Session('dev1') as session: + with pytest.raises(TypeError) as exc_info: + session.write_waveform_complex_f32(invalid_waveform_data) + assert str(exc_info.value) == expected_error_message + + def test_session_write_waveform_complex_i16_invalid_dtype(self): + invalid_waveform_data = numpy.full(10, 1.0 + 1.0j, dtype=numpy.complex64) + expected_error_message = "waveform_data_array must be numpy.ndarray of dtype=int16, is complex64" + import pytest + with nifake.Session('dev1') as session: + with pytest.raises(TypeError) as exc_info: + session.write_waveform_numpy_complex_i16(invalid_waveform_data) + assert str(exc_info.value) == expected_error_message + class TestGrpcSession: @@ -926,26 +944,6 @@ def test_export_attribute_configuration_buffer(self): assert actual_configuration == bytes(expected_buffer) self.patched_grpc_interpreter.export_attribute_configuration_buffer.assert_called_once_with() - def test_session_write_waveform_complex_f32_invalid_dtype(self): - import numpy as np - invalid_waveform_data = np.full(10, 1.0 + 1.0j, dtype=np.complex128) - expected_error_message = "waveform_data_array must be numpy.ndarray of dtype=complex64, is complex128" - import pytest - with nifake.Session('dev1', grpc_options=nifake.GrpcSessionOptions(object(), '')) as session: - with pytest.raises(TypeError) as exc_info: - session.write_waveform_complex_f32(invalid_waveform_data) - assert str(exc_info.value) == expected_error_message - - def test_session_write_waveform_complex_i16_invalid_dtype(self): - import numpy as np - invalid_waveform_data = np.full(10, 1.0 + 1.0j, dtype=np.complex64) - expected_error_message = "waveform_data_array must be numpy.ndarray of dtype=int16, is complex64" - import pytest - with nifake.Session('dev1', grpc_options=nifake.GrpcSessionOptions(object(), '')) as session: - with pytest.raises(TypeError) as exc_info: - session.write_waveform_numpy_complex_i16(invalid_waveform_data) - assert str(exc_info.value) == expected_error_message - # Attributes def test_get_attribute_int32(self): diff --git a/src/nifake/unit_tests/test_library_interpreter.py b/src/nifake/unit_tests/test_library_interpreter.py index 3890bf1800..25b463b0a5 100644 --- a/src/nifake/unit_tests/test_library_interpreter.py +++ b/src/nifake/unit_tests/test_library_interpreter.py @@ -844,12 +844,9 @@ def test_import_attribute_configuration_buffer_str(self): self.patched_library.niFake_ImportAttributeConfigurationBuffer.assert_called_once_with(_matchers.ViSessionMatcher(SESSION_NUM_FOR_TEST), _matchers.ViInt32Matcher(len(configuration)), _matchers.ViInt8BufferMatcher(expected_list)) def test_write_waveform_numpy_complex128_valid_input(self): - import ctypes - import numpy as np - from nifake._complextype import NIComplexNumber - waveform_data = np.full(1000, 0.707 + 0.707j, dtype=np.complex128) + waveform_data = numpy.full(1000, 0.707 + 0.707j, dtype=numpy.complex128) number_of_samples = len(waveform_data) waveform_data_ctypes = (NIComplexNumber * number_of_samples)( @@ -866,12 +863,9 @@ def test_write_waveform_numpy_complex128_valid_input(self): ) def test_write_waveform_numpy_complexi16_valid_input(self): - import ctypes - import numpy as np - from nifake._complextype import NIComplexI16 - waveform_data = np.array([32767, 0] * 1000, dtype=np.int16) + waveform_data = numpy.array([32767, 0] * 1000, dtype=numpy.int16) number_of_samples = len(waveform_data) // 2 waveform_data_ctypes = (NIComplexI16 * number_of_samples)( *[NIComplexI16(real=32767, imag=0) for _ in range(number_of_samples)] diff --git a/src/nifake/unit_tests/test_session.py b/src/nifake/unit_tests/test_session.py index b86a371ae1..e54720d28a 100644 --- a/src/nifake/unit_tests/test_session.py +++ b/src/nifake/unit_tests/test_session.py @@ -837,6 +837,24 @@ def test_return_timedeltas(self): assert returned_timedeltas == expected_timedeltas self.patched_library_interpreter.return_list_of_durations_in_seconds.assert_called_once_with(len(time_values)) + def test_session_write_waveform_complex_f32_invalid_dtype(self): + invalid_waveform_data = numpy.full(10, 1.0 + 1.0j, dtype=numpy.complex128) + expected_error_message = "waveform_data_array must be numpy.ndarray of dtype=complex64, is complex128" + import pytest + with nifake.Session('dev1') as session: + with pytest.raises(TypeError) as exc_info: + session.write_waveform_complex_f32(invalid_waveform_data) + assert str(exc_info.value) == expected_error_message + + def test_session_write_waveform_complex_i16_invalid_dtype(self): + invalid_waveform_data = numpy.full(10, 1.0 + 1.0j, dtype=numpy.complex64) + expected_error_message = "waveform_data_array must be numpy.ndarray of dtype=int16, is complex64" + import pytest + with nifake.Session('dev1') as session: + with pytest.raises(TypeError) as exc_info: + session.write_waveform_numpy_complex_i16(invalid_waveform_data) + assert str(exc_info.value) == expected_error_message + class TestGrpcSession: @@ -926,26 +944,6 @@ def test_export_attribute_configuration_buffer(self): assert actual_configuration == bytes(expected_buffer) self.patched_grpc_interpreter.export_attribute_configuration_buffer.assert_called_once_with() - def test_session_write_waveform_complex_f32_invalid_dtype(self): - import numpy as np - invalid_waveform_data = np.full(10, 1.0 + 1.0j, dtype=np.complex128) - expected_error_message = "waveform_data_array must be numpy.ndarray of dtype=complex64, is complex128" - import pytest - with nifake.Session('dev1', grpc_options=nifake.GrpcSessionOptions(object(), '')) as session: - with pytest.raises(TypeError) as exc_info: - session.write_waveform_complex_f32(invalid_waveform_data) - assert str(exc_info.value) == expected_error_message - - def test_session_write_waveform_complex_i16_invalid_dtype(self): - import numpy as np - invalid_waveform_data = np.full(10, 1.0 + 1.0j, dtype=np.complex64) - expected_error_message = "waveform_data_array must be numpy.ndarray of dtype=int16, is complex64" - import pytest - with nifake.Session('dev1', grpc_options=nifake.GrpcSessionOptions(object(), '')) as session: - with pytest.raises(TypeError) as exc_info: - session.write_waveform_numpy_complex_i16(invalid_waveform_data) - assert str(exc_info.value) == expected_error_message - # Attributes def test_get_attribute_int32(self): From 5669590d14ef46b3f943bac4a1300ef2f0ad247e Mon Sep 17 00:00:00 2001 From: Rahul R Date: Mon, 30 Jun 2025 16:38:53 +0530 Subject: [PATCH 32/33] Updaed code review comments --- .../nifake/nifake/_grpc_stub_interpreter.py | 6 +-- generated/nifake/nifake/_library.py | 42 ++++++++-------- .../nifake/nifake/_library_interpreter.py | 16 +++---- generated/nifake/nifake/session.py | 34 ++++++------- .../nifake/nifake/unit_tests/_mock_helper.py | 48 +++++++++---------- .../unit_tests/test_library_interpreter.py | 33 ++++++++++--- .../nifake/nifake/unit_tests/test_session.py | 17 +++++-- src/nifake/metadata/functions.py | 6 +-- .../unit_tests/test_library_interpreter.py | 33 ++++++++++--- src/nifake/unit_tests/test_session.py | 17 +++++-- 10 files changed, 154 insertions(+), 98 deletions(-) diff --git a/generated/nifake/nifake/_grpc_stub_interpreter.py b/generated/nifake/nifake/_grpc_stub_interpreter.py index dcefa0ef95..489da15385 100644 --- a/generated/nifake/nifake/_grpc_stub_interpreter.py +++ b/generated/nifake/nifake/_grpc_stub_interpreter.py @@ -489,13 +489,13 @@ def write_waveform(self, waveform): # noqa: N802 def write_waveform_numpy(self, waveform): # noqa: N802 raise NotImplementedError('numpy-specific methods are not supported over gRPC') - def write_waveform_complex_f32(self, waveform_data_array): # noqa: N802 + def write_waveform_numpy_complex128(self, waveform_data_array): # noqa: N802 raise NotImplementedError('numpy-specific methods are not supported over gRPC') - def write_waveform_complex_f64(self, waveform_data_array): # noqa: N802 + def write_waveform_numpy_complex64(self, waveform_data_array): # noqa: N802 raise NotImplementedError('numpy-specific methods are not supported over gRPC') - def write_waveform_numpy_complex_i16(self, waveform_data_array): # noqa: N802 + def write_waveform_numpy_complex_interleaved_i16(self, waveform_data_array): # noqa: N802 raise NotImplementedError('numpy-specific methods are not supported over gRPC') def close(self): # noqa: N802 diff --git a/generated/nifake/nifake/_library.py b/generated/nifake/nifake/_library.py index d34f3a8bbe..e9e6e94d6a 100644 --- a/generated/nifake/nifake/_library.py +++ b/generated/nifake/nifake/_library.py @@ -93,9 +93,9 @@ def __init__(self, ctypes_library): self.niFake_UnlockSession_cfunc = None self.niFake_Use64BitNumber_cfunc = None self.niFake_WriteWaveform_cfunc = None - self.niFake_WriteWaveformComplexF32_cfunc = None - self.niFake_WriteWaveformComplexF64_cfunc = None - self.niFake_WriteWaveformNumpyComplexI16_cfunc = None + self.niFake_WriteWaveformNumpyComplex128_cfunc = None + self.niFake_WriteWaveformNumpyComplex64_cfunc = None + self.niFake_WriteWaveformNumpyComplexInterleavedI16_cfunc = None self.niFake_close_cfunc = None self.niFake_error_message_cfunc = None self.niFake_self_test_cfunc = None @@ -643,29 +643,29 @@ def niFake_WriteWaveform(self, vi, number_of_samples, waveform): # noqa: N802 self.niFake_WriteWaveform_cfunc.restype = ViStatus # noqa: F405 return self.niFake_WriteWaveform_cfunc(vi, number_of_samples, waveform) - def niFake_WriteWaveformComplexF32(self, vi, number_of_samples, waveform_data_array): # noqa: N802 + def niFake_WriteWaveformNumpyComplex128(self, vi, number_of_samples, waveform_data_array): # noqa: N802 with self._func_lock: - if self.niFake_WriteWaveformComplexF32_cfunc is None: - self.niFake_WriteWaveformComplexF32_cfunc = self._get_library_function('niFake_WriteWaveformComplexF32') - self.niFake_WriteWaveformComplexF32_cfunc.argtypes = [ViSession, ViInt32, ctypes.POINTER(NIComplexNumberF32)] # noqa: F405 - self.niFake_WriteWaveformComplexF32_cfunc.restype = ViStatus # noqa: F405 - return self.niFake_WriteWaveformComplexF32_cfunc(vi, number_of_samples, waveform_data_array) + if self.niFake_WriteWaveformNumpyComplex128_cfunc is None: + self.niFake_WriteWaveformNumpyComplex128_cfunc = self._get_library_function('niFake_WriteWaveformNumpyComplex128') + self.niFake_WriteWaveformNumpyComplex128_cfunc.argtypes = [ViSession, ViInt32, ctypes.POINTER(NIComplexNumber)] # noqa: F405 + self.niFake_WriteWaveformNumpyComplex128_cfunc.restype = ViStatus # noqa: F405 + return self.niFake_WriteWaveformNumpyComplex128_cfunc(vi, number_of_samples, waveform_data_array) - def niFake_WriteWaveformComplexF64(self, vi, number_of_samples, waveform_data_array): # noqa: N802 + def niFake_WriteWaveformNumpyComplex64(self, vi, number_of_samples, waveform_data_array): # noqa: N802 with self._func_lock: - if self.niFake_WriteWaveformComplexF64_cfunc is None: - self.niFake_WriteWaveformComplexF64_cfunc = self._get_library_function('niFake_WriteWaveformComplexF64') - self.niFake_WriteWaveformComplexF64_cfunc.argtypes = [ViSession, ViInt32, ctypes.POINTER(NIComplexNumber)] # noqa: F405 - self.niFake_WriteWaveformComplexF64_cfunc.restype = ViStatus # noqa: F405 - return self.niFake_WriteWaveformComplexF64_cfunc(vi, number_of_samples, waveform_data_array) + if self.niFake_WriteWaveformNumpyComplex64_cfunc is None: + self.niFake_WriteWaveformNumpyComplex64_cfunc = self._get_library_function('niFake_WriteWaveformNumpyComplex64') + self.niFake_WriteWaveformNumpyComplex64_cfunc.argtypes = [ViSession, ViInt32, ctypes.POINTER(NIComplexNumberF32)] # noqa: F405 + self.niFake_WriteWaveformNumpyComplex64_cfunc.restype = ViStatus # noqa: F405 + return self.niFake_WriteWaveformNumpyComplex64_cfunc(vi, number_of_samples, waveform_data_array) - def niFake_WriteWaveformNumpyComplexI16(self, vi, number_of_samples, waveform_data_array): # noqa: N802 + def niFake_WriteWaveformNumpyComplexInterleavedI16(self, vi, number_of_samples, waveform_data_array): # noqa: N802 with self._func_lock: - if self.niFake_WriteWaveformNumpyComplexI16_cfunc is None: - self.niFake_WriteWaveformNumpyComplexI16_cfunc = self._get_library_function('niFake_WriteWaveformNumpyComplexI16') - self.niFake_WriteWaveformNumpyComplexI16_cfunc.argtypes = [ViSession, ViInt32, ctypes.POINTER(NIComplexI16)] # noqa: F405 - self.niFake_WriteWaveformNumpyComplexI16_cfunc.restype = ViStatus # noqa: F405 - return self.niFake_WriteWaveformNumpyComplexI16_cfunc(vi, number_of_samples, waveform_data_array) + if self.niFake_WriteWaveformNumpyComplexInterleavedI16_cfunc is None: + self.niFake_WriteWaveformNumpyComplexInterleavedI16_cfunc = self._get_library_function('niFake_WriteWaveformNumpyComplexInterleavedI16') + self.niFake_WriteWaveformNumpyComplexInterleavedI16_cfunc.argtypes = [ViSession, ViInt32, ctypes.POINTER(NIComplexI16)] # noqa: F405 + self.niFake_WriteWaveformNumpyComplexInterleavedI16_cfunc.restype = ViStatus # noqa: F405 + return self.niFake_WriteWaveformNumpyComplexInterleavedI16_cfunc(vi, number_of_samples, waveform_data_array) def niFake_close(self, vi): # noqa: N802 with self._func_lock: diff --git a/generated/nifake/nifake/_library_interpreter.py b/generated/nifake/nifake/_library_interpreter.py index 7927682f34..799c39772d 100644 --- a/generated/nifake/nifake/_library_interpreter.py +++ b/generated/nifake/nifake/_library_interpreter.py @@ -738,27 +738,27 @@ def write_waveform_numpy(self, waveform): # noqa: N802 errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) return - def write_waveform_complex_f32(self, waveform_data_array): # noqa: N802 + def write_waveform_numpy_complex128(self, waveform_data_array): # noqa: N802 vi_ctype = _visatype.ViSession(self._vi) # case S110 number_of_samples_ctype = _visatype.ViInt32(0 if waveform_data_array is None else len(waveform_data_array)) # case S160 - waveform_data_array_ctype = _get_ctypes_pointer_for_buffer(value=waveform_data_array, library_type=_complextype.NIComplexNumberF32) # case B510 - error_code = self._library.niFake_WriteWaveformComplexF32(vi_ctype, number_of_samples_ctype, waveform_data_array_ctype) + waveform_data_array_ctype = _get_ctypes_pointer_for_buffer(value=waveform_data_array, library_type=_complextype.NIComplexNumber) # case B510 + error_code = self._library.niFake_WriteWaveformNumpyComplex128(vi_ctype, number_of_samples_ctype, waveform_data_array_ctype) errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) return - def write_waveform_complex_f64(self, waveform_data_array): # noqa: N802 + def write_waveform_numpy_complex64(self, waveform_data_array): # noqa: N802 vi_ctype = _visatype.ViSession(self._vi) # case S110 number_of_samples_ctype = _visatype.ViInt32(0 if waveform_data_array is None else len(waveform_data_array)) # case S160 - waveform_data_array_ctype = _get_ctypes_pointer_for_buffer(value=waveform_data_array, library_type=_complextype.NIComplexNumber) # case B510 - error_code = self._library.niFake_WriteWaveformComplexF64(vi_ctype, number_of_samples_ctype, waveform_data_array_ctype) + waveform_data_array_ctype = _get_ctypes_pointer_for_buffer(value=waveform_data_array, library_type=_complextype.NIComplexNumberF32) # case B510 + error_code = self._library.niFake_WriteWaveformNumpyComplex64(vi_ctype, number_of_samples_ctype, waveform_data_array_ctype) errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) return - def write_waveform_numpy_complex_i16(self, waveform_data_array): # noqa: N802 + def write_waveform_numpy_complex_interleaved_i16(self, waveform_data_array): # noqa: N802 vi_ctype = _visatype.ViSession(self._vi) # case S110 number_of_samples_ctype = _visatype.ViInt32(0 if waveform_data_array is None else len(waveform_data_array) // 2) # case S160 waveform_data_array_ctype = _get_ctypes_pointer_for_buffer(value=waveform_data_array, library_type=_complextype.NIComplexI16) # case B510 - error_code = self._library.niFake_WriteWaveformNumpyComplexI16(vi_ctype, number_of_samples_ctype, waveform_data_array_ctype) + error_code = self._library.niFake_WriteWaveformNumpyComplexInterleavedI16(vi_ctype, number_of_samples_ctype, waveform_data_array_ctype) errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) return diff --git a/generated/nifake/nifake/session.py b/generated/nifake/nifake/session.py index 93393e031f..c81870530b 100644 --- a/generated/nifake/nifake/session.py +++ b/generated/nifake/nifake/session.py @@ -1671,13 +1671,13 @@ def write_waveform_numpy(self, waveform): self._interpreter.write_waveform_numpy(waveform) @ivi_synchronized - def write_waveform_complex_f32(self, waveform_data_array): - r'''write_waveform_complex_f32 + def write_waveform_numpy_complex128(self, waveform_data_array): + r'''write_waveform_numpy_complex128 - A method that writes a waveform of numpy complex64 numbers. + A method that writes a waveform of numpy complex128 numbers Args: - waveform_data_array (numpy.array(dtype=numpy.complex64)): Specifies the array of data to load into the waveform. Array should be numberOfSamples big. + waveform_data_array (numpy.array(dtype=numpy.complex128)): Specifies the array of data to load into the waveform. Array should be numberOfSamples big. ''' import numpy @@ -1686,18 +1686,18 @@ def write_waveform_complex_f32(self, waveform_data_array): raise TypeError('waveform_data_array must be {0}, is {1}'.format(numpy.ndarray, type(waveform_data_array))) if numpy.isfortran(waveform_data_array) is True: raise TypeError('waveform_data_array must be in C-order') - if waveform_data_array.dtype is not numpy.dtype('complex64'): - raise TypeError('waveform_data_array must be numpy.ndarray of dtype=complex64, is ' + str(waveform_data_array.dtype)) - self._interpreter.write_waveform_complex_f32(waveform_data_array) + if waveform_data_array.dtype is not numpy.dtype('complex128'): + raise TypeError('waveform_data_array must be numpy.ndarray of dtype=complex128, is ' + str(waveform_data_array.dtype)) + self._interpreter.write_waveform_numpy_complex128(waveform_data_array) @ivi_synchronized - def write_waveform_complex_f64(self, waveform_data_array): - r'''write_waveform_complex_f64 + def write_waveform_numpy_complex64(self, waveform_data_array): + r'''write_waveform_numpy_complex64 - A method that writes a waveform of numpy complex128 numbers + A method that writes a waveform of numpy complex64 numbers. Args: - waveform_data_array (numpy.array(dtype=numpy.complex128)): Specifies the array of data to load into the waveform. Array should be numberOfSamples big. + waveform_data_array (numpy.array(dtype=numpy.complex64)): Specifies the array of data to load into the waveform. Array should be numberOfSamples big. ''' import numpy @@ -1706,13 +1706,13 @@ def write_waveform_complex_f64(self, waveform_data_array): raise TypeError('waveform_data_array must be {0}, is {1}'.format(numpy.ndarray, type(waveform_data_array))) if numpy.isfortran(waveform_data_array) is True: raise TypeError('waveform_data_array must be in C-order') - if waveform_data_array.dtype is not numpy.dtype('complex128'): - raise TypeError('waveform_data_array must be numpy.ndarray of dtype=complex128, is ' + str(waveform_data_array.dtype)) - self._interpreter.write_waveform_complex_f64(waveform_data_array) + if waveform_data_array.dtype is not numpy.dtype('complex64'): + raise TypeError('waveform_data_array must be numpy.ndarray of dtype=complex64, is ' + str(waveform_data_array.dtype)) + self._interpreter.write_waveform_numpy_complex64(waveform_data_array) @ivi_synchronized - def write_waveform_numpy_complex_i16(self, waveform_data_array): - r'''write_waveform_numpy_complex_i16 + def write_waveform_numpy_complex_interleaved_i16(self, waveform_data_array): + r'''write_waveform_numpy_complex_interleaved_i16 A method that writes a waveform of numpy complex i16 numbers. @@ -1728,7 +1728,7 @@ def write_waveform_numpy_complex_i16(self, waveform_data_array): raise TypeError('waveform_data_array must be in C-order') if waveform_data_array.dtype is not numpy.dtype('int16'): raise TypeError('waveform_data_array must be numpy.ndarray of dtype=int16, is ' + str(waveform_data_array.dtype)) - self._interpreter.write_waveform_numpy_complex_i16(waveform_data_array) + self._interpreter.write_waveform_numpy_complex_interleaved_i16(waveform_data_array) def _close(self): r'''_close diff --git a/generated/nifake/nifake/unit_tests/_mock_helper.py b/generated/nifake/nifake/unit_tests/_mock_helper.py index 2208ccd410..7943d3f939 100644 --- a/generated/nifake/nifake/unit_tests/_mock_helper.py +++ b/generated/nifake/nifake/unit_tests/_mock_helper.py @@ -210,12 +210,12 @@ def __init__(self): self._defaults['Use64BitNumber']['output'] = None self._defaults['WriteWaveform'] = {} self._defaults['WriteWaveform']['return'] = 0 - self._defaults['WriteWaveformComplexF32'] = {} - self._defaults['WriteWaveformComplexF32']['return'] = 0 - self._defaults['WriteWaveformComplexF64'] = {} - self._defaults['WriteWaveformComplexF64']['return'] = 0 - self._defaults['WriteWaveformNumpyComplexI16'] = {} - self._defaults['WriteWaveformNumpyComplexI16']['return'] = 0 + self._defaults['WriteWaveformNumpyComplex128'] = {} + self._defaults['WriteWaveformNumpyComplex128']['return'] = 0 + self._defaults['WriteWaveformNumpyComplex64'] = {} + self._defaults['WriteWaveformNumpyComplex64']['return'] = 0 + self._defaults['WriteWaveformNumpyComplexInterleavedI16'] = {} + self._defaults['WriteWaveformNumpyComplexInterleavedI16']['return'] = 0 self._defaults['close'] = {} self._defaults['close']['return'] = 0 self._defaults['error_message'] = {} @@ -961,20 +961,20 @@ def niFake_WriteWaveform(self, vi, number_of_samples, waveform): # noqa: N802 return self._defaults['WriteWaveform']['return'] return self._defaults['WriteWaveform']['return'] - def niFake_WriteWaveformComplexF32(self, vi, number_of_samples, waveform_data_array): # noqa: N802 - if self._defaults['WriteWaveformComplexF32']['return'] != 0: - return self._defaults['WriteWaveformComplexF32']['return'] - return self._defaults['WriteWaveformComplexF32']['return'] + def niFake_WriteWaveformNumpyComplex128(self, vi, number_of_samples, waveform_data_array): # noqa: N802 + if self._defaults['WriteWaveformNumpyComplex128']['return'] != 0: + return self._defaults['WriteWaveformNumpyComplex128']['return'] + return self._defaults['WriteWaveformNumpyComplex128']['return'] - def niFake_WriteWaveformComplexF64(self, vi, number_of_samples, waveform_data_array): # noqa: N802 - if self._defaults['WriteWaveformComplexF64']['return'] != 0: - return self._defaults['WriteWaveformComplexF64']['return'] - return self._defaults['WriteWaveformComplexF64']['return'] + def niFake_WriteWaveformNumpyComplex64(self, vi, number_of_samples, waveform_data_array): # noqa: N802 + if self._defaults['WriteWaveformNumpyComplex64']['return'] != 0: + return self._defaults['WriteWaveformNumpyComplex64']['return'] + return self._defaults['WriteWaveformNumpyComplex64']['return'] - def niFake_WriteWaveformNumpyComplexI16(self, vi, number_of_samples, waveform_data_array): # noqa: N802 - if self._defaults['WriteWaveformNumpyComplexI16']['return'] != 0: - return self._defaults['WriteWaveformNumpyComplexI16']['return'] - return self._defaults['WriteWaveformNumpyComplexI16']['return'] + def niFake_WriteWaveformNumpyComplexInterleavedI16(self, vi, number_of_samples, waveform_data_array): # noqa: N802 + if self._defaults['WriteWaveformNumpyComplexInterleavedI16']['return'] != 0: + return self._defaults['WriteWaveformNumpyComplexInterleavedI16']['return'] + return self._defaults['WriteWaveformNumpyComplexInterleavedI16']['return'] def niFake_close(self, vi): # noqa: N802 if self._defaults['close']['return'] != 0: @@ -1150,12 +1150,12 @@ def set_side_effects_and_return_values(self, mock_library): mock_library.niFake_Use64BitNumber.return_value = 0 mock_library.niFake_WriteWaveform.side_effect = MockFunctionCallError("niFake_WriteWaveform") mock_library.niFake_WriteWaveform.return_value = 0 - mock_library.niFake_WriteWaveformComplexF32.side_effect = MockFunctionCallError("niFake_WriteWaveformComplexF32") - mock_library.niFake_WriteWaveformComplexF32.return_value = 0 - mock_library.niFake_WriteWaveformComplexF64.side_effect = MockFunctionCallError("niFake_WriteWaveformComplexF64") - mock_library.niFake_WriteWaveformComplexF64.return_value = 0 - mock_library.niFake_WriteWaveformNumpyComplexI16.side_effect = MockFunctionCallError("niFake_WriteWaveformNumpyComplexI16") - mock_library.niFake_WriteWaveformNumpyComplexI16.return_value = 0 + mock_library.niFake_WriteWaveformNumpyComplex128.side_effect = MockFunctionCallError("niFake_WriteWaveformNumpyComplex128") + mock_library.niFake_WriteWaveformNumpyComplex128.return_value = 0 + mock_library.niFake_WriteWaveformNumpyComplex64.side_effect = MockFunctionCallError("niFake_WriteWaveformNumpyComplex64") + mock_library.niFake_WriteWaveformNumpyComplex64.return_value = 0 + mock_library.niFake_WriteWaveformNumpyComplexInterleavedI16.side_effect = MockFunctionCallError("niFake_WriteWaveformNumpyComplexInterleavedI16") + mock_library.niFake_WriteWaveformNumpyComplexInterleavedI16.return_value = 0 mock_library.niFake_close.side_effect = MockFunctionCallError("niFake_close") mock_library.niFake_close.return_value = 0 mock_library.niFake_error_message.side_effect = MockFunctionCallError("niFake_error_message") diff --git a/generated/nifake/nifake/unit_tests/test_library_interpreter.py b/generated/nifake/nifake/unit_tests/test_library_interpreter.py index 25b463b0a5..bf95421869 100644 --- a/generated/nifake/nifake/unit_tests/test_library_interpreter.py +++ b/generated/nifake/nifake/unit_tests/test_library_interpreter.py @@ -853,16 +853,35 @@ def test_write_waveform_numpy_complex128_valid_input(self): *[NIComplexNumber(real=0.707, imag=0.707) for _ in range(number_of_samples)] ) waveform_data_pointer = ctypes.cast(waveform_data_ctypes, ctypes.POINTER(NIComplexNumber)) - self.patched_library.niFake_WriteWaveformComplexF64.side_effect = self.side_effects_helper.niFake_WriteWaveformComplexF64 + self.patched_library.niFake_WriteWaveformNumpyComplex128.side_effect = self.side_effects_helper.niFake_WriteWaveformNumpyComplex128 interpreter = self.get_initialized_library_interpreter() - interpreter.write_waveform_complex_f64(waveform_data) - self.patched_library.niFake_WriteWaveformComplexF64.assert_called_once_with( + interpreter.write_waveform_numpy_complex128(waveform_data) + self.patched_library.niFake_WriteWaveformNumpyComplex128.assert_called_once_with( _matchers.ViSessionMatcher(SESSION_NUM_FOR_TEST), _matchers.ViInt32Matcher(number_of_samples), _matchers.NIComplexNumberPointerMatcher(waveform_data_pointer, number_of_samples) ) - def test_write_waveform_numpy_complexi16_valid_input(self): + def test_write_waveform_numpy_complex64_valid_input(self): + from nifake._complextype import NIComplexNumberF32 + + waveform_data = numpy.full(1000, 0.707 + 0.707j, dtype=numpy.complex64) + number_of_samples = len(waveform_data) + + waveform_data_ctypes = (NIComplexNumberF32 * number_of_samples)( + *[NIComplexNumberF32(real=0.707, imag=0.707) for _ in range(number_of_samples)] + ) + waveform_data_pointer = ctypes.cast(waveform_data_ctypes, ctypes.POINTER(NIComplexNumberF32)) + self.patched_library.niFake_WriteWaveformNumpyComplex64.side_effect = self.side_effects_helper.niFake_WriteWaveformNumpyComplex64 + interpreter = self.get_initialized_library_interpreter() + interpreter.write_waveform_numpy_complex64(waveform_data) + self.patched_library.niFake_WriteWaveformNumpyComplex64.assert_called_once_with( + _matchers.ViSessionMatcher(SESSION_NUM_FOR_TEST), + _matchers.ViInt32Matcher(number_of_samples), + _matchers.NIComplexNumberF32PointerMatcher(waveform_data_pointer, number_of_samples) + ) + + def test_write_waveform_numpy_complex_interleaved_i16_valid_input(self): from nifake._complextype import NIComplexI16 waveform_data = numpy.array([32767, 0] * 1000, dtype=numpy.int16) @@ -871,10 +890,10 @@ def test_write_waveform_numpy_complexi16_valid_input(self): *[NIComplexI16(real=32767, imag=0) for _ in range(number_of_samples)] ) waveform_data_pointer = ctypes.cast(waveform_data_ctypes, ctypes.POINTER(NIComplexI16)) - self.patched_library.niFake_WriteWaveformNumpyComplexI16.side_effect = self.side_effects_helper.niFake_WriteWaveformNumpyComplexI16 + self.patched_library.niFake_WriteWaveformNumpyComplexInterleavedI16.side_effect = self.side_effects_helper.niFake_WriteWaveformNumpyComplexInterleavedI16 interpreter = self.get_initialized_library_interpreter() - interpreter.write_waveform_numpy_complex_i16(waveform_data) - self.patched_library.niFake_WriteWaveformNumpyComplexI16.assert_called_once_with( + interpreter.write_waveform_numpy_complex_interleaved_i16(waveform_data) + self.patched_library.niFake_WriteWaveformNumpyComplexInterleavedI16.assert_called_once_with( _matchers.ViSessionMatcher(SESSION_NUM_FOR_TEST), _matchers.ViInt32Matcher(number_of_samples), _matchers.NIComplexI16PointerMatcher(waveform_data_pointer, number_of_samples) diff --git a/generated/nifake/nifake/unit_tests/test_session.py b/generated/nifake/nifake/unit_tests/test_session.py index e54720d28a..16af4e81a9 100644 --- a/generated/nifake/nifake/unit_tests/test_session.py +++ b/generated/nifake/nifake/unit_tests/test_session.py @@ -837,22 +837,31 @@ def test_return_timedeltas(self): assert returned_timedeltas == expected_timedeltas self.patched_library_interpreter.return_list_of_durations_in_seconds.assert_called_once_with(len(time_values)) - def test_session_write_waveform_complex_f32_invalid_dtype(self): + def test_session_write_waveform_numpy_complex64_invalid_dtype(self): invalid_waveform_data = numpy.full(10, 1.0 + 1.0j, dtype=numpy.complex128) expected_error_message = "waveform_data_array must be numpy.ndarray of dtype=complex64, is complex128" import pytest with nifake.Session('dev1') as session: with pytest.raises(TypeError) as exc_info: - session.write_waveform_complex_f32(invalid_waveform_data) + session.write_waveform_numpy_complex64(invalid_waveform_data) assert str(exc_info.value) == expected_error_message - def test_session_write_waveform_complex_i16_invalid_dtype(self): + def test_session_write_waveform_numpy_complex128_invalid_dtype(self): + invalid_waveform_data = numpy.full(10, 1.0 + 1.0j, dtype=numpy.complex64) + expected_error_message = "waveform_data_array must be numpy.ndarray of dtype=complex128, is complex64" + import pytest + with nifake.Session('dev1') as session: + with pytest.raises(TypeError) as exc_info: + session.write_waveform_numpy_complex128(invalid_waveform_data) + assert str(exc_info.value) == expected_error_message + + def test_session_write_waveform_numpy_complex_interleaved_i16_invalid_dtype(self): invalid_waveform_data = numpy.full(10, 1.0 + 1.0j, dtype=numpy.complex64) expected_error_message = "waveform_data_array must be numpy.ndarray of dtype=int16, is complex64" import pytest with nifake.Session('dev1') as session: with pytest.raises(TypeError) as exc_info: - session.write_waveform_numpy_complex_i16(invalid_waveform_data) + session.write_waveform_numpy_complex_interleaved_i16(invalid_waveform_data) assert str(exc_info.value) == expected_error_message diff --git a/src/nifake/metadata/functions.py b/src/nifake/metadata/functions.py index 18f94d156f..210bf444fb 100644 --- a/src/nifake/metadata/functions.py +++ b/src/nifake/metadata/functions.py @@ -2797,7 +2797,7 @@ ], 'returns': 'ViStatus' }, - 'WriteWaveformComplexF32': { + 'WriteWaveformNumpyComplex64': { 'codegen_method': 'public', 'documentation': { 'description': 'A function that writes a waveform of numpy complex64 numbers.' @@ -2852,7 +2852,7 @@ ], 'returns': 'ViStatus' }, - 'WriteWaveformComplexF64': { + 'WriteWaveformNumpyComplex128': { 'codegen_method': 'public', 'documentation': { 'description': 'A function that writes a waveform of numpy complex128 numbers' @@ -2907,7 +2907,7 @@ ], 'returns': 'ViStatus' }, - 'WriteWaveformNumpyComplexI16': { + 'WriteWaveformNumpyComplexInterleavedI16': { 'codegen_method': 'public', 'documentation': { 'description': 'A function that writes a waveform of numpy complex i16 numbers.' diff --git a/src/nifake/unit_tests/test_library_interpreter.py b/src/nifake/unit_tests/test_library_interpreter.py index 25b463b0a5..bf95421869 100644 --- a/src/nifake/unit_tests/test_library_interpreter.py +++ b/src/nifake/unit_tests/test_library_interpreter.py @@ -853,16 +853,35 @@ def test_write_waveform_numpy_complex128_valid_input(self): *[NIComplexNumber(real=0.707, imag=0.707) for _ in range(number_of_samples)] ) waveform_data_pointer = ctypes.cast(waveform_data_ctypes, ctypes.POINTER(NIComplexNumber)) - self.patched_library.niFake_WriteWaveformComplexF64.side_effect = self.side_effects_helper.niFake_WriteWaveformComplexF64 + self.patched_library.niFake_WriteWaveformNumpyComplex128.side_effect = self.side_effects_helper.niFake_WriteWaveformNumpyComplex128 interpreter = self.get_initialized_library_interpreter() - interpreter.write_waveform_complex_f64(waveform_data) - self.patched_library.niFake_WriteWaveformComplexF64.assert_called_once_with( + interpreter.write_waveform_numpy_complex128(waveform_data) + self.patched_library.niFake_WriteWaveformNumpyComplex128.assert_called_once_with( _matchers.ViSessionMatcher(SESSION_NUM_FOR_TEST), _matchers.ViInt32Matcher(number_of_samples), _matchers.NIComplexNumberPointerMatcher(waveform_data_pointer, number_of_samples) ) - def test_write_waveform_numpy_complexi16_valid_input(self): + def test_write_waveform_numpy_complex64_valid_input(self): + from nifake._complextype import NIComplexNumberF32 + + waveform_data = numpy.full(1000, 0.707 + 0.707j, dtype=numpy.complex64) + number_of_samples = len(waveform_data) + + waveform_data_ctypes = (NIComplexNumberF32 * number_of_samples)( + *[NIComplexNumberF32(real=0.707, imag=0.707) for _ in range(number_of_samples)] + ) + waveform_data_pointer = ctypes.cast(waveform_data_ctypes, ctypes.POINTER(NIComplexNumberF32)) + self.patched_library.niFake_WriteWaveformNumpyComplex64.side_effect = self.side_effects_helper.niFake_WriteWaveformNumpyComplex64 + interpreter = self.get_initialized_library_interpreter() + interpreter.write_waveform_numpy_complex64(waveform_data) + self.patched_library.niFake_WriteWaveformNumpyComplex64.assert_called_once_with( + _matchers.ViSessionMatcher(SESSION_NUM_FOR_TEST), + _matchers.ViInt32Matcher(number_of_samples), + _matchers.NIComplexNumberF32PointerMatcher(waveform_data_pointer, number_of_samples) + ) + + def test_write_waveform_numpy_complex_interleaved_i16_valid_input(self): from nifake._complextype import NIComplexI16 waveform_data = numpy.array([32767, 0] * 1000, dtype=numpy.int16) @@ -871,10 +890,10 @@ def test_write_waveform_numpy_complexi16_valid_input(self): *[NIComplexI16(real=32767, imag=0) for _ in range(number_of_samples)] ) waveform_data_pointer = ctypes.cast(waveform_data_ctypes, ctypes.POINTER(NIComplexI16)) - self.patched_library.niFake_WriteWaveformNumpyComplexI16.side_effect = self.side_effects_helper.niFake_WriteWaveformNumpyComplexI16 + self.patched_library.niFake_WriteWaveformNumpyComplexInterleavedI16.side_effect = self.side_effects_helper.niFake_WriteWaveformNumpyComplexInterleavedI16 interpreter = self.get_initialized_library_interpreter() - interpreter.write_waveform_numpy_complex_i16(waveform_data) - self.patched_library.niFake_WriteWaveformNumpyComplexI16.assert_called_once_with( + interpreter.write_waveform_numpy_complex_interleaved_i16(waveform_data) + self.patched_library.niFake_WriteWaveformNumpyComplexInterleavedI16.assert_called_once_with( _matchers.ViSessionMatcher(SESSION_NUM_FOR_TEST), _matchers.ViInt32Matcher(number_of_samples), _matchers.NIComplexI16PointerMatcher(waveform_data_pointer, number_of_samples) diff --git a/src/nifake/unit_tests/test_session.py b/src/nifake/unit_tests/test_session.py index e54720d28a..16af4e81a9 100644 --- a/src/nifake/unit_tests/test_session.py +++ b/src/nifake/unit_tests/test_session.py @@ -837,22 +837,31 @@ def test_return_timedeltas(self): assert returned_timedeltas == expected_timedeltas self.patched_library_interpreter.return_list_of_durations_in_seconds.assert_called_once_with(len(time_values)) - def test_session_write_waveform_complex_f32_invalid_dtype(self): + def test_session_write_waveform_numpy_complex64_invalid_dtype(self): invalid_waveform_data = numpy.full(10, 1.0 + 1.0j, dtype=numpy.complex128) expected_error_message = "waveform_data_array must be numpy.ndarray of dtype=complex64, is complex128" import pytest with nifake.Session('dev1') as session: with pytest.raises(TypeError) as exc_info: - session.write_waveform_complex_f32(invalid_waveform_data) + session.write_waveform_numpy_complex64(invalid_waveform_data) assert str(exc_info.value) == expected_error_message - def test_session_write_waveform_complex_i16_invalid_dtype(self): + def test_session_write_waveform_numpy_complex128_invalid_dtype(self): + invalid_waveform_data = numpy.full(10, 1.0 + 1.0j, dtype=numpy.complex64) + expected_error_message = "waveform_data_array must be numpy.ndarray of dtype=complex128, is complex64" + import pytest + with nifake.Session('dev1') as session: + with pytest.raises(TypeError) as exc_info: + session.write_waveform_numpy_complex128(invalid_waveform_data) + assert str(exc_info.value) == expected_error_message + + def test_session_write_waveform_numpy_complex_interleaved_i16_invalid_dtype(self): invalid_waveform_data = numpy.full(10, 1.0 + 1.0j, dtype=numpy.complex64) expected_error_message = "waveform_data_array must be numpy.ndarray of dtype=int16, is complex64" import pytest with nifake.Session('dev1') as session: with pytest.raises(TypeError) as exc_info: - session.write_waveform_numpy_complex_i16(invalid_waveform_data) + session.write_waveform_numpy_complex_interleaved_i16(invalid_waveform_data) assert str(exc_info.value) == expected_error_message From c1e19d2a66af704d4fa92d3e9dd3ffecf183e483 Mon Sep 17 00:00:00 2001 From: Rahul R Date: Wed, 2 Jul 2025 10:26:28 +0530 Subject: [PATCH 33/33] Updaing only necessary fields in COMPLEX_NUMBER_PARAMETERS --- build/helper/metadata_filters.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/build/helper/metadata_filters.py b/build/helper/metadata_filters.py index 9c1f6ee6a6..cceec8ffe7 100644 --- a/build/helper/metadata_filters.py +++ b/build/helper/metadata_filters.py @@ -310,13 +310,13 @@ 'skip_session_handle': True, 'skip_input_parameters': False, 'skip_output_parameters': False, - 'but_keep_output_numpy_array_parameters': True, - 'skip_size_parameter': True, + 'but_keep_output_numpy_array_parameters': False, + 'skip_size_parameter': False, 'reordered_for_default_values': False, - 'skip_repeated_capability_parameter': True, + 'skip_repeated_capability_parameter': False, 'skip_non_enum_parameter': False, 'skip_numpy_parameters': False, - 'skip_all_except_numpy_parameters': True, + 'skip_all_except_numpy_parameters': False, 'mechanism': 'any', 'python_api_list': True, 'skip_all_except_complex_type_parameters': True,