Skip to content

Commit f799e35

Browse files
corrected name of APIs and removed mismatched enum value
1 parent b2dc8c7 commit f799e35

File tree

8 files changed

+28
-35
lines changed

8 files changed

+28
-35
lines changed

build/helper/helper.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ def camelcase_to_snakecase(camelcase_string):
4242
'''Converts a camelCase string to lower_case_snake_case'''
4343
# https://stackoverflow.com/questions/1175208/elegant-python-function-to-convert-camelcase-to-snake-case
4444
s1 = re.sub('(.)([A-Z][a-z]+)', r'\1_\2', camelcase_string)
45-
return re.sub('([a-z0-9])([A-Z])', r'\1_\2', s1).lower()
45+
return re.sub('([a-z])([A-Z])', r'\1_\2', s1).lower()
4646

4747

4848
# TODO(marcoskirsch): not being used

docs/nirfsg/class.rst

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1113,12 +1113,12 @@ configure_output_enabled
11131113

11141114
:type output_enabled: bool
11151115

1116-
configure_p2_p_endpoint_fullness_start_trigger
1117-
----------------------------------------------
1116+
configure_p2p_endpoint_fullness_start_trigger
1117+
---------------------------------------------
11181118

11191119
.. py:currentmodule:: nirfsg.Session
11201120

1121-
.. py:method:: configure_p2_p_endpoint_fullness_start_trigger(p2p_endpoint_fullness_level)
1121+
.. py:method:: configure_p2p_endpoint_fullness_start_trigger(p2p_endpoint_fullness_level)
11221122

11231123
Configures the Start Trigger to detect peer-to-peer endpoint fullness.
11241124

@@ -1419,12 +1419,12 @@ configure_software_start_trigger
14191419

14201420

14211421

1422-
create_deembedding_sparameter_table_s2_p_file
1423-
---------------------------------------------
1422+
create_deembedding_sparameter_table_s2p_file
1423+
--------------------------------------------
14241424

14251425
.. py:currentmodule:: nirfsg.Session
14261426

1427-
.. py:method:: create_deembedding_sparameter_table_s2_p_file(port, table_name, s2p_file_path, sparameter_orientation)
1427+
.. py:method:: create_deembedding_sparameter_table_s2p_file(port, table_name, s2p_file_path, sparameter_orientation)
14281428

14291429
Creates an S-parameter de-embedding table for the port based on the specified S2P file.
14301430

@@ -3327,12 +3327,12 @@ wait_until_settled
33273327

33283328
:type max_time_milliseconds: int
33293329

3330-
write_p2_p_endpoint_i16
3331-
-----------------------
3330+
write_p2p_endpoint_i16
3331+
----------------------
33323332

33333333
.. py:currentmodule:: nirfsg.Session
33343334

3335-
.. py:method:: write_p2_p_endpoint_i16(stream_endpoint, number_of_samples, endpoint_data)
3335+
.. py:method:: write_p2p_endpoint_i16(stream_endpoint, number_of_samples, endpoint_data)
33363336

33373337
Writes an array of 16-bit integer data to the peer-to-peer endpoint.
33383338

@@ -3380,7 +3380,7 @@ write_p2_p_endpoint_i16
33803380

33813381

33823382

3383-
:type endpoint_data: list of int
3383+
:type endpoint_data: array.array("h")
33843384

33853385
write_script
33863386
------------

docs/nirfsg/enums.rst

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1318,10 +1318,6 @@ RFFilter
13181318

13191319

13201320

1321-
.. py:attribute:: RFFilter.CONFIGURATION_SETTLED_EVENT
1322-
1323-
1324-
13251321
.. py:attribute:: RFFilter.LO_FREQ_MOD_4000
13261322
13271323

generated/nirfsg/nirfsg/_library_interpreter.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ def configure_output_enabled(self, output_enabled): # noqa: N802
283283
errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False)
284284
return
285285

