Skip to content

Commit d77892d

Browse files
committed
Update i16 functions
1 parent 59f87fc commit d77892d

File tree

10 files changed

+30
-30
lines changed

10 files changed

+30
-30
lines changed

generated/nifake/nifake/_grpc_stub_interpreter.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -495,7 +495,7 @@ def write_waveform_complex_f32(self, waveform_data_array): # noqa: N802
495495
def write_waveform_complex_f64(self, waveform_data_array): # noqa: N802
496496
raise NotImplementedError('numpy-specific methods are not supported over gRPC')
497497

498-
def write_waveform_complex_i16(self, waveform_data_array): # noqa: N802
498+
def write_waveform_numpy_complex_i16(self, waveform_data_array): # noqa: N802
499499
raise NotImplementedError('numpy-specific methods are not supported over gRPC')
500500

501501
def close(self): # noqa: N802

generated/nifake/nifake/_library.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ def __init__(self, ctypes_library):
9494
self.niFake_WriteWaveform_cfunc = None
9595
self.niFake_WriteWaveformComplexF32_cfunc = None
9696
self.niFake_WriteWaveformComplexF64_cfunc = None
97-
self.niFake_WriteWaveformComplexI16_cfunc = None
97+
self.niFake_WriteWaveformNumpyComplexI16_cfunc = None
9898
self.niFake_close_cfunc = None
9999
self.niFake_error_message_cfunc = None
100100
self.niFake_self_test_cfunc = None
@@ -658,13 +658,13 @@ def niFake_WriteWaveformComplexF64(self, vi, number_of_samples, waveform_data_ar
658658
self.niFake_WriteWaveformComplexF64_cfunc.restype = ViStatus # noqa: F405
659659
return self.niFake_WriteWaveformComplexF64_cfunc(vi, number_of_samples, waveform_data_array)
660660

661-
def niFake_WriteWaveformComplexI16(self, vi, number_of_samples, waveform_data_array): # noqa: N802
661+
def niFake_WriteWaveformNumpyComplexI16(self, vi, number_of_samples, waveform_data_array): # noqa: N802
662662
with self._func_lock:
663-
if self.niFake_WriteWaveformComplexI16_cfunc is None:
664-
self.niFake_WriteWaveformComplexI16_cfunc = self._get_library_function('niFake_WriteWaveformComplexI16')
665-
self.niFake_WriteWaveformComplexI16_cfunc.argtypes = [ViSession, ViInt32, ctypes.POINTER(NIComplexI16)] # noqa: F405
666-
self.niFake_WriteWaveformComplexI16_cfunc.restype = ViStatus # noqa: F405
667-
return self.niFake_WriteWaveformComplexI16_cfunc(vi, number_of_samples, waveform_data_array)
663+
if self.niFake_WriteWaveformNumpyComplexI16_cfunc is None:
664+
self.niFake_WriteWaveformNumpyComplexI16_cfunc = self._get_library_function('niFake_WriteWaveformNumpyComplexI16')
665+
self.niFake_WriteWaveformNumpyComplexI16_cfunc.argtypes = [ViSession, ViInt32, ctypes.POINTER(NIComplexI16)] # noqa: F405
666+
self.niFake_WriteWaveformNumpyComplexI16_cfunc.restype = ViStatus # noqa: F405
667+
return self.niFake_WriteWaveformNumpyComplexI16_cfunc(vi, number_of_samples, waveform_data_array)
668668

669669
def niFake_close(self, vi): # noqa: N802
670670
with self._func_lock:

generated/nifake/nifake/_library_interpreter.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -754,11 +754,11 @@ def write_waveform_complex_f64(self, waveform_data_array): # noqa: N802
754754
errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False)
755755
return
756756

757-
def write_waveform_complex_i16(self, waveform_data_array): # noqa: N802
757+
def write_waveform_numpy_complex_i16(self, waveform_data_array): # noqa: N802
758758
vi_ctype = _visatype.ViSession(self._vi) # case S110
759759
number_of_samples_ctype = _visatype.ViInt32(0 if waveform_data_array is None else len(waveform_data_array) // 2) # case S160
760760
waveform_data_array_ctype = _get_ctypes_pointer_for_buffer(value=waveform_data_array, library_type=_complextype.NIComplexI16) # case B510
761-
error_code = self._library.niFake_WriteWaveformComplexI16(vi_ctype, number_of_samples_ctype, waveform_data_array_ctype)
761+
error_code = self._library.niFake_WriteWaveformNumpyComplexI16(vi_ctype, number_of_samples_ctype, waveform_data_array_ctype)
762762
errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False)
763763
return
764764

