Skip to content

Commit 6b14958

Browse files
authored
add slots to DAQmx-property-containing classes (#664)
* add slots to attribute-containing classes
1 parent d2e7efc commit 6b14958

38 files changed

+175
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ All notable changes to this project will be documented in this file.
2727
* ...
2828

2929
* ### Resolved Issues
30-
* ...
30+
* [656: Missing usage of slots in classes with DAQmx attributes](https://github.com/ni/nidaqmx-python/issues/656)
3131

3232
* ### Major Changes
3333
* Added support for mioDAQ configurable digital voltage.

generated/nidaqmx/system/_watchdog_modules/expiration_state.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ class ExpirationState:
1010
"""
1111
Represents a DAQmx Watchdog expiration state.
1212
"""
13+
__slots__ = ('_handle', '_physical_channel', '_interpreter')
14+
1315
def __init__(self, task_handle, physical_channel, interpreter):
1416
self._handle = task_handle
1517
self._physical_channel = physical_channel

generated/nidaqmx/system/system.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ class System:
3333
operations on DAQ hardware, and creates classes from which you can get
3434
information about the hardware.
3535
"""
36+
__slots__ = ('_interpreter')
3637

3738
def __init__(self, grpc_options=None):
3839
"""

generated/nidaqmx/system/watchdog.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ class WatchdogTask:
2121
"""
2222
Represents the watchdog configurations for a DAQmx task.
2323
"""
24+
__slots__ = ('_handle', '_close_on_exit', '_saved_name', '_interpreter', '_expiration_states', '__weakref__')
25+
2426
def __init__(self, device_name, task_name='', timeout=10, grpc_options=None):
2527
"""
2628
Creates and configures a task that controls the watchdog timer of a

generated/nidaqmx/task/_export_signals.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ class ExportSignals:
99
"""
1010
Represents the exported signal configurations for a DAQmx task.
1111
"""
12+
__slots__ = ('_handle', '_interpreter')
13+
1214
def __init__(self, task_handle, interpreter):
1315
self._handle = task_handle
1416
self._interpreter = interpreter

generated/nidaqmx/task/_in_stream.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ class InStream:
2222
used in conjunction with reader classes to read samples from an
2323
NI-DAQmx task.
2424
"""
25+
__slots__ = ('_task', '_handle', '_interpreter', '_timeout')
26+
2527
def __init__(self, task, interpreter):
2628
self._task = task
2729
self._handle = task._handle

generated/nidaqmx/task/_out_stream.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ class OutStream:
1212
used in conjunction with writer classes to write samples to an
1313
NI-DAQmx task.
1414
"""
15+
__slots__ = ('_task', '_handle', '_interpreter', '_auto_start', '_timeout')
16+
1517
def __init__(self, task, interpreter):
1618
self._task = task
1719
self._handle = task._handle

generated/nidaqmx/task/_task.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,10 @@ class Task:
5555
"""
5656
Represents a DAQmx Task.
5757
"""
58+
__slots__ = ('_handle', '_close_on_exit', '_saved_name', '_grpc_options', '_event_handlers', '_interpreter',
59+
'_ai_channels', '_ao_channels', '_ci_channels', '_co_channels', '_di_channels', '_do_channels',
60+
'_export_signals', '_in_stream', '_timing', '_triggers', '_out_stream', '_event_handler_lock',
61+
'__weakref__')
5862

5963
def __init__(self, new_task_name='', *, grpc_options=None):
6064
"""

generated/nidaqmx/task/_timing.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ class Timing:
1212
"""
1313
Represents the timing configurations for a DAQmx task.
1414
"""
15+
__slots__ = ('_handle', '_interpreter')
16+
1517
def __init__(self, task_handle, interpreter):
1618
self._handle = task_handle
1719
self._interpreter = interpreter

generated/nidaqmx/task/triggering/_arm_start_trigger.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ class ArmStartTrigger:
88
"""
99
Represents the arm start trigger configurations for a DAQmx task.
1010
"""
11+
__slots__ = ('_handle', '_interpreter')
12+
1113
def __init__(self, task_handle, interpreter):
1214
self._handle = task_handle
1315
self._interpreter = interpreter

0 commit comments

Comments
 (0)