Skip to content

Commit d6b3e37

Browse files
committed
fixes based on review comments
1 parent 9cf0aca commit d6b3e37

File tree

5 files changed

+19
-19
lines changed

5 files changed

+19
-19
lines changed

docs/nirfsg/class.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1232,7 +1232,7 @@ create_deembedding_sparameter_table_array
12321232

12331233
Creates an s-parameter de-embedding table for the port from the input data.
12341234

1235-
If you only create one table for a port, NI-RFSA automatically selects that table to de-embed the measurement.
1235+
If you only create one table for a port, NI-RFSG automatically selects that table to de-embed the measurement.
12361236

12371237
**Supported Devices** : PXIe-5830/5831/5832/5840/5841/5842/5860
12381238

generated/nirfsg/nirfsg/session.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7017,7 +7017,7 @@ def _create_deembedding_sparameter_table_array(self, port, table_name, frequenci
70177017

70187018
Creates an s-parameter de-embedding table for the port from the input data.
70197019

7020-
If you only create one table for a port, NI-RFSA automatically selects that table to de-embed the measurement.
7020+
If you only create one table for a port, NI-RFSG automatically selects that table to de-embed the measurement.
70217021

70227022
**Supported Devices** : PXIe-5830/5831/5832/5840/5841/5842/5860
70237023

@@ -7185,7 +7185,7 @@ def create_deembedding_sparameter_table_array(self, port, table_name, frequencie
71857185

71867186
Creates an s-parameter de-embedding table for the port from the input data.
71877187

7188-
If you only create one table for a port, NI-RFSA automatically selects that table to de-embed the measurement.
7188+
If you only create one table for a port, NI-RFSG automatically selects that table to de-embed the measurement.
71897189

71907190
**Supported Devices** : PXIe-5830/5831/5832/5840/5841/5842/5860
71917191

@@ -7224,11 +7224,11 @@ def create_deembedding_sparameter_table_array(self, port, table_name, frequencie
72247224
sparameter_table_size = sparameter_table.size
72257225
return self._create_deembedding_sparameter_table_array(port, table_name, frequencies, sparameter_table, sparameter_table_size, number_of_ports, sparameter_orientation)
72267226
else:
7227-
raise IndexError("Row and column count of sparameters table should be equal. Table row count is {} and column count is {}.".format(sparameter_table.shape[1], sparameter_table.shape[2]))
7227+
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]))
72287228
else:
7229-
raise IndexError("Frequencies count does not match the sparameter table count. Frequencies count is {} and s parameter table count is {}.".format(frequencies.size, sparameter_table.shape[0]))
7229+
raise ValueError("Frequencies count does not match the sparameter table count. Frequencies count is {} and sparameter table count is {}.".format(frequencies.size, sparameter_table.shape[0]))
72307230
else:
7231-
raise IndexError("Unsupported array dimension. Is {}, expected 3".format(sparameter_table.ndim))
7231+
raise ValueError("Unsupported array dimension. Is {}, expected 3".format(sparameter_table.ndim))
72327232
else:
72337233
raise TypeError("Unsupported datatype. Expected numpy array.")
72347234

