From 224f030d179c4b8a5437c9d3b78f14db48cc9eca Mon Sep 17 00:00:00 2001 From: Chris Delpire Date: Fri, 22 Sep 2023 12:17:01 -0500 Subject: [PATCH 1/3] Replacing _SessionBase with Session in Output Voltaget Measurement example. Signed-off-by: Chris Delpire --- examples/output_voltage_measurement/measurement.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/output_voltage_measurement/measurement.py b/examples/output_voltage_measurement/measurement.py index ceb3f6c39..0c7edbe86 100644 --- a/examples/output_voltage_measurement/measurement.py +++ b/examples/output_voltage_measurement/measurement.py @@ -182,7 +182,7 @@ def _get_session_info_for_pin( def _wait_for_source_complete_event( measurement_service: nims.MeasurementService, - channels: nidcpower._SessionBase, + channels: nidcpower.Session, cancellation_event: threading.Event, ) -> None: deadline = time.time() + measurement_service.context.time_remaining From b4c026bcd5b3f159a2cd4fe3d5dd154e331df769 Mon Sep 17 00:00:00 2001 From: Chris Delpire Date: Fri, 22 Sep 2023 16:21:28 -0500 Subject: [PATCH 2/3] Switching back to _SessionBase and adding import statement to fix issue. --- examples/output_voltage_measurement/measurement.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/examples/output_voltage_measurement/measurement.py b/examples/output_voltage_measurement/measurement.py index 0c7edbe86..0e7c03391 100644 --- a/examples/output_voltage_measurement/measurement.py +++ b/examples/output_voltage_measurement/measurement.py @@ -1,5 +1,7 @@ """ Source DC voltage as input with an NI SMU and measure output using NI-VISA DMM.""" +from __future__ import annotations + import logging import pathlib import threading @@ -182,7 +184,7 @@ def _get_session_info_for_pin( def _wait_for_source_complete_event( measurement_service: nims.MeasurementService, - channels: nidcpower.Session, + channels: nidcpower._SessionBase, cancellation_event: threading.Event, ) -> None: deadline = time.time() + measurement_service.context.time_remaining From 5c236b3f2026c1a74d4c786bc7b6a6c8432bb44b Mon Sep 17 00:00:00 2001 From: Chris Delpire Date: Fri, 22 Sep 2023 16:47:32 -0500 Subject: [PATCH 3/3] importing nidcpower.session and fixing type hint. Signed-off-by: Chris Delpire --- examples/output_voltage_measurement/measurement.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/examples/output_voltage_measurement/measurement.py b/examples/output_voltage_measurement/measurement.py index 0e7c03391..5f410b1f3 100644 --- a/examples/output_voltage_measurement/measurement.py +++ b/examples/output_voltage_measurement/measurement.py @@ -1,7 +1,5 @@ """ Source DC voltage as input with an NI SMU and measure output using NI-VISA DMM.""" -from __future__ import annotations - import logging import pathlib import threading @@ -15,6 +13,7 @@ import grpc import hightime import nidcpower +import nidcpower.session import pyvisa from _constants import USE_SIMULATION from _helpers import ( @@ -184,7 +183,7 @@ def _get_session_info_for_pin( def _wait_for_source_complete_event( measurement_service: nims.MeasurementService, - channels: nidcpower._SessionBase, + channels: nidcpower.session._SessionBase, cancellation_event: threading.Event, ) -> None: deadline = time.time() + measurement_service.context.time_remaining