286-
def configure_p2_p_endpoint_fullness_start_trigger(self, p2p_endpoint_fullness_level): # noqa: N802
286+
def configure_p2p_endpoint_fullness_start_trigger(self, p2p_endpoint_fullness_level): # noqa: N802
287287
vi_ctype = _visatype.ViSession(self._vi) # case S110
288288
p2p_endpoint_fullness_level_ctype = _visatype.ViInt64(p2p_endpoint_fullness_level) # case S150
289289
error_code = self._library.niRFSG_ConfigureP2PEndpointFullnessStartTrigger(vi_ctype, p2p_endpoint_fullness_level_ctype)
@@ -340,7 +340,7 @@ def configure_software_start_trigger(self): # noqa: N802
340340
errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False)
341341
return
342342

343-
def create_deembedding_sparameter_table_s2_p_file(self, port, table_name, s2p_file_path, sparameter_orientation): # noqa: N802
343+
def create_deembedding_sparameter_table_s2p_file(self, port, table_name, s2p_file_path, sparameter_orientation): # noqa: N802
344344
vi_ctype = _visatype.ViSession(self._vi) # case S110
345345
port_ctype = ctypes.create_string_buffer(port.encode(self._encoding)) # case C020
346346
table_name_ctype = ctypes.create_string_buffer(table_name.encode(self._encoding)) # case C020
@@ -866,11 +866,12 @@ def wait_until_settled(self, max_time_milliseconds): # noqa: N802
866866
errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False)
867867
return
868868

869-
def write_p2_p_endpoint_i16(self, stream_endpoint, number_of_samples, endpoint_data): # noqa: N802
869+
def write_p2p_endpoint_i16(self, stream_endpoint, number_of_samples, endpoint_data): # noqa: N802
870870
vi_ctype = _visatype.ViSession(self._vi) # case S110
871871
stream_endpoint_ctype = ctypes.create_string_buffer(stream_endpoint.encode(self._encoding)) # case C020
872872
number_of_samples_ctype = _visatype.ViInt32(0 if endpoint_data is None else len(endpoint_data)) # case S160
873-
endpoint_data_ctype = _get_ctypes_pointer_for_buffer(value=endpoint_data, library_type=_visatype.ViInt16) # case B550
873+
endpoint_data_array = _convert_to_array(value=endpoint_data, array_type="h") # case B550
874+
endpoint_data_ctype = _get_ctypes_pointer_for_buffer(value=endpoint_data_array, library_type=_visatype.ViInt16) # case B550
874875
error_code = self._library.niRFSG_WriteP2PEndpointI16(vi_ctype, stream_endpoint_ctype, number_of_samples_ctype, endpoint_data_ctype)
875876
errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False)
876877
return

generated/nirfsg/nirfsg/enums.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -566,7 +566,6 @@ class RFFilter(Enum):
566566
r'''
567567
yet to be defined
568568
'''
569-
CONFIGURATION_SETTLED_EVENT = 7
570569
LO_FREQ_MOD_4000 = '1'
571570
r'''
572571
yet to be defined

generated/nirfsg/nirfsg/session.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7016,8 +7016,8 @@ def configure_output_enabled(self, output_enabled):
70167016
self._interpreter.configure_output_enabled(output_enabled)
70177017

70187018
@ivi_synchronized
7019-
def configure_p2_p_endpoint_fullness_start_trigger(self, p2p_endpoint_fullness_level):
7020-
r'''configure_p2_p_endpoint_fullness_start_trigger
7019+
def configure_p2p_endpoint_fullness_start_trigger(self, p2p_endpoint_fullness_level):
7020+
r'''configure_p2p_endpoint_fullness_start_trigger
70217021

70227022
Configures the Start Trigger to detect peer-to-peer endpoint fullness.
70237023

@@ -7038,7 +7038,7 @@ def configure_p2_p_endpoint_fullness_start_trigger(self, p2p_endpoint_fullness_l
70387038
p2p_endpoint_fullness_level (int): Specifies the quantity of data in the FIFO endpoint that asserts the trigger. Units are samples per channel. The default value is -1, which allows NI-RFSG to select the appropriate fullness value.
70397039

70407040
'''
7041-
self._interpreter.configure_p2_p_endpoint_fullness_start_trigger(p2p_endpoint_fullness_level)
7041+
self._interpreter.configure_p2p_endpoint_fullness_start_trigger(p2p_endpoint_fullness_level)
70427042

70437043
@ivi_synchronized
70447044
def configure_power_level_type(self, power_level_type):
@@ -7233,8 +7233,8 @@ def configure_software_start_trigger(self):
72337233
self._interpreter.configure_software_start_trigger()
72347234

72357235
@ivi_synchronized
7236-
def create_deembedding_sparameter_table_s2_p_file(self, port, table_name, s2p_file_path, sparameter_orientation):
7237-
r'''create_deembedding_sparameter_table_s2_p_file
7236+
def create_deembedding_sparameter_table_s2p_file(self, port, table_name, s2p_file_path, sparameter_orientation):
7237+
r'''create_deembedding_sparameter_table_s2p_file
72387238

72397239
Creates an S-parameter de-embedding table for the port based on the specified S2P file.
72407240

@@ -7268,7 +7268,7 @@ def create_deembedding_sparameter_table_s2_p_file(self, port, table_name, s2p_fi
72687268
'''
72697269
if type(sparameter_orientation) is not enums.SparameterOrientation:
72707270
raise TypeError('Parameter sparameter_orientation must be of type ' + str(enums.SparameterOrientation))
7271-
self._interpreter.create_deembedding_sparameter_table_s2_p_file(port, table_name, s2p_file_path, sparameter_orientation)
7271+
self._interpreter.create_deembedding_sparameter_table_s2p_file(port, table_name, s2p_file_path, sparameter_orientation)
72727272

72737273
@ivi_synchronized
72747274
def delete_all_deembedding_tables(self):
@@ -8234,8 +8234,8 @@ def wait_until_settled(self, max_time_milliseconds):
82348234
self._interpreter.wait_until_settled(max_time_milliseconds)
82358235

82368236
@ivi_synchronized
8237-
def write_p2_p_endpoint_i16(self, stream_endpoint, number_of_samples, endpoint_data):
8238-
r'''write_p2_p_endpoint_i16
8237+
def write_p2p_endpoint_i16(self, stream_endpoint, number_of_samples, endpoint_data):
8238+
r'''write_p2p_endpoint_i16
82398239

82408240
Writes an array of 16-bit integer data to the peer-to-peer endpoint.
82418241

@@ -8258,10 +8258,10 @@ def write_p2_p_endpoint_i16(self, stream_endpoint, number_of_samples, endpoint_d
82588258

82598259
number_of_samples (int): Specifies the number of samples to write into the endpoint FIFO.
82608260

8261-
endpoint_data (list of int): Specifies the array of data to write into the endpoint FIFO. The binary data is left-justified.
8261+
endpoint_data (array.array("h")): Specifies the array of data to write into the endpoint FIFO. The binary data is left-justified.
82628262

82638263
'''
8264-
self._interpreter.write_p2_p_endpoint_i16(stream_endpoint, number_of_samples, endpoint_data)
8264+
self._interpreter.write_p2p_endpoint_i16(stream_endpoint, number_of_samples, endpoint_data)
82658265

82668266
@ivi_synchronized
82678267
def write_script(self, script):

src/nirfsg/metadata/enums.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1176,10 +1176,6 @@
11761176
'name': 'NIRFSG_VAL_HI_FREQ_MOD',
11771177
'value': '0'
11781178
},
1179-
{
1180-
'name': 'NIRFSG_VAL_CONFIGURATION_SETTLED_EVENT',
1181-
'value': 7
1182-
},
11831179
{
11841180
'documentation': {
11851181
'description': 'yet to be defined'

src/nirfsg/metadata/functions.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5317,12 +5317,13 @@
53175317
'description': 'Specifies the array of data to write into the endpoint FIFO. The binary data is left-justified.'
53185318
},
53195319
'name': 'endpointData',
5320+
'numpy': True,
53205321
'size': {
53215322
'mechanism': 'passed-in',
53225323
'value': 'numberOfSamples'
53235324
},
53245325
'type': 'ViInt16[]',
5325-
'use_array': False,
5326+
'use_array': True,
53265327
'use_in_python_api': True
53275328
}
53285329
],

0 commit comments

Comments
 (0)