Skip to content

Commit

Permalink
fix: resolve merge conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
Jotheeswaran-Nandagopal committed Sep 13, 2024
1 parent 78cfdcc commit 86618c6
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def test___measurement_plugin_client___measure___returns_output(
measurement_plugin_client_module: ModuleType,
) -> None:
test_measurement_client_type = getattr(measurement_plugin_client_module, "TestMeasurement")
output_type = getattr(measurement_plugin_client_module, "Output")
output_type = getattr(measurement_plugin_client_module, "Outputs")
expected_output = output_type(
float_out=0.05999999865889549,
double_array_out=[0.1, 0.2, 0.3],
Expand All @@ -40,7 +40,7 @@ def test___measurement_plugin_client___stream_measure___returns_output(
measurement_plugin_client_module: ModuleType,
) -> None:
test_measurement_client_type = getattr(measurement_plugin_client_module, "TestMeasurement")
output_type = getattr(measurement_plugin_client_module, "Output")
output_type = getattr(measurement_plugin_client_module, "Outputs")
expected_output = output_type(
float_out=0.05999999865889549,
double_array_out=[0.1, 0.2, 0.3],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def test___measurement_plugin_client___measure___returns_output(
measurement_plugin_client_module: ModuleType,
) -> None:
test_measurement_client_type = getattr(measurement_plugin_client_module, "TestMeasurement")
output_type = getattr(measurement_plugin_client_module, "Output")
output_type = getattr(measurement_plugin_client_module, "Outputs")
expected_output = output_type(
name="<Name>",
index=9,
Expand All @@ -34,7 +34,7 @@ def test___measurement_plugin_client___stream_measure___returns_output(
measurement_plugin_client_module: ModuleType,
) -> None:
test_measurement_client_type = getattr(measurement_plugin_client_module, "TestMeasurement")
output_type = getattr(measurement_plugin_client_module, "Output")
output_type = getattr(measurement_plugin_client_module, "Outputs")
measurement_plugin_client = test_measurement_client_type()

response_iterator = measurement_plugin_client.stream_measure()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Python Measurement Plug-In Client."""
"""Generated client API for the 'Non-Streaming Data Measurement (Py)' measurement plug-in."""

import logging
import threading
Expand Down Expand Up @@ -29,8 +29,8 @@
_V2_MEASUREMENT_SERVICE_INTERFACE = "ni.measurementlink.measurement.v2.MeasurementService"


class Output(NamedTuple):
"""Measurement result container."""
class Outputs(NamedTuple):
"""Outputs for the 'Non-Streaming Data Measurement (Py)' measurement plug-in."""

float_out: float
double_array_out: List[float]
Expand All @@ -46,7 +46,7 @@ class Output(NamedTuple):


class NonStreamingDataMeasurementClient:
"""Client to interact with the measurement plug-in."""
"""Client for the 'Non-Streaming Data Measurement (Py)' measurement plug-in."""

def __init__(
self,
Expand Down Expand Up @@ -369,7 +369,9 @@ def _create_measure_request(
configuration_parameters=serialized_configuration
)

def _deserialize_response(self, response: v2_measurement_service_pb2.MeasureResponse) -> Output:
def _deserialize_response(
self, response: v2_measurement_service_pb2.MeasureResponse
) -> Outputs:
if self._output_metadata:
result = [None] * max(self._output_metadata.keys())
else:
Expand All @@ -380,7 +382,7 @@ def _deserialize_response(self, response: v2_measurement_service_pb2.MeasureResp

for k, v in output_values.items():
result[k - 1] = v
return Output._make(result)
return Outputs._make(result)

def measure(
self,
Expand All @@ -394,11 +396,11 @@ def measure(
io_in: str = "resource",
io_array_in: List[str] = ["resource1", "resource2"],
integer_in: int = 10,
) -> Output:
"""Executes the Non-Streaming Data Measurement (Py).
) -> Outputs:
"""Perform a single measurement.
Returns:
Measurement output.
Measurement outputs.
"""
stream_measure_response = self.stream_measure(
float_in,
Expand Down Expand Up @@ -428,11 +430,11 @@ def stream_measure(
io_in: str = "resource",
io_array_in: List[str] = ["resource1", "resource2"],
integer_in: int = 10,
) -> Generator[Output, None, None]:
"""Executes the Non-Streaming Data Measurement (Py).
) -> Generator[Outputs, None, None]:
"""Perform a streaming measurement.
Returns:
Stream of measurement output.
Stream of measurement outputs.
"""
parameter_values = [
float_in,
Expand Down

0 comments on commit 86618c6

Please sign in to comment.