Skip to content

Commit d68b01a

Browse files
authored
Update niscope metadata for nimi-python 1.4.4 release (#1935)
* update niscope metadata * update niscope.proto * Enable cal time tests for TestGrpc * update fetch_array_measurement to utilize meas_wfm_size in GrpcStubInterpreter * Update system tests for meas_wfm_size change * rearrange niscope system tests in more sensible manner * Revert "Enable cal time tests for TestGrpc" This reverts commit f19782c. * Let GrpcStubInterpreter get _actual_meas_wfm_size without an extra grpc call * Update changelog with description of fetch_array_measurement change. * Delete unnecessary templates * Update wording for description of fix in CHANGELOG.md
1 parent a902d5e commit d68b01a

File tree

14 files changed

+310
-322
lines changed

14 files changed

+310
-322
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,8 @@ All notable changes to this project will be documented in this file.
9090
* ### `niscope` (NI-SCOPE)
9191
* #### Added
9292
* #### Changed
93+
* Fix [#1941](https://github.com/ni/nimi-python/issues/1941): When calling niscope.Session.fetch_array_measurement in a MeasurementLink measurement plugin, meas_wfm_size cannot be set.
94+
* Requires NI gRPC Device Server 2023 Q2 or later. Older versions do not support this parameter and return all available samples.
9395
* #### Removed
9496
* ### `niswitch` (NI-SWITCH)
9597
* #### Added

generated/niscope/niscope/_grpc_stub_interpreter.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ def fetch_into_numpy(self, channel_list, timeout, num_samples): # noqa: N802
252252
def fetch_array_measurement(self, channel_list, timeout, array_meas_function, measurement_waveform_size): # noqa: N802
253253
response = self._invoke(
254254
self._client.FetchArrayMeasurement,
255-
grpc_types.FetchArrayMeasurementRequest(vi=self._vi, channel_list=channel_list, timeout=timeout, array_meas_function_raw=array_meas_function.value),
255+
grpc_types.FetchArrayMeasurementRequest(vi=self._vi, channel_list=channel_list, timeout=timeout, array_meas_function_raw=array_meas_function.value, meas_wfm_size=measurement_waveform_size),
256256
)
257257
return response.meas_wfm, [waveform_info.WaveformInfo(x) for x in response.wfm_info]
258258

generated/niscope/niscope/niscope_pb2.py

Lines changed: 234 additions & 234 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

generated/niscope/niscope/session.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2221,12 +2221,10 @@ def fetch_array_measurement(self, array_meas_function, meas_wfm_size=None, relat
22212221
self._fetch_num_records = -1 if num_records is None else num_records
22222222
self._fetch_meas_num_samples = -1 if meas_num_samples is None else meas_num_samples
22232223

2224+
# For GrpcStubInterpreter, the server will automatically get _actual_meas_wfm_size, if needed.
22242225
if isinstance(self._interpreter, _library_interpreter.LibraryInterpreter):
22252226
if meas_wfm_size is None:
22262227
meas_wfm_size = self._actual_meas_wfm_size(array_meas_function)
2227-
else:
2228-
if meas_wfm_size is not None:
2229-
raise ValueError('The argument "meas_wfm_size" must be None when using gRPC.')
22302228

22312229
meas_wfm, wfm_info = self._fetch_array_measurement(array_meas_function, meas_wfm_size, timeout)
22322230

src/niscope/metadata/attributes.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# -*- coding: utf-8 -*-
2-
# This file is generated from NI-SCOPE API metadata version 23.0.0d95
2+
# This file is generated from NI-SCOPE API metadata version 23.1.0f21
33
attributes = {
44
1050005: {
55
'access': 'read-write',

src/niscope/metadata/config.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# -*- coding: utf-8 -*-
2-
# This file is generated from NI-SCOPE API metadata version 23.0.0d95
2+
# This file is generated from NI-SCOPE API metadata version 23.1.0f21
33
config = {
4-
'api_version': '23.0.0d95',
4+
'api_version': '23.1.0f21',
55
'c_function_prefix': 'niScope_',
66
'close_function': 'close',
77
'context_manager_name': {

src/niscope/metadata/enums.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# -*- coding: utf-8 -*-
2-
# This file is generated from NI-SCOPE API metadata version 23.0.0d95
2+
# This file is generated from NI-SCOPE API metadata version 23.1.0f21
33
enums = {
44
'5900AccessoryInAScopeSessionValues': {
55
'values': [
@@ -342,17 +342,17 @@
342342
},
343343
'AttributeRetrievalModes': {
344344
'values': [
345+
{
346+
'name': 'NISCOPE_VAL_ATTRIBUTE_RETRIEVAL_MODE_COERCED',
347+
'value': 0
348+
},
345349
{
346350
'name': 'NISCOPE_VAL_ATTRIBUTE_RETRIEVAL_MODE_DEFAULT',
347351
'value': 2
348352
},
349353
{
350354
'name': 'NISCOPE_VAL_ATTRIBUTE_RETRIEVAL_MODE_DESIRED',
351355
'value': 1
352-
},
353-
{
354-
'name': 'NISCOPE_VAL_ATTRIBUTE_RETRIEVAL_MODE_COERCED',
355-
'value': 0
356356
}
357357
]
358358
},
@@ -1020,15 +1020,15 @@
10201020
'name': 'NISCOPE_VAL_READY_FOR_REF_EVENT',
10211021
'value': 10
10221022
},
1023-
{
1024-
'name': 'NISCOPE_VAL_REF_CLOCK',
1025-
'value': 100
1026-
},
10271023
{
10281024
'name': 'NISCOPE_VAL_5V_OUT',
10291025
'python_name': 'FIVE_V_OUT',
10301026
'value': 13
10311027
},
1028+
{
1029+
'name': 'NISCOPE_VAL_REF_CLOCK',
1030+
'value': 100
1031+
},
10321032
{
10331033
'name': 'NISCOPE_VAL_SAMPLE_CLOCK',
10341034
'value': 101

src/niscope/metadata/functions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# -*- coding: utf-8 -*-
2-
# This file is generated from NI-SCOPE API metadata version 23.0.0d95
2+
# This file is generated from NI-SCOPE API metadata version 23.1.0f21
33
functions = {
44
'Abort': {
55
'documentation': {

src/niscope/metadata/functions_addon.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,17 @@
22
# Changes to the metadata should be made here, because functions.py is generated thus any changes get overwritten.
33

44
functions_override_metadata = {
5+
# TODO (ni-jfitzger): delete this override once functions.py lists "default_method" for library_interpreter_filename. See https://github.com/ni/nimi-python/issues/1938
6+
'FetchArrayMeasurement': {
7+
'method_templates': [
8+
{
9+
'documentation_filename': 'default_method',
10+
'library_interpreter_filename': 'default_method',
11+
'method_python_name_suffix': '',
12+
'session_filename': 'default_method'
13+
}
14+
]
15+
}
516
}
617

718
functions_additional_fetch_array_measurement = {

src/niscope/metadata/niscope.proto

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22
//---------------------------------------------------------------------
3-
// This file is generated from NI-SCOPE API metadata version 23.0.0d95
3+
// This file is generated from NI-SCOPE API metadata version 23.3.0d127
44
//---------------------------------------------------------------------
55
// Proto file for the NI-SCOPE Metadata
66
//---------------------------------------------------------------------
@@ -1439,6 +1439,7 @@ message FetchArrayMeasurementRequest {
14391439
ArrayMeasurement array_meas_function = 4;
14401440
sint32 array_meas_function_raw = 5;
14411441
}
1442+
optional sint32 meas_wfm_size = 6;
14421443
}
14431444

14441445
message FetchArrayMeasurementResponse {
@@ -1952,4 +1953,3 @@ message SetAttributeViStringRequest {
19521953
message SetAttributeViStringResponse {
19531954
int32 status = 1;
19541955
}
1955-

0 commit comments

Comments
 (0)