src/nirfsg/metadata/functions.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -813,7 +813,7 @@
813813
'CreateDeembeddingSparameterTableArray': {
814814
'codegen_method': 'private',
815815
'documentation': {
816-
'description': '\nCreates an s-parameter de-embedding table for the port from the input data.\n \nIf you only create one table for a port, NI-RFSA automatically selects that table to de-embed the measurement.\n\n**Supported Devices** : PXIe-5830/5831/5832/5840/5841/5842/5860\n\n**Related Topics**\n\n`De-embedding Overview <https://www.ni.com/docs/en-US/bundle/pxie-5840/page/de-embedding-overview.html>`_'
816+
'description': '\nCreates an s-parameter de-embedding table for the port from the input data.\n\nIf you only create one table for a port, NI-RFSG automatically selects that table to de-embed the measurement.\n\n**Supported Devices** : PXIe-5830/5831/5832/5840/5841/5842/5860\n\n**Related Topics**\n\n`De-embedding Overview <https://www.ni.com/docs/en-US/bundle/pxie-5840/page/de-embedding-overview.html>`_'
817817
},
818818
'included_in_proto': True,
819819
'method_templates': [
@@ -945,7 +945,7 @@
945945
'FancyCreateDeembeddingSparameterTableArray': {
946946
'codegen_method': 'python-only',
947947
'documentation': {
948-
'description': '\nCreates an s-parameter de-embedding table for the port from the input data.\n \nIf you only create one table for a port, NI-RFSA automatically selects that table to de-embed the measurement.\n\n**Supported Devices** : PXIe-5830/5831/5832/5840/5841/5842/5860\n\n**Related Topics**\n\n`De-embedding Overview <https://www.ni.com/docs/en-US/bundle/pxie-5840/page/de-embedding-overview.html>`_'
948+
'description': '\nCreates an s-parameter de-embedding table for the port from the input data.\n\nIf you only create one table for a port, NI-RFSG automatically selects that table to de-embed the measurement.\n\n**Supported Devices** : PXIe-5830/5831/5832/5840/5841/5842/5860\n\n**Related Topics**\n\n`De-embedding Overview <https://www.ni.com/docs/en-US/bundle/pxie-5840/page/de-embedding-overview.html>`_'
949949
},
950950
'included_in_proto': True,
951951
'method_templates': [

src/nirfsg/system_tests/test_system_nirfsg.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -515,7 +515,7 @@ def test_send_software_edge_trigger(self, rfsg_device_session):
515515
rfsg_device_session.send_software_edge_trigger(nirfsg.SoftwareTriggerType.SCRIPT, 'scriptTrigger0')
516516

517517
@pytest.mark.skipif(sys.platform == "linux", reason="Function not supported on Linux OS")
518-
def test_deembedding_table_with_s2p_file(self, rfsg_device_session):
518+
def test_create_deembedding_sparameter_table_s2p_file(self, rfsg_device_session):
519519
rfsg_device_session.create_deembedding_sparameter_table_s2p_file('', 'myTable1', get_test_file_path('samples2pfile.s2p'), nirfsg.SparameterOrientation.PORT2_TOWARDS_DUT)
520520
rfsg_device_session.create_deembedding_sparameter_table_s2p_file('', 'myTable2', get_test_file_path('samples2pfile.s2p'), nirfsg.SparameterOrientation.PORT1_TOWARDS_DUT)
521521
rfsg_device_session.configure_deembedding_table_interpolation_linear('', 'myTable1', nirfsg.Format.MAGNITUDE_AND_PHASE)
@@ -537,7 +537,7 @@ def test_deembedding_table_with_s2p_file(self, rfsg_device_session):
537537
with rfsg_device_session.initiate():
538538
rfsg_device_session.check_generation_status()
539539

540-
def test_set_get_deembedding_table(self, rfsg_device_session):
540+
def test_set_get_deembedding_sparameters(self, rfsg_device_session):
541541
frequencies = np.array([1e9, 2e9, 3e9], dtype=np.float64)
542542
sparameter_tables = np.array([[[1 + 1j, 2 + 2j], [3 + 3j, 4 + 4j]], [[5 + 5j, 6 + 6j], [7 + 7j, 8 + 8j]], [[9 + 9j, 10 + 10j], [11 + 11j, 12 + 12j]]], dtype=np.complex128)
543543
expected_sparameter_table = np.array([[5 + 5j, 6 + 6j], [7 + 7j, 8 + 8j]], dtype=np.complex128)
@@ -547,25 +547,25 @@ def test_set_get_deembedding_table(self, rfsg_device_session):
547547
assert number_of_ports == 2
548548
assert returned_sparameter_table.all() == expected_sparameter_table.all()
549549

550-
def test_configure_deembedding_table_error_cases(self, rfsg_device_session):
550+
def test_create_deembedding_sparameter_table_array_error_cases(self, rfsg_device_session):
551551
frequencies = np.array([1e9, 2e9, 3e9], dtype=np.float64)
552552
wrong_number_of_tables = np.full((2, 2, 2), 2.0 + 0.0j, dtype=np.complex128)
553553
wrong_table_size = np.full((3, 2, 3), 2.0 + 0.0j, dtype=np.complex128)
554554
wrong_array_dimensions = np.full((3, 2), 2.0 + 0.0j, dtype=np.complex128)
555555
try:
556556
rfsg_device_session.create_deembedding_sparameter_table_array('', 'myTable1', frequencies, wrong_number_of_tables, nirfsg.SparameterOrientation.PORT2_TOWARDS_DUT)
557557
assert False
558-
except IndexError as e:
559-
assert str(e) == 'Frequencies count does not match the sparameter table count. Frequencies count is 3 and s parameter table count is 2.'
558+
except ValueError as e:
559+
assert str(e) == 'Frequencies count does not match the sparameter table count. Frequencies count is 3 and sparameter table count is 2.'
560560
try:
561561
rfsg_device_session.create_deembedding_sparameter_table_array('', 'myTable1', frequencies, wrong_table_size, nirfsg.SparameterOrientation.PORT2_TOWARDS_DUT)
562562
assert False
563-
except IndexError as e:
564-
assert str(e) == 'Row and column count of sparameters table should be equal. Table row count is 2 and column count is 3.'
563+
except ValueError as e:
564+
assert str(e) == 'Row and column count of sparameter table should be equal. Table row count is 2 and column count is 3.'
565565
try:
566566
rfsg_device_session.create_deembedding_sparameter_table_array('', 'myTable1', frequencies, wrong_array_dimensions, nirfsg.SparameterOrientation.PORT2_TOWARDS_DUT)
567567
assert False
568-
except IndexError as e:
568+
except ValueError as e:
569569
assert str(e) == 'Unsupported array dimension. Is 2, expected 3'
570570

571571
def test_read_and_download_waveform_from_file_tdms(self, rfsg_device_session):

src/nirfsg/templates/session.py/create_deembedding_sparameter_table_array.py.mako

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@
1616
sparameter_table_size = sparameter_table.size
1717
return self._create_deembedding_sparameter_table_array(port, table_name, frequencies, sparameter_table, sparameter_table_size, number_of_ports, sparameter_orientation)
1818
else:
19-
raise IndexError("Row and column count of sparameters table should be equal. Table row count is {} and column count is {}.".format(sparameter_table.shape[1], sparameter_table.shape[2]))
19+
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]))
2020
else:
21-
raise IndexError("Frequencies count does not match the sparameter table count. Frequencies count is {} and s parameter table count is {}.".format(frequencies.size, sparameter_table.shape[0]))
21+
raise ValueError("Frequencies count does not match the sparameter table count. Frequencies count is {} and sparameter table count is {}.".format(frequencies.size, sparameter_table.shape[0]))
2222
else:
23-
raise IndexError("Unsupported array dimension. Is {}, expected 3".format(sparameter_table.ndim))
23+
raise ValueError("Unsupported array dimension. Is {}, expected 3".format(sparameter_table.ndim))
2424
else:
2525
raise TypeError("Unsupported datatype. Expected numpy array.")

0 commit comments

Comments
 (0)