diff --git a/generated/nirfsg/nirfsg/_library_interpreter.py b/generated/nirfsg/nirfsg/_library_interpreter.py index 47563dfd8..3e7979627 100644 --- a/generated/nirfsg/nirfsg/_library_interpreter.py +++ b/generated/nirfsg/nirfsg/_library_interpreter.py @@ -240,14 +240,14 @@ def configure_software_start_trigger(self): # noqa: N802 errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) return - def create_deembedding_sparameter_table_array(self, port, table_name, frequencies, sparameter_table, sparameter_table_size, number_of_ports, sparameter_orientation): # noqa: N802 + def create_deembedding_sparameter_table_array(self, port, table_name, frequencies, sparameter_table, number_of_ports, sparameter_orientation): # noqa: N802 vi_ctype = _visatype.ViSession(self._vi) # case S110 port_ctype = ctypes.create_string_buffer(port.encode(self._encoding)) # case C020 table_name_ctype = ctypes.create_string_buffer(table_name.encode(self._encoding)) # case C020 frequencies_ctype = _get_ctypes_pointer_for_buffer(value=frequencies) # case B510 frequencies_size_ctype = _visatype.ViInt32(0 if frequencies is None else len(frequencies)) # case S160 sparameter_table_ctype = _get_ctypes_pointer_for_buffer(value=sparameter_table, library_type=_complextype.NIComplexNumber) # case B510 - sparameter_table_size_ctype = _visatype.ViInt32(sparameter_table_size) # case S150 + sparameter_table_size_ctype = _visatype.ViInt32(0 if sparameter_table is None else sparameter_table.size) # case S161 number_of_ports_ctype = _visatype.ViInt32(number_of_ports) # case S150 sparameter_orientation_ctype = _visatype.ViInt32(sparameter_orientation.value) # case S130 error_code = self._library.niRFSG_CreateDeembeddingSparameterTableArray(vi_ctype, port_ctype, table_name_ctype, frequencies_ctype, frequencies_size_ctype, sparameter_table_ctype, sparameter_table_size_ctype, number_of_ports_ctype, sparameter_orientation_ctype) diff --git a/generated/nirfsg/nirfsg/session.py b/generated/nirfsg/nirfsg/session.py index 77012abb2..ba1b46e7b 100644 --- a/generated/nirfsg/nirfsg/session.py +++ b/generated/nirfsg/nirfsg/session.py @@ -6167,7 +6167,7 @@ def configure_software_start_trigger(self): self._interpreter.configure_software_start_trigger() @ivi_synchronized - def _create_deembedding_sparameter_table_array(self, port, table_name, frequencies, sparameter_table, sparameter_table_size, number_of_ports, sparameter_orientation): + def _create_deembedding_sparameter_table_array(self, port, table_name, frequencies, sparameter_table, number_of_ports, sparameter_orientation): r'''_create_deembedding_sparameter_table_array Creates an s-parameter de-embedding table for the port from the input data. @@ -6225,7 +6225,7 @@ def _create_deembedding_sparameter_table_array(self, port, table_name, frequenci raise TypeError('sparameter_table must be numpy.ndarray of dtype=complex128, is ' + str(sparameter_table.dtype)) if sparameter_table.ndim != 3: raise TypeError('sparameter_table must be numpy.ndarray of dimension=3, is ' + str(sparameter_table.ndim)) - self._interpreter.create_deembedding_sparameter_table_array(port, table_name, frequencies, sparameter_table, sparameter_table_size, number_of_ports, sparameter_orientation) + self._interpreter.create_deembedding_sparameter_table_array(port, table_name, frequencies, sparameter_table, number_of_ports, sparameter_orientation) @ivi_synchronized def create_deembedding_sparameter_table_s2p_file(self, port, table_name, s2p_file_path, sparameter_orientation): @@ -6350,8 +6350,7 @@ def create_deembedding_sparameter_table_array(self, port, table_name, frequencie if frequencies.size == sparameter_table.shape[0]: if sparameter_table.shape[1] == sparameter_table.shape[2]: number_of_ports = sparameter_table.shape[1] - sparameter_table_size = sparameter_table.size - return self._create_deembedding_sparameter_table_array(port, table_name, frequencies, sparameter_table, sparameter_table_size, number_of_ports, sparameter_orientation) + return self._create_deembedding_sparameter_table_array(port, table_name, frequencies, sparameter_table, number_of_ports, sparameter_orientation) else: raise ValueError("Row and column count of sparameter table should be equal. Table row count is {} and column count is {}.".format(sparameter_table.shape[1], sparameter_table.shape[2])) else: diff --git a/src/nirfsg/metadata/functions.py b/src/nirfsg/metadata/functions.py index b1a9f66c4..c30d209fb 100644 --- a/src/nirfsg/metadata/functions.py +++ b/src/nirfsg/metadata/functions.py @@ -1055,6 +1055,10 @@ }, 'name': 'sparameterTable', 'numpy': True, + 'size': { + 'mechanism': 'len', + 'value': 'sparameterTableSize' + }, 'type': 'NIComplexNumber[]', 'use_in_python_api': True }, diff --git a/src/nirfsg/templates/session.py/create_deembedding_sparameter_table_array.py.mako b/src/nirfsg/templates/session.py/create_deembedding_sparameter_table_array.py.mako index b1dc85001..c062ed3b2 100644 --- a/src/nirfsg/templates/session.py/create_deembedding_sparameter_table_array.py.mako +++ b/src/nirfsg/templates/session.py/create_deembedding_sparameter_table_array.py.mako @@ -13,8 +13,7 @@ if frequencies.size == sparameter_table.shape[0]: if sparameter_table.shape[1] == sparameter_table.shape[2]: number_of_ports = sparameter_table.shape[1] - sparameter_table_size = sparameter_table.size - return self._create_deembedding_sparameter_table_array(port, table_name, frequencies, sparameter_table, sparameter_table_size, number_of_ports, sparameter_orientation) + return self._create_deembedding_sparameter_table_array(port, table_name, frequencies, sparameter_table, number_of_ports, sparameter_orientation) else: raise ValueError("Row and column count of sparameter table should be equal. Table row count is {} and column count is {}.".format(sparameter_table.shape[1], sparameter_table.shape[2])) else: