Skip to content

Commit 2e0e590

Browse files
authored
Refactor Task Internal Modules: Channels (#544)
* Refactor channels * update channels doc * update affected tests * minor codegen fix * fix lint error * update return type docs * minor edit * modify docs * update functions metadata * update metadata
1 parent 4d6b783 commit 2e0e590

File tree

69 files changed

+283
-338
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+283
-338
lines changed

docs/ai_channel.rst

Lines changed: 0 additions & 7 deletions
This file was deleted.

docs/ao_channel.rst

Lines changed: 0 additions & 7 deletions
This file was deleted.

docs/channel.rst

Lines changed: 0 additions & 15 deletions
This file was deleted.

docs/ci_channel.rst

Lines changed: 0 additions & 7 deletions
This file was deleted.

docs/co_channel.rst

Lines changed: 0 additions & 7 deletions
This file was deleted.

docs/di_channel.rst

Lines changed: 0 additions & 7 deletions
This file was deleted.

docs/do_channel.rst

Lines changed: 0 additions & 7 deletions
This file was deleted.

docs/task.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ nidaqmx.task
77

88
.. toctree::
99

10-
channel
10+
task_channels
1111
task_collections
1212
triggers

docs/task_channels.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
nidaqmx.task.channels
2+
=====================
3+
4+
.. automodule:: nidaqmx.task.channels
5+
:members:
6+
:show-inheritance:
7+
:member-order: bysource

generated/nidaqmx/_task_modules/channels/__init__.py

Lines changed: 0 additions & 11 deletions
This file was deleted.

generated/nidaqmx/task/_in_stream.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import numpy.typing
77
import deprecation
88

9-
from nidaqmx._task_modules.channels.channel import Channel
9+
from nidaqmx.task.channels import Channel
1010
from nidaqmx.utils import unflatten_channel_string
1111
from nidaqmx.constants import (
1212
AcquisitionType, LoggingMode, LoggingOperation, OverwriteMode,
@@ -154,9 +154,8 @@ def change_detect_overflowed(self):
154154
@property
155155
def channels_to_read(self):
156156
"""
157-
:class:`nidaqmx._task_modules.channels.channel.Channel`:
158-
Specifies a subset of channels in the task from which to
159-
read.
157+
:class:`nidaqmx.task.channels.Channel`: Specifies a subset of
158+
channels in the task from which to read.
160159
"""
161160

162161
val = self._interpreter.get_read_attribute_string(self._handle, 0x1823)

generated/nidaqmx/task/_task.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
import numpy
77
from nidaqmx import utils
8-
from nidaqmx._task_modules.channels.channel import Channel
8+
from nidaqmx.task.channels._channel import Channel
99
from nidaqmx.task._export_signals import ExportSignals
1010
from nidaqmx.task._in_stream import InStream
1111
from nidaqmx.task._timing import Timing
@@ -143,7 +143,7 @@ def name(self):
143143
@property
144144
def channels(self):
145145
"""
146-
:class:`nidaqmx._task_modules.channels.channel.Channel`: Specifies
146+
:class:`nidaqmx.task.channels.Channel`: Specifies
147147
a channel object that represents the entire list of virtual
148148
channels in this task.
149149
"""
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
2+
from nidaqmx.task.channels._channel import Channel
3+
from nidaqmx.task.channels._ai_channel import AIChannel
4+
from nidaqmx.task.channels._ao_channel import AOChannel
5+
from nidaqmx.task.channels._ci_channel import CIChannel
6+
from nidaqmx.task.channels._co_channel import COChannel
7+
from nidaqmx.task.channels._di_channel import DIChannel
8+
from nidaqmx.task.channels._do_channel import DOChannel
9+
10+
__all__ = ['Channel', 'AIChannel', 'AOChannel', 'CIChannel', 'COChannel', 'DIChannel', 'DOChannel',]

generated/nidaqmx/_task_modules/channels/ai_channel.py renamed to generated/nidaqmx/task/channels/_ai_channel.py

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import deprecation
55

66
from nidaqmx.scale import _ScaleAlternateConstructor
7-
from nidaqmx._task_modules.channels.channel import Channel
7+
from nidaqmx.task.channels._channel import Channel
88
from nidaqmx.utils import unflatten_channel_string
99
from nidaqmx.constants import (
1010
ACExcitWireMode, ADCTimingMode, AccelChargeSensitivityUnits,
@@ -3111,14 +3111,13 @@ def ai_term_cfg(self):
31113111
@property
31123112
def ai_thrmcpl_cjc_chan(self):
31133113
"""
3114-
:class:`nidaqmx._task_modules.channels.channel.Channel`:
3115-
Indicates the channel that acquires the temperature of the
3116-
cold junction if **ai_thrmcpl_cjc_src** is
3117-
**CJCSource1.SCANNABLE_CHANNEL**. If the channel is a
3118-
temperature channel, NI-DAQmx acquires the temperature in
3119-
the correct units. Other channel types, such as a resistance
3120-
channel with a custom sensor, must use a custom scale to
3121-
scale values to degrees Celsius.
3114+
:class:`nidaqmx.task.channels.Channel`: Indicates the channel
3115+
that acquires the temperature of the cold junction if
3116+
**ai_thrmcpl_cjc_src** is **CJCSource1.SCANNABLE_CHANNEL**.
3117+
If the channel is a temperature channel, NI-DAQmx acquires
3118+
the temperature in the correct units. Other channel types,
3119+
such as a resistance channel with a custom sensor, must use
3120+
a custom scale to scale values to degrees Celsius.
31223121
"""
31233122

31243123
val = self._interpreter.get_chan_attribute_string(self._handle, self._name, 0x1034)

generated/nidaqmx/_task_modules/channels/ao_channel.py renamed to generated/nidaqmx/task/channels/_ao_channel.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Do not edit this file; it was automatically generated.
22

33
from nidaqmx.scale import _ScaleAlternateConstructor
4-
from nidaqmx._task_modules.channels.channel import Channel
4+
from nidaqmx.task.channels._channel import Channel
55
from nidaqmx.constants import (
66
AOIdleOutputBehavior, CurrentUnits, DataTransferActiveTransferMode,
77
DigitalWidthUnits, FuncGenType, ModulationType,

generated/nidaqmx/_task_modules/channels/channel.py renamed to generated/nidaqmx/task/channels/_channel.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Do not edit this file; it was automatically generated.
22

3-
import nidaqmx._task_modules.channels # circular import: Channel._factory uses derived classes
3+
import nidaqmx.task.channels # circular import: Channel._factory uses derived classes
44
from nidaqmx.system.physical_channel import _PhysicalChannelAlternateConstructor
55
from nidaqmx.utils import flatten_channel_string, unflatten_channel_string
66
from nidaqmx.constants import (
@@ -93,7 +93,7 @@ def _factory(task_handle, virtual_or_physical_name, interpreter):
9393
or physical name of a channel.
9494
interpreter (BaseInterpreter): Specifies the interpreter instance.
9595
Returns:
96-
nidaqmx._task_modules.channels.channel.Channel:
96+
nidaqmx.task.channels.Channel:
9797
9898
Indicates an object that represents the specified channel.
9999
"""
@@ -102,22 +102,22 @@ def _factory(task_handle, virtual_or_physical_name, interpreter):
102102
channel_type = ChannelType(chan_type)
103103

104104
if channel_type == ChannelType.ANALOG_INPUT:
105-
return nidaqmx._task_modules.channels.AIChannel(
105+
return nidaqmx.task.channels.AIChannel(
106106
task_handle, virtual_or_physical_name, interpreter)
107107
elif channel_type == ChannelType.ANALOG_OUTPUT:
108-
return nidaqmx._task_modules.channels.AOChannel(
108+
return nidaqmx.task.channels.AOChannel(
109109
task_handle, virtual_or_physical_name, interpreter)
110110
elif channel_type == ChannelType.COUNTER_INPUT:
111-
return nidaqmx._task_modules.channels.CIChannel(
111+
return nidaqmx.task.channels.CIChannel(
112112
task_handle, virtual_or_physical_name, interpreter)
113113
elif channel_type == ChannelType.COUNTER_OUTPUT:
114-
return nidaqmx._task_modules.channels.COChannel(
114+
return nidaqmx.task.channels.COChannel(
115115
task_handle, virtual_or_physical_name, interpreter)
116116
elif channel_type == ChannelType.DIGITAL_INPUT:
117-
return nidaqmx._task_modules.channels.DIChannel(
117+
return nidaqmx.task.channels.DIChannel(
118118
task_handle, virtual_or_physical_name, interpreter)
119119
elif channel_type == ChannelType.DIGITAL_OUTPUT:
120-
return nidaqmx._task_modules.channels.DOChannel(
120+
return nidaqmx.task.channels.DOChannel(
121121
task_handle, virtual_or_physical_name, interpreter)
122122

123123
@property

generated/nidaqmx/_task_modules/channels/ci_channel.py renamed to generated/nidaqmx/task/channels/_ci_channel.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Do not edit this file; it was automatically generated.
22

33
from nidaqmx.scale import _ScaleAlternateConstructor
4-
from nidaqmx._task_modules.channels.channel import Channel
4+
from nidaqmx.task.channels._channel import Channel
55
from nidaqmx.constants import (
66
AngleUnits, AngularVelocityUnits, CountDirection, CounterFrequencyMethod,
77
DataTransferActiveTransferMode, DigitalWidthUnits, Edge, EncoderType,

generated/nidaqmx/_task_modules/channels/co_channel.py renamed to generated/nidaqmx/task/channels/_co_channel.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Do not edit this file; it was automatically generated.
22

3-
from nidaqmx._task_modules.channels.channel import Channel
3+
from nidaqmx.task.channels._channel import Channel
44
from nidaqmx.constants import (
55
ConstrainedGenMode, DataTransferActiveTransferMode, Edge, FrequencyUnits,
66
Level, OutputDataTransferCondition, TimeUnits, UsageTypeCO)

generated/nidaqmx/_task_modules/channels/di_channel.py renamed to generated/nidaqmx/task/channels/_di_channel.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Do not edit this file; it was automatically generated.
22

3-
from nidaqmx._task_modules.channels.channel import Channel
3+
from nidaqmx.task.channels._channel import Channel
44
from nidaqmx.constants import (
55
ActiveOrInactiveEdgeSelection, DataTransferActiveTransferMode,
66
InputDataTransferCondition, LogicFamily)

generated/nidaqmx/_task_modules/channels/do_channel.py renamed to generated/nidaqmx/task/channels/_do_channel.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Do not edit this file; it was automatically generated.
22

3-
from nidaqmx._task_modules.channels.channel import Channel
3+
from nidaqmx.task.channels._channel import Channel
44
from nidaqmx.constants import (
55
ActiveOrInactiveEdgeSelection, DataTransferActiveTransferMode,
66
DigitalDriveType, Level, LogicFamily, OutputDataTransferCondition)

0 commit comments

Comments
 (0)