From d18123968806353ee2fc942e86570f8d1e58505b Mon Sep 17 00:00:00 2001 From: Joel Dixon <38357562+dixonjoel@users.noreply.github.com> Date: Thu, 21 Nov 2024 08:30:20 -0600 Subject: [PATCH] Update to latest ni-apis and generate stubs for new array.proto (#1022) * Update to latest ni-apis * Add generated stubs for array.proto --- .../stubs/ni/protobuf/types/array_pb2.py | 26 ++++++++ .../stubs/ni/protobuf/types/array_pb2.pyi | 61 +++++++++++++++++++ .../stubs/ni/protobuf/types/array_pb2_grpc.py | 4 ++ .../ni/protobuf/types/array_pb2_grpc.pyi | 19 ++++++ third_party/ni-apis | 2 +- 5 files changed, 111 insertions(+), 1 deletion(-) create mode 100644 packages/service/ni_measurement_plugin_sdk_service/_internal/stubs/ni/protobuf/types/array_pb2.py create mode 100644 packages/service/ni_measurement_plugin_sdk_service/_internal/stubs/ni/protobuf/types/array_pb2.pyi create mode 100644 packages/service/ni_measurement_plugin_sdk_service/_internal/stubs/ni/protobuf/types/array_pb2_grpc.py create mode 100644 packages/service/ni_measurement_plugin_sdk_service/_internal/stubs/ni/protobuf/types/array_pb2_grpc.pyi diff --git a/packages/service/ni_measurement_plugin_sdk_service/_internal/stubs/ni/protobuf/types/array_pb2.py b/packages/service/ni_measurement_plugin_sdk_service/_internal/stubs/ni/protobuf/types/array_pb2.py new file mode 100644 index 000000000..2e545568e --- /dev/null +++ b/packages/service/ni_measurement_plugin_sdk_service/_internal/stubs/ni/protobuf/types/array_pb2.py @@ -0,0 +1,26 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: ni/protobuf/types/array.proto +"""Generated protocol buffer code.""" +from google.protobuf.internal import builder as _builder +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1dni/protobuf/types/array.proto\x12\x11ni.protobuf.types\"<\n\rDouble2DArray\x12\x0c\n\x04rows\x18\x01 \x01(\x05\x12\x0f\n\x07\x63olumns\x18\x02 \x01(\x05\x12\x0c\n\x04\x64\x61ta\x18\x03 \x03(\x01\x42\x82\x01\n\x15\x63om.ni.protobuf.typesB\nArrayProtoP\x01Z\x05types\xa2\x02\x04NIPT\xaa\x02\"NationalInstruments.Protobuf.Types\xca\x02\x11NI\\PROTOBUF\\TYPES\xea\x02\x13NI::Protobuf::Typesb\x06proto3') + +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'ni.protobuf.types.array_pb2', globals()) +if _descriptor._USE_C_DESCRIPTORS == False: + + DESCRIPTOR._options = None + DESCRIPTOR._serialized_options = b'\n\025com.ni.protobuf.typesB\nArrayProtoP\001Z\005types\242\002\004NIPT\252\002\"NationalInstruments.Protobuf.Types\312\002\021NI\\PROTOBUF\\TYPES\352\002\023NI::Protobuf::Types' + _DOUBLE2DARRAY._serialized_start=52 + _DOUBLE2DARRAY._serialized_end=112 +# @@protoc_insertion_point(module_scope) diff --git a/packages/service/ni_measurement_plugin_sdk_service/_internal/stubs/ni/protobuf/types/array_pb2.pyi b/packages/service/ni_measurement_plugin_sdk_service/_internal/stubs/ni/protobuf/types/array_pb2.pyi new file mode 100644 index 000000000..145356499 --- /dev/null +++ b/packages/service/ni_measurement_plugin_sdk_service/_internal/stubs/ni/protobuf/types/array_pb2.pyi @@ -0,0 +1,61 @@ +""" +@generated by mypy-protobuf. Do not edit manually! +isort:skip_file +--------------------------------------------------------------------- +--------------------------------------------------------------------- +""" + +import builtins +import collections.abc +import google.protobuf.descriptor +import google.protobuf.internal.containers +import google.protobuf.message +import typing + +DESCRIPTOR: google.protobuf.descriptor.FileDescriptor + +@typing.final +class Double2DArray(google.protobuf.message.Message): + """--------------------------------------------------------------------- + Defines a 2D array of double values. The 2D array is stored as + a repeated double, a 1D array. It is stored in row major order. + + Example: + Repeated Double: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] + rows: 2 + columns: 5 + + 2D Representation: + 1 2 3 4 5 + 6 7 8 9 10 + + Indices: + (0,0) (0,1) (0,2) (0,3) (0,4) + (1,0) (1,1) (1,2) (1,3) (1,4) + + Remarks: + The length of the 'data' field must be equal to rows * columns. + If it is not, implementations should treat this state as invalid + and return INVALID_ARGUMENT status code if appropriate. + --------------------------------------------------------------------- + """ + + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + ROWS_FIELD_NUMBER: builtins.int + COLUMNS_FIELD_NUMBER: builtins.int + DATA_FIELD_NUMBER: builtins.int + rows: builtins.int + columns: builtins.int + @property + def data(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[builtins.float]: ... + def __init__( + self, + *, + rows: builtins.int = ..., + columns: builtins.int = ..., + data: collections.abc.Iterable[builtins.float] | None = ..., + ) -> None: ... + def ClearField(self, field_name: typing.Literal["columns", b"columns", "data", b"data", "rows", b"rows"]) -> None: ... + +global___Double2DArray = Double2DArray diff --git a/packages/service/ni_measurement_plugin_sdk_service/_internal/stubs/ni/protobuf/types/array_pb2_grpc.py b/packages/service/ni_measurement_plugin_sdk_service/_internal/stubs/ni/protobuf/types/array_pb2_grpc.py new file mode 100644 index 000000000..2daafffeb --- /dev/null +++ b/packages/service/ni_measurement_plugin_sdk_service/_internal/stubs/ni/protobuf/types/array_pb2_grpc.py @@ -0,0 +1,4 @@ +# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +"""Client and server classes corresponding to protobuf-defined services.""" +import grpc + diff --git a/packages/service/ni_measurement_plugin_sdk_service/_internal/stubs/ni/protobuf/types/array_pb2_grpc.pyi b/packages/service/ni_measurement_plugin_sdk_service/_internal/stubs/ni/protobuf/types/array_pb2_grpc.pyi new file mode 100644 index 000000000..8a5eee48d --- /dev/null +++ b/packages/service/ni_measurement_plugin_sdk_service/_internal/stubs/ni/protobuf/types/array_pb2_grpc.pyi @@ -0,0 +1,19 @@ +""" +@generated by mypy-protobuf. Do not edit manually! +isort:skip_file +--------------------------------------------------------------------- +--------------------------------------------------------------------- +""" + +import abc +import collections.abc +import grpc +import grpc.aio +import typing + +_T = typing.TypeVar("_T") + +class _MaybeAsyncIterator(collections.abc.AsyncIterator[_T], collections.abc.Iterator[_T], metaclass=abc.ABCMeta): ... + +class _ServicerContext(grpc.ServicerContext, grpc.aio.ServicerContext): # type: ignore[misc, type-arg] + ... diff --git a/third_party/ni-apis b/third_party/ni-apis index e279c0ae7..c00cd3c2e 160000 --- a/third_party/ni-apis +++ b/third_party/ni-apis @@ -1 +1 @@ -Subproject commit e279c0ae7a86dce9515e346886f2b54c6be07768 +Subproject commit c00cd3c2eec99133181c2dc750c872afebf0520a