Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor system Submodules #549

Draft
wants to merge 13 commits into
base: master
Choose a base branch
from
12 changes: 5 additions & 7 deletions docs/collections.rst
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
nidaqmx.system.collections
==========================

.. toctree::

device_collection
persisted_channel_collection
persisted_scale_collection
persisted_task_collection
physical_channel_collection
.. automodule:: nidaqmx.system.collections
:members:
:show-inheritance:
:member-order: bysource

6 changes: 0 additions & 6 deletions docs/device_collection.rst

This file was deleted.

6 changes: 0 additions & 6 deletions docs/expiration_state.rst

This file was deleted.

6 changes: 0 additions & 6 deletions docs/expiration_states_collection.rst

This file was deleted.

7 changes: 0 additions & 7 deletions docs/persisted_channel.rst

This file was deleted.

6 changes: 0 additions & 6 deletions docs/persisted_channel_collection.rst

This file was deleted.

7 changes: 0 additions & 7 deletions docs/persisted_scale.rst

This file was deleted.

6 changes: 0 additions & 6 deletions docs/persisted_scale_collection.rst

This file was deleted.

7 changes: 0 additions & 7 deletions docs/persisted_task.rst

This file was deleted.

6 changes: 0 additions & 6 deletions docs/persisted_task_collection.rst

This file was deleted.

6 changes: 0 additions & 6 deletions docs/physical_channel_collection.rst

This file was deleted.

9 changes: 4 additions & 5 deletions docs/storage.rst
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
nidaqmx.system.storage
======================

.. toctree::

persisted_channel
persisted_scale
persisted_task
.. automodule:: nidaqmx.system.storage
:members:
:show-inheritance:
:member-order: bysource
7 changes: 1 addition & 6 deletions docs/watchdog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,4 @@ nidaqmx.system.watchdog
.. automodule:: nidaqmx.system.watchdog
:members:
:show-inheritance:
:special-members:

.. toctree::

expiration_state
expiration_states_collection
:member-order: bysource
2 changes: 0 additions & 2 deletions generated/nidaqmx/system/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,5 @@
DOResistorPowerUpState)
from nidaqmx.system.device import Device
from nidaqmx.system.physical_channel import PhysicalChannel
from nidaqmx.system.watchdog import (
WatchdogTask, AOExpirationState, COExpirationState, DOExpirationState)

__all__ = ['system', 'device', 'physical_channel', 'storage', 'watchdog']
Empty file.
Empty file.
12 changes: 12 additions & 0 deletions generated/nidaqmx/system/collections/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@

from nidaqmx.system.collections._device_collection import DeviceCollection
from nidaqmx.system.collections._persisted_channel_collection import PersistedChannelCollection
from nidaqmx.system.collections._persisted_scale_collection import PersistedScaleCollection
from nidaqmx.system.collections._persisted_task_collection import PersistedTaskCollection
from nidaqmx.system.collections._physical_channel_collection import (
PhysicalChannelCollection, AIPhysicalChannelCollection, AOPhysicalChannelCollection,
CIPhysicalChannelCollection, COPhysicalChannelCollection, DILinesCollection,
DOLinesCollection, DIPortsCollection, DOPortsCollection
)

__all__ = ['DeviceCollection', 'PersistedChannelCollection', 'PersistedScaleCollection', 'PersistedTaskCollection', 'PhysicalChannelCollection', 'AIPhysicalChannelCollection', 'AOPhysicalChannelCollection', 'CIPhysicalChannelCollection', 'COPhysicalChannelCollection', 'DILinesCollection', 'DOLinesCollection', 'DIPortsCollection', 'DOPortsCollection',]
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def __getitem__(self, index):
- slice: Range of the indexes/positions of global
channels in the collection.
Returns:
List[nidaqmx.system.storage.persisted_channel.PersistedChannel]:
List[nidaqmx.system.storage.PersistedChannel]:

Indicates the of global channels indexed.
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def __getitem__(self, index):
- slice: Range of the indexes/positions of custom scales
in the collection.
Returns:
List[nidaqmx.system.storage.persisted_scale.PersistedScale]:
List[nidaqmx.system.storage.PersistedScale]:

Indicates the subset of custom scales indexed.
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def __getitem__(self, index):
- slice: Range of the indexes/positions of saved tasks
in the collection.
Returns:
List[nidaqmx.system.storage.persisted_task.PersistedTask]:
List[nidaqmx.system.storage.PersistedTask]:

