Skip to content

Commit ee4860e

Browse files
authored
nirfsg ext cal date time method name change and wait until settled parameter update (#2149)
* name and parameter fixes * corrected the api name in system tests * Rephrasing few changelog points
1 parent c79aaea commit ee4860e

File tree

5 files changed

+25
-18
lines changed

5 files changed

+25
-18
lines changed

CHANGELOG.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1693,11 +1693,14 @@
16931693
- Changed
16941694
- Fixed the return type of `get_all_script_names` and `get_all_named_waveform_names` to remove the size parameter and return a list of strings instead of a comma-separated string
16951695
- Changed the parameter name for waveform name from `name` to `waveform_name` in `clear_arb_waveform` and `select_arb_waveform` to be consistent with other waveform methods
1696-
- Changed the name of `get_self_calibration_last_date_and_time` to `get_self_cal_last_date_and_time` to be consistent with other MI drivers
1696+
- Changed the name of below methods to be consistent with other APIs in the repository
1697+
- `get_self_calibration_last_date_and_time` to `get_self_cal_last_date_and_time`
1698+
- `get_external_calibration_last_date_and_time` to `get_ext_cal_last_date_and_time`
16971699
- Added default value for `module` parameter in `get_self_cal_last_date_and_time` and `get_self_calibration_temperature` methods to align with documentation and allow duck-typing
1698-
- Updated `self_test` to not have any parameters, aligning with other MI drivers
1700+
- Updated `self_test` to not have any parameters, aligning with other APIs in the repository
16991701
- Changed `frequency_settling` property to be of type float instead of hightime.timedelta, since it can have multiple interpretation based on `frequency_settling_units` property value
1700-
- Changed `interpolation_delay` and `relative_delay` properties to be of type hightime.timedelta, so that it aligns with _delay_ attributes across all drivers
1702+
- Changed `interpolation_delay` and `relative_delay` properties to be of type hightime.timedelta, so that it aligns with _delay_ attributes across other APIs in the repository
1703+
- Updated `wait_until_settled` method to have `max_time_milliseconds` parameter as type hightime.timedelta with a default value of 10 seconds
17011704
- Changed `exported_ref_clock_rate` and `ref_clock_rate` properties to be of type float instead of enum, since the enums just represented raw float values
17021705
- Removed
17031706
- Methods and properties applicable only to hardware which are not supported anymore

docs/nirfsg/class.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1288,12 +1288,12 @@ get_error
12881288

12891289

12901290

1291-
get_external_calibration_last_date_and_time
1292-
-------------------------------------------
1291+
get_ext_cal_last_date_and_time
1292+
------------------------------
12931293

12941294
.. py:currentmodule:: nirfsg.Session
12951295

1296-
.. py:method:: get_external_calibration_last_date_and_time()
1296+
.. py:method:: get_ext_cal_last_date_and_time()
12971297

12981298
Returns the date and time of the last successful external calibration.
12991299

@@ -2492,7 +2492,7 @@ wait_until_settled
24922492

24932493
.. py:currentmodule:: nirfsg.Session
24942494

2495-
.. py:method:: wait_until_settled(max_time_milliseconds)
2495+
.. py:method:: wait_until_settled(max_time_milliseconds=hightime.timedelta(seconds=10.0))
24962496

24972497
Waits until the RF output signal has settled. This method is useful for devices that support changes while in the Generation state.
24982498

@@ -2516,7 +2516,7 @@ wait_until_settled
25162516

25172517

25182518

2519-
:type max_time_milliseconds: int
2519+
:type max_time_milliseconds: hightime.timedelta, datetime.timedelta, or int in milliseconds
25202520

25212521
write_arb_waveform
25222522
------------------

generated/nirfsg/nirfsg/session.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6501,8 +6501,8 @@ def _get_external_calibration_last_date_and_time(self):
65016501
return year, month, day, hour, minute, second
65026502

65036503
@ivi_synchronized
6504-
def get_external_calibration_last_date_and_time(self):
6505-
'''get_external_calibration_last_date_and_time
6504+
def get_ext_cal_last_date_and_time(self):
6505+
'''get_ext_cal_last_date_and_time
65066506

65076507
Returns the date and time of the last successful external calibration.
65086508

@@ -7119,7 +7119,7 @@ def set_arb_waveform_next_write_position(self, waveform_name, relative_to, offse
71197119
self._interpreter.set_arb_waveform_next_write_position(waveform_name, relative_to, offset)
71207120

71217121
@ivi_synchronized
7122-
def wait_until_settled(self, max_time_milliseconds):
7122+
def wait_until_settled(self, max_time_milliseconds=hightime.timedelta(seconds=10.0)):
71237123
r'''wait_until_settled
71247124

71257125
Waits until the RF output signal has settled. This method is useful for devices that support changes while in the Generation state.
@@ -7131,11 +7131,12 @@ def wait_until_settled(self, max_time_milliseconds):
71317131
**Supported Devices** : PXI-5610, PXIe-5611, PXIe-5644/5645/5646, PXI/PXIe-5650/5651/5652, PXIe-5653/5654/5654 with PXIe-5696, PXI-5670/5671, PXIe-5672/5673/5673E, PXIe-5820/5830/5831/5832/5840/5841/5842/5860
71327132

71337133
Args:
7134-
max_time_milliseconds (int): Specifies the maximum time the method waits for the output to settle. If the maximum time is exceeded, this method returns an error. The units are expressed in milliseconds.
7134+
max_time_milliseconds (hightime.timedelta, datetime.timedelta, or int in milliseconds): Specifies the maximum time the method waits for the output to settle. If the maximum time is exceeded, this method returns an error. The units are expressed in milliseconds.
71357135

71367136
**Default Value** : 10000
71377137

71387138
'''
7139+
max_time_milliseconds = _converters.convert_timedelta_to_milliseconds_int32(max_time_milliseconds)
71397140
self._interpreter.wait_until_settled(max_time_milliseconds)
71407141

71417142
@ivi_synchronized

src/nirfsg/metadata/functions.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2207,7 +2207,7 @@
22072207
'description': '\nReturns the date and time of the last successful external calibration.\n\nThe time returned is 24-hour (military) local time; for example, if the device was calibrated at 2:30PM, this function returns\n\n14 for the hours parameter and\n\n30 for the minutes parameter.\n\n**Supported Devices** : PXI-5610, PXIe-5611, PXIe-5644/5645/5646, PXI/PXIe-5650/5651/5652, PXIe-5653/5654/5654, PXI-5670/5671, PXIe-5672/5673/5673E, PXIe-5696, PXIe-5820/5830/5831/5832/5840/5841/5842/5860'
22082208
},
22092209
'included_in_proto': True,
2210-
'method_name_for_documentation': 'get_external_calibration_last_date_and_time',
2210+
'method_name_for_documentation': 'get_ext_cal_last_date_and_time',
22112211
'parameters': [
22122212
{
22132213
'direction': 'in',
@@ -2308,7 +2308,7 @@
23082308
'type': 'hightime.datetime'
23092309
}
23102310
],
2311-
'python_name': 'get_external_calibration_last_date_and_time',
2311+
'python_name': 'get_ext_cal_last_date_and_time',
23122312
'real_datetime_call': 'GetExternalCalibrationLastDateAndTime',
23132313
'returns': 'ViStatus'
23142314
},
@@ -4588,14 +4588,17 @@
45884588
'use_in_python_api': True
45894589
},
45904590
{
4591+
'default_value': 'hightime.timedelta(seconds=10.0)',
45914592
'direction': 'in',
45924593
'documentation': {
45934594
'description': 'Specifies the maximum time the function waits for the output to settle. If the maximum time is exceeded, this function returns an error. The units are expressed in milliseconds.\n\n**Default Value** : 10000'
45944595
},
45954596
'name': 'maxTimeMilliseconds',
4597+
'python_api_converter_name': 'convert_timedelta_to_milliseconds_int32',
45964598
'type': 'ViInt32',
4599+
'type_in_documentation': 'hightime.timedelta, datetime.timedelta, or int in milliseconds',
45974600
'use_array': False,
4598-
'use_in_python_api': True
4601+
'use_in_python_api': True
45994602
}
46004603
],
46014604
'returns': 'ViStatus'

src/nirfsg/system_tests/test_system_nirfsg.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,8 @@ def test_clear_self_calibrate_range(self, rfsg_device_session):
135135
rfsg_device_session.clear_self_calibrate_range()
136136

137137
@pytest.mark.skipif(use_simulated_session is True, reason="Bad date returned by driver for simulated device")
138-
def test_get_external_calibration_last_date_and_time(self, rfsg_device_session):
139-
dt = rfsg_device_session.get_external_calibration_last_date_and_time()
138+
def test_get_ext_cal_last_date_and_time(self, rfsg_device_session):
139+
dt = rfsg_device_session.get_ext_cal_last_date_and_time()
140140
assert isinstance(dt, hightime.datetime)
141141

142142
@pytest.mark.skipif(use_simulated_session is True, reason="Bad date returned by driver for simulated device")
@@ -580,7 +580,7 @@ def test_read_and_download_waveform_from_file_tdms(self, rfsg_device_session):
580580
def test_wait_until_settled(self, rfsg_device_session):
581581
rfsg_device_session.configure_rf(2e9, -5.0)
582582
with rfsg_device_session.initiate():
583-
rfsg_device_session.wait_until_settled(15000)
583+
rfsg_device_session.wait_until_settled()
584584

585585
def test_get_all_named_waveform_names(self, rfsg_device_session):
586586
rfsg_device_session.generation_mode = nirfsg.GenerationMode.ARB_WAVEFORM

0 commit comments

Comments
 (0)