66import numpy
77import platform
88import warnings
9- import sys
109from enum import Enum
1110from datetime import timezone
1211from hightime import datetime as ht_datetime
1312from hightime import timedelta as ht_timedelta
14- from typing import Any , Callable , List , Sequence , Tuple , TYPE_CHECKING , Union
13+ from typing import Any , TYPE_CHECKING
14+
15+ from collections .abc import Callable , Sequence
1516
1617from nidaqmx ._base_interpreter import BaseEventHandler , BaseInterpreter
1718from nidaqmx ._lib import lib_importer , ctypes_byte_str , c_bool32 , wrapped_ndpointer , TaskHandle
2324from nitypes .waveform import AnalogWaveform , DigitalWaveform , SampleIntervalMode , Timing , ExtendedPropertyDictionary
2425
2526if TYPE_CHECKING :
26- if sys .version_info >= (3 , 10 ):
27- from typing import TypeAlias
28- else :
29- from typing_extensions import TypeAlias
27+ from typing import TypeAlias
3028
3129_logger = logging .getLogger (__name__ )
3230_was_runtime_environment_set = None
@@ -2777,7 +2775,7 @@ def get_digital_power_up_states(self, device_name, channel_name):
27772775 state = []
27782776
27792777 args = [device_name ]
2780- argtypes : List [type ] = [ctypes_byte_str ]
2778+ argtypes : list [type ] = [ctypes_byte_str ]
27812779
27822780 for index in range (len (channel_name )):
27832781 state_element = ctypes .c_int32 ()
@@ -2803,7 +2801,7 @@ def get_digital_pull_up_pull_down_states(self, device_name, channel_name):
28032801 state = []
28042802
28052803 args = [device_name ]
2806- argtypes : List [type ] = [ctypes_byte_str ]
2804+ argtypes : list [type ] = [ctypes_byte_str ]
28072805
28082806 for index in range (len (channel_name )):
28092807 state_element = ctypes .c_int32 ()
@@ -5011,7 +5009,7 @@ def self_test_device(self, device_name):
50115009 def set_analog_power_up_states (
50125010 self , device_name , channel_names , state , channel_type ):
50135011 args = [device_name ]
5014- argtypes : List [type ] = [ctypes_byte_str ]
5012+ argtypes : list [type ] = [ctypes_byte_str ]
50155013
50165014 for index in range (len (channel_names )):
50175015
@@ -5204,7 +5202,7 @@ def set_digital_logic_family_power_up_state(
52045202
52055203 def set_digital_power_up_states (self , device_name , channel_names , state ):
52065204 args = [device_name ]
5207- argtypes : List [type ] = [ctypes_byte_str ]
5205+ argtypes : list [type ] = [ctypes_byte_str ]
52085206
52095207 for index in range (len (channel_names )):
52105208
@@ -5226,7 +5224,7 @@ def set_digital_power_up_states(self, device_name, channel_names, state):
52265224 def set_digital_pull_up_pull_down_states (
52275225 self , device_name , channel_names , state ):
52285226 args = [device_name ]
5229- argtypes : List [type ] = [ctypes_byte_str ]
5227+ argtypes : list [type ] = [ctypes_byte_str ]
52305228
52315229 for index in range (len (channel_names )):
52325230
@@ -6481,7 +6479,7 @@ def _internal_read_analog_waveform_ex(
64816479 properties : Sequence [ExtendedPropertyDictionary ] | None ,
64826480 t0_array : numpy .typing .NDArray [numpy .int64 ] | None ,
64836481 dt_array : numpy .typing .NDArray [numpy .int64 ] | None ,
6484- ) -> Tuple [
6482+ ) -> tuple [
64856483 int , # error code
64866484 int , # The number of samples per channel that were read
64876485 ]:
@@ -6535,7 +6533,7 @@ def _internal_read_analog_waveform_per_chan(
65356533 properties : Sequence [ExtendedPropertyDictionary ] | None ,
65366534 t0_array : numpy .typing .NDArray [numpy .int64 ] | None ,
65376535 dt_array : numpy .typing .NDArray [numpy .int64 ] | None ,
6538- ) -> Tuple [
6536+ ) -> tuple [
65396537 int , # error code
65406538 int , # The number of samples per channel that were read
65416539 ]:
@@ -6651,7 +6649,7 @@ def _invoke_callback(
66516649
66526650 def _set_waveform_timings (
66536651 self ,
6654- waveforms : Sequence [Union [ AnalogWaveform [numpy .float64 ], DigitalWaveform [numpy .uint8 ] ]],
6652+ waveforms : Sequence [AnalogWaveform [numpy .float64 ] | DigitalWaveform [numpy .uint8 ]],
66556653 t0_array : numpy .typing .NDArray [numpy .int64 ],
66566654 dt_array : numpy .typing .NDArray [numpy .int64 ]
66576655 ) -> None :
@@ -6835,7 +6833,7 @@ def _internal_read_digital_waveform(
68356833 t0_array : numpy .typing .NDArray [numpy .int64 ] | None ,
68366834 dt_array : numpy .typing .NDArray [numpy .int64 ] | None ,
68376835 bytes_per_chan_array : numpy .typing .NDArray [numpy .uint32 ] | None = None ,
6838- ) -> Tuple [
6836+ ) -> tuple [
68396837 int , # error code
68406838 int , # The number of samples per channel that were read
68416839 ]:
@@ -7049,7 +7047,7 @@ def _internal_write_analog_waveform_per_chan(
70497047 auto_start : bool ,
70507048 timeout : float ,
70517049 write_arrays : Sequence [numpy .typing .NDArray [numpy .float64 ]],
7052- ) -> Tuple [
7050+ ) -> tuple [
70537051 int , # error code
70547052 int , # The number of samples per channel that were written
70557053 ]:
@@ -7176,7 +7174,7 @@ def _internal_write_digital_waveform(
71767174 data_layout : int ,
71777175 write_array : numpy .typing .NDArray [numpy .uint8 ],
71787176 bytes_per_chan_array : numpy .typing .NDArray [numpy .uint32 ] | None = None ,
7179- ) -> Tuple [
7177+ ) -> tuple [
71807178 int , # error code
71817179 int , # The number of samples per channel that were written
71827180 ]:
0 commit comments