Indicates the subset of saved tasks indexed.
"""
Expand Down
18 changes: 9 additions & 9 deletions generated/nidaqmx/system/device.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from nidaqmx import utils
from nidaqmx._bitfield_utils import enum_bitfield_to_list
from nidaqmx.utils import unflatten_channel_string
from nidaqmx.system._collections.physical_channel_collection import (
from nidaqmx.system.collections._physical_channel_collection import (
AIPhysicalChannelCollection, AOPhysicalChannelCollection,
CIPhysicalChannelCollection, COPhysicalChannelCollection,
DILinesCollection, DIPortsCollection, DOLinesCollection, DOPortsCollection)
Expand Down Expand Up @@ -60,7 +60,7 @@ def name(self):
@property
def ai_physical_chans(self):
"""
List[nidaqmx.system._collections.PhysicalChannelCollection]:
List[nidaqmx.system.collections.PhysicalChannelCollection]:
Indicates a collection that contains all the analog input
physical channels available on the device.
"""
Expand All @@ -69,7 +69,7 @@ def ai_physical_chans(self):
@property
def ao_physical_chans(self):
"""
List[nidaqmx.system._collections.PhysicalChannelCollection]:
List[nidaqmx.system.collections.PhysicalChannelCollection]:
Indicates a collection that contains all the analog output
physical channels available on the device.
"""
Expand All @@ -78,7 +78,7 @@ def ao_physical_chans(self):
@property
def ci_physical_chans(self):
"""
List[nidaqmx.system._collections.PhysicalChannelCollection]:
List[nidaqmx.system.collections.PhysicalChannelCollection]:
Indicates a collection that contains all the counter input
physical channels available on the device.
"""
Expand All @@ -87,7 +87,7 @@ def ci_physical_chans(self):
@property
def co_physical_chans(self):
"""
List[nidaqmx.system._collections.PhysicalChannelCollection]:
List[nidaqmx.system.collections.PhysicalChannelCollection]:
Indicates a collection that contains all the counter output
physical channels available on the device.
"""
Expand All @@ -96,7 +96,7 @@ def co_physical_chans(self):
@property
def di_lines(self):
"""
List[nidaqmx.system._collections.PhysicalChannelCollection]:
List[nidaqmx.system.collections.PhysicalChannelCollection]:
Indicates a collection that contains all the digital input
lines available on the device.
"""
Expand All @@ -105,7 +105,7 @@ def di_lines(self):
@property
def di_ports(self):
"""
List[nidaqmx.system._collections.PhysicalChannelCollection]:
List[nidaqmx.system.collections.PhysicalChannelCollection]:
Indicates a collection that contains all the digital input
ports available on the device.
"""
Expand All @@ -114,7 +114,7 @@ def di_ports(self):
@property
def do_lines(self):
"""
List[nidaqmx.system._collections.PhysicalChannelCollection]:
List[nidaqmx.system.collections.PhysicalChannelCollection]:
Indicates a collection that contains all the digital output
lines available on the device.
"""
Expand All @@ -123,7 +123,7 @@ def do_lines(self):
@property
def do_ports(self):
"""
List[nidaqmx.system._collections.PhysicalChannelCollection]:
List[nidaqmx.system.collections.PhysicalChannelCollection]:
Indicates a collection that contains all the digital output
ports available on the device.
"""
Expand Down
2 changes: 1 addition & 1 deletion generated/nidaqmx/system/storage/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
from nidaqmx.system.storage.persisted_scale import PersistedScale
from nidaqmx.system.storage.persisted_task import PersistedTask

__all__ = ['persisted_channel', 'persisted_scale', 'persisted_task']
__all__ = ['PersistedChannel', 'PersistedScale', 'PersistedTask',]
16 changes: 8 additions & 8 deletions generated/nidaqmx/system/system.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
import numpy

from nidaqmx import utils
from nidaqmx.system._collections.device_collection import DeviceCollection
from nidaqmx.system._collections.persisted_channel_collection import (
from nidaqmx.system.collections._device_collection import DeviceCollection
from nidaqmx.system.collections._persisted_channel_collection import (
PersistedChannelCollection)
from nidaqmx.system._collections.persisted_scale_collection import (
from nidaqmx.system.collections._persisted_scale_collection import (
PersistedScaleCollection)
from nidaqmx.system._collections.persisted_task_collection import (
from nidaqmx.system.collections._persisted_task_collection import (
PersistedTaskCollection)
from nidaqmx.utils import flatten_channel_string, unflatten_channel_string
from nidaqmx.constants import (
Expand Down Expand Up @@ -63,7 +63,7 @@ def remote(grpc_options):
@property
def devices(self):
"""
nidaqmx.system._collections.DeviceCollection: Indicates the
nidaqmx.system.collections.DeviceCollection: Indicates the
collection of devices for this DAQmx system.
"""
return DeviceCollection(self._interpreter)
Expand Down Expand Up @@ -92,23 +92,23 @@ def driver_version(self):
@property
def global_channels(self):
"""
nidaqmx.system._collections.PersistedChannelCollection: Indicates
nidaqmx.system.collections.PersistedChannelCollection: Indicates
the collection of global channels for this DAQmx system.
"""
return PersistedChannelCollection(self._interpreter)

@property
def scales(self):
"""
nidaqmx.system._collections.PersistedScaleCollection: Indicates
nidaqmx.system.collections.PersistedScaleCollection: Indicates
the collection of custom scales for this DAQmx system.
"""
return PersistedScaleCollection(self._interpreter)

@property
def tasks(self):
"""
nidaqmx.system._collections.PersistedTaskCollection: Indicates
nidaqmx.system.collections.PersistedTaskCollection: Indicates
the collection of saved tasks for this DAQmx system.
"""
return PersistedTaskCollection(self._interpreter)
Expand Down
7 changes: 7 additions & 0 deletions generated/nidaqmx/system/watchdog/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@

from nidaqmx.system.watchdog._expiration_state import ExpirationState
from nidaqmx.system.watchdog._expiration_states_collection import ExpirationStatesCollection
from nidaqmx.system.watchdog._watchdog import (
WatchdogTask, AOExpirationState, COExpirationState, DOExpirationState)

__all__ = ['ExpirationState', 'ExpirationStatesCollection', 'WatchdogTask',]
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from nidaqmx.errors import DaqError
from nidaqmx.system._watchdog_modules.expiration_state import ExpirationState
from nidaqmx.system.watchdog._expiration_state import ExpirationState


class ExpirationStatesCollection:
Expand Down Expand Up @@ -31,7 +31,7 @@ def __getitem__(self, index):
index (str): Name of the physical channel of which the
expiration state to retrieve.
Returns:
nidaqmx.system._watchdog_modules.expiration_state.ExpirationState:
nidaqmx.system.watchdog.ExpirationState:

The object representing the indexed expiration state.
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@

from nidaqmx import utils
from nidaqmx.errors import DaqResourceWarning
from nidaqmx.system._watchdog_modules.expiration_state import ExpirationState
from nidaqmx.system._watchdog_modules.expiration_states_collection import (
from nidaqmx.system.watchdog._expiration_state import ExpirationState
from nidaqmx.system.watchdog._expiration_states_collection import (
ExpirationStatesCollection)
from nidaqmx.utils import flatten_channel_string
from nidaqmx.constants import (
Expand Down Expand Up @@ -79,7 +79,7 @@ def __exit__(self, type, value, traceback):
@property
def expiration_states(self):
"""
:class:`nidaqmx.system._watchdog_modules.expiration_states_collection.ExpirationStatesCollection`: Gets
:class:`nidaqmx.system.watchdog.ExpirationStatesCollection`: Gets
the collection of expiration states for this watchdog task.
"""
return self._expiration_states
Expand Down Expand Up @@ -233,7 +233,7 @@ def cfg_watchdog_ao_expir_states(self, expiration_states):
output_type (nidaqmx.constants.WatchdogAOExpirState):
Specifies the output type of the physical channel.
Returns:
List[nidaqmx.system._watchdog_modules.expiration_state.ExpirationState]:
List[nidaqmx.system.watchdog.ExpirationState]:

Indicates the list of objects representing the configured
expiration states.
Expand Down Expand Up @@ -267,7 +267,7 @@ def cfg_watchdog_co_expir_states(self, expiration_states):
expiration_state (nidaqmx.constants.WatchdogCOExpirState):
Specifies the value to set the channel to upon expiration.
Returns:
List[nidaqmx.system._watchdog_modules.expiration_state.ExpirationState]:
List[nidaqmx.system.watchdog.ExpirationState]:

Indicates the list of objects representing the configured
expiration states.
Expand Down Expand Up @@ -299,7 +299,7 @@ def cfg_watchdog_do_expir_states(self, expiration_states):
expiration_state (nidaqmx.constants.Level): Specifies the
value to set the channel to upon expiration.
Returns:
List[nidaqmx.system._watchdog_modules.expiration_state.ExpirationState]:
List[nidaqmx.system.watchdog.ExpirationState]:

Indicates the list of objects representing the configured
expiration states.
Expand Down
2 changes: 1 addition & 1 deletion generated/nidaqmx/task/_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ def add_global_channels(self, global_channels):
Adds global virtual channels from MAX to the given task.

Args:
global_channels (List[nidaqmx.system.storage.persisted_channel.PersistedChannel]):
global_channels (List[nidaqmx.system.storage.PersistedChannel]):
Specifies the channels to add to the task.

These channels must be valid channels available from MAX.
Expand Down
8 changes: 4 additions & 4 deletions src/codegen/metadata/script_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@
"templateFile": "task\\_out_stream.py.mako",
},
{
"relativeOutputPath": "system\\_watchdog_modules\\expiration_state.py",
"templateFile": "system\\_watchdog_modules\\expiration_state.py.mako",
"relativeOutputPath": "system\\watchdog\\_expiration_state.py",
"templateFile": "system\\watchdog\\_expiration_state.py.mako",
},
{
"relativeOutputPath": "system\\watchdog.py",
"templateFile": "system\\watchdog.py.mako",
"relativeOutputPath": "system\\watchdog\\_watchdog.py",
"templateFile": "system\\watchdog\\_watchdog.py.mako",
},
{
"relativeOutputPath": "task\\channels\\_ao_channel.py",
Expand Down
Loading
Loading