generated/nifake/nifake/session.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1711,8 +1711,8 @@ def write_waveform_complex_f64(self, waveform_data_array):
17111711
self._interpreter.write_waveform_complex_f64(waveform_data_array)
17121712

17131713
@ivi_synchronized
1714-
def write_waveform_complex_i16(self, waveform_data_array):
1715-
r'''write_waveform_complex_i16
1714+
def write_waveform_numpy_complex_i16(self, waveform_data_array):
1715+
r'''write_waveform_numpy_complex_i16
17161716
17171717
A method that writes a waveform of i16 numbers.
17181718
@@ -1728,7 +1728,7 @@ def write_waveform_complex_i16(self, waveform_data_array):
17281728
raise TypeError('waveform_data_array must be in C-order')
17291729
if waveform_data_array.dtype is not numpy.dtype('int16'):
17301730
raise TypeError('waveform_data_array must be numpy.ndarray of dtype=int16, is ' + str(waveform_data_array.dtype))
1731-
self._interpreter.write_waveform_complex_i16(waveform_data_array)
1731+
self._interpreter.write_waveform_numpy_complex_i16(waveform_data_array)
17321732

17331733
def _close(self):
17341734
r'''_close

generated/nifake/nifake/unit_tests/_mock_helper.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -214,8 +214,8 @@ def __init__(self):
214214
self._defaults['WriteWaveformComplexF32']['return'] = 0
215215
self._defaults['WriteWaveformComplexF64'] = {}
216216
self._defaults['WriteWaveformComplexF64']['return'] = 0
217-
self._defaults['WriteWaveformComplexI16'] = {}
218-
self._defaults['WriteWaveformComplexI16']['return'] = 0
217+
self._defaults['WriteWaveformNumpyComplexI16'] = {}
218+
self._defaults['WriteWaveformNumpyComplexI16']['return'] = 0
219219
self._defaults['close'] = {}
220220
self._defaults['close']['return'] = 0
221221
self._defaults['error_message'] = {}
@@ -971,10 +971,10 @@ def niFake_WriteWaveformComplexF64(self, vi, number_of_samples, waveform_data_ar
971971
return self._defaults['WriteWaveformComplexF64']['return']
972972
return self._defaults['WriteWaveformComplexF64']['return']
973973

974-
def niFake_WriteWaveformComplexI16(self, vi, number_of_samples, waveform_data_array): # noqa: N802
975-
if self._defaults['WriteWaveformComplexI16']['return'] != 0:
976-
return self._defaults['WriteWaveformComplexI16']['return']
977-
return self._defaults['WriteWaveformComplexI16']['return']
974+
def niFake_WriteWaveformNumpyComplexI16(self, vi, number_of_samples, waveform_data_array): # noqa: N802
975+
if self._defaults['WriteWaveformNumpyComplexI16']['return'] != 0:
976+
return self._defaults['WriteWaveformNumpyComplexI16']['return']
977+
return self._defaults['WriteWaveformNumpyComplexI16']['return']
978978

979979
def niFake_close(self, vi): # noqa: N802
980980
if self._defaults['close']['return'] != 0:
@@ -1154,8 +1154,8 @@ def set_side_effects_and_return_values(self, mock_library):
11541154
mock_library.niFake_WriteWaveformComplexF32.return_value = 0
11551155
mock_library.niFake_WriteWaveformComplexF64.side_effect = MockFunctionCallError("niFake_WriteWaveformComplexF64")
11561156
mock_library.niFake_WriteWaveformComplexF64.return_value = 0
1157-
mock_library.niFake_WriteWaveformComplexI16.side_effect = MockFunctionCallError("niFake_WriteWaveformComplexI16")
1158-
mock_library.niFake_WriteWaveformComplexI16.return_value = 0
1157+
mock_library.niFake_WriteWaveformNumpyComplexI16.side_effect = MockFunctionCallError("niFake_WriteWaveformNumpyComplexI16")
1158+
mock_library.niFake_WriteWaveformNumpyComplexI16.return_value = 0
11591159
mock_library.niFake_close.side_effect = MockFunctionCallError("niFake_close")
11601160
mock_library.niFake_close.return_value = 0
11611161
mock_library.niFake_error_message.side_effect = MockFunctionCallError("niFake_error_message")

generated/nifake/nifake/unit_tests/test_library_interpreter.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -877,10 +877,10 @@ def test_write_waveform_complexi16_valid_input(self):
877877
*[NIComplexI16(real=32767, imag=0) for _ in range(number_of_samples)]
878878
)
879879
waveform_data_pointer = ctypes.cast(waveform_data_ctypes, ctypes.POINTER(NIComplexI16))
880-
self.patched_library.niFake_WriteWaveformComplexI16.side_effect = self.side_effects_helper.niFake_WriteWaveformComplexI16
880+
self.patched_library.niFake_WriteWaveformNumpyComplexI16.side_effect = self.side_effects_helper.niFake_WriteWaveformNumpyComplexI16
881881
interpreter = self.get_initialized_library_interpreter()
882-
interpreter.write_waveform_complex_i16(waveform_data)
883-
self.patched_library.niFake_WriteWaveformComplexI16.assert_called_once_with(
882+
interpreter.write_waveform_numpy_complex_i16(waveform_data)
883+
self.patched_library.niFake_WriteWaveformNumpyComplexI16.assert_called_once_with(
884884
_matchers.ViSessionMatcher(SESSION_NUM_FOR_TEST),
885885
_matchers.ViInt32Matcher(number_of_samples),
886886
_matchers.NIComplexI16PointerMatcher(waveform_data_pointer, number_of_samples)

generated/nifake/nifake/unit_tests/test_session.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -943,7 +943,7 @@ def test_session_write_waveform_complex_i16_invalid_dtype(self):
943943
import pytest
944944
with nifake.Session('dev1', grpc_options=nifake.GrpcSessionOptions(object(), '')) as session:
945945
with pytest.raises(TypeError) as exc_info:
946-
session.write_waveform_complex_i16(invalid_waveform_data)
946+
session.write_waveform_numpy_complex_i16(invalid_waveform_data)
947947
assert str(exc_info.value) == expected_error_message
948948

949949
# Attributes

src/nifake/metadata/functions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2907,7 +2907,7 @@
29072907
],
29082908
'returns': 'ViStatus'
29092909
},
2910-
'WriteWaveformComplexI16': {
2910+
'WriteWaveformNumpyComplexI16': {
29112911
'codegen_method': 'public',
29122912
'documentation': {
29132913
'description': 'A function that writes a waveform of i16 numbers.'

src/nifake/unit_tests/test_library_interpreter.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -877,10 +877,10 @@ def test_write_waveform_complexi16_valid_input(self):
877877
*[NIComplexI16(real=32767, imag=0) for _ in range(number_of_samples)]
878878
)
879879
waveform_data_pointer = ctypes.cast(waveform_data_ctypes, ctypes.POINTER(NIComplexI16))
880-
self.patched_library.niFake_WriteWaveformComplexI16.side_effect = self.side_effects_helper.niFake_WriteWaveformComplexI16
880+
self.patched_library.niFake_WriteWaveformNumpyComplexI16.side_effect = self.side_effects_helper.niFake_WriteWaveformNumpyComplexI16
881881
interpreter = self.get_initialized_library_interpreter()
882-
interpreter.write_waveform_complex_i16(waveform_data)
883-
self.patched_library.niFake_WriteWaveformComplexI16.assert_called_once_with(
882+
interpreter.write_waveform_numpy_complex_i16(waveform_data)
883+
self.patched_library.niFake_WriteWaveformNumpyComplexI16.assert_called_once_with(
884884
_matchers.ViSessionMatcher(SESSION_NUM_FOR_TEST),
885885
_matchers.ViInt32Matcher(number_of_samples),
886886
_matchers.NIComplexI16PointerMatcher(waveform_data_pointer, number_of_samples)

src/nifake/unit_tests/test_session.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -943,7 +943,7 @@ def test_session_write_waveform_complex_i16_invalid_dtype(self):
943943
import pytest
944944
with nifake.Session('dev1', grpc_options=nifake.GrpcSessionOptions(object(), '')) as session:
945945
with pytest.raises(TypeError) as exc_info:
946-
session.write_waveform_complex_i16(invalid_waveform_data)
946+
session.write_waveform_numpy_complex_i16(invalid_waveform_data)
947947
assert str(exc_info.value) == expected_error_message
948948

949949
# Attributes

0 commit comments

Comments
 (0)