labnode-async 1.1.0__tar.gz → 1.2.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {labnode_async-1.1.0 → labnode_async-1.2.0}/PKG-INFO +5 -1
- {labnode_async-1.1.0 → labnode_async-1.2.0}/README.md +4 -0
- {labnode_async-1.1.0 → labnode_async-1.2.0}/examples/pid.py +1 -1
- {labnode_async-1.1.0 → labnode_async-1.2.0}/labnode_async/_version.py +3 -3
- {labnode_async-1.1.0 → labnode_async-1.2.0}/labnode_async/labnode.py +10 -0
- {labnode_async-1.1.0 → labnode_async-1.2.0}/labnode_async/pid_controller.py +7 -0
- {labnode_async-1.1.0 → labnode_async-1.2.0}/labnode_async.egg-info/PKG-INFO +5 -1
- {labnode_async-1.1.0 → labnode_async-1.2.0}/labnode_async.egg-info/scm_version.json +2 -2
- {labnode_async-1.1.0 → labnode_async-1.2.0}/tests/test_pid_controller.py +2 -0
- {labnode_async-1.1.0 → labnode_async-1.2.0}/.github/dependabot.yml +0 -0
- {labnode_async-1.1.0 → labnode_async-1.2.0}/.github/workflows/code-coverage-comment.yml +0 -0
- {labnode_async-1.1.0 → labnode_async-1.2.0}/.github/workflows/code-coverage.yml +0 -0
- {labnode_async-1.1.0 → labnode_async-1.2.0}/.github/workflows/documentation.yml +0 -0
- {labnode_async-1.1.0 → labnode_async-1.2.0}/.github/workflows/pre-commit.yml +0 -0
- {labnode_async-1.1.0 → labnode_async-1.2.0}/.github/workflows/publish-pypi.yml +0 -0
- {labnode_async-1.1.0 → labnode_async-1.2.0}/.github/workflows/publish-test-pypi.yml +0 -0
- {labnode_async-1.1.0 → labnode_async-1.2.0}/.github/workflows/pylint.yml +0 -0
- {labnode_async-1.1.0 → labnode_async-1.2.0}/.github/workflows/tests.yml +0 -0
- {labnode_async-1.1.0 → labnode_async-1.2.0}/.github/workflows/zizmor.yml +0 -0
- {labnode_async-1.1.0 → labnode_async-1.2.0}/.github/zizmor.yml +0 -0
- {labnode_async-1.1.0 → labnode_async-1.2.0}/.gitignore +0 -0
- {labnode_async-1.1.0 → labnode_async-1.2.0}/.pre-commit-config.yaml +0 -0
- {labnode_async-1.1.0 → labnode_async-1.2.0}/LICENSE +0 -0
- {labnode_async-1.1.0 → labnode_async-1.2.0}/doc/Makefile +0 -0
- {labnode_async-1.1.0 → labnode_async-1.2.0}/doc/source/conf.py +0 -0
- {labnode_async-1.1.0 → labnode_async-1.2.0}/doc/source/examples.rst +0 -0
- {labnode_async-1.1.0 → labnode_async-1.2.0}/doc/source/index.rst +0 -0
- {labnode_async-1.1.0 → labnode_async-1.2.0}/doc/source/modules.rst +0 -0
- {labnode_async-1.1.0 → labnode_async-1.2.0}/doc/source/readme.rst +0 -0
- {labnode_async-1.1.0 → labnode_async-1.2.0}/examples/simple.py +0 -0
- {labnode_async-1.1.0 → labnode_async-1.2.0}/labnode_async/__init__.py +0 -0
- {labnode_async-1.1.0 → labnode_async-1.2.0}/labnode_async/connection.py +0 -0
- {labnode_async-1.1.0 → labnode_async-1.2.0}/labnode_async/device_factory.py +0 -0
- {labnode_async-1.1.0 → labnode_async-1.2.0}/labnode_async/devices.py +0 -0
- {labnode_async-1.1.0 → labnode_async-1.2.0}/labnode_async/errors.py +0 -0
- {labnode_async-1.1.0 → labnode_async-1.2.0}/labnode_async/ip_connection.py +0 -0
- {labnode_async-1.1.0 → labnode_async-1.2.0}/labnode_async/py.typed +0 -0
- {labnode_async-1.1.0 → labnode_async-1.2.0}/labnode_async/serial_connection.py +0 -0
- {labnode_async-1.1.0 → labnode_async-1.2.0}/labnode_async.egg-info/SOURCES.txt +0 -0
- {labnode_async-1.1.0 → labnode_async-1.2.0}/labnode_async.egg-info/dependency_links.txt +0 -0
- {labnode_async-1.1.0 → labnode_async-1.2.0}/labnode_async.egg-info/requires.txt +0 -0
- {labnode_async-1.1.0 → labnode_async-1.2.0}/labnode_async.egg-info/scm_file_list.json +0 -0
- {labnode_async-1.1.0 → labnode_async-1.2.0}/labnode_async.egg-info/top_level.txt +0 -0
- {labnode_async-1.1.0 → labnode_async-1.2.0}/pyproject.toml +0 -0
- {labnode_async-1.1.0 → labnode_async-1.2.0}/requirements-workflows.txt +0 -0
- {labnode_async-1.1.0 → labnode_async-1.2.0}/setup.cfg +0 -0
- {labnode_async-1.1.0 → labnode_async-1.2.0}/setup.py +0 -0
- {labnode_async-1.1.0 → labnode_async-1.2.0}/tests/__init__.py +0 -0
- {labnode_async-1.1.0 → labnode_async-1.2.0}/tests/fake_labnode.py +0 -0
- {labnode_async-1.1.0 → labnode_async-1.2.0}/tests/test_closing_the_transport.py +0 -0
- {labnode_async-1.1.0 → labnode_async-1.2.0}/tests/test_connecting.py +0 -0
- {labnode_async-1.1.0 → labnode_async-1.2.0}/tests/test_connection.py +0 -0
- {labnode_async-1.1.0 → labnode_async-1.2.0}/tests/test_context_manager.py +0 -0
- {labnode_async-1.1.0 → labnode_async-1.2.0}/tests/test_device_factory.py +0 -0
- {labnode_async-1.1.0 → labnode_async-1.2.0}/tests/test_invalid_replies.py +0 -0
- {labnode_async-1.1.0 → labnode_async-1.2.0}/tests/test_ip_connection.py +0 -0
- {labnode_async-1.1.0 → labnode_async-1.2.0}/tests/test_lost_connection.py +0 -0
- {labnode_async-1.1.0 → labnode_async-1.2.0}/tests/test_oversized_packet.py +0 -0
- {labnode_async-1.1.0 → labnode_async-1.2.0}/tests/test_pid_invalid_format.py +0 -0
- {labnode_async-1.1.0 → labnode_async-1.2.0}/tests/test_request_data.py +0 -0
- {labnode_async-1.1.0 → labnode_async-1.2.0}/tests/test_request_ids.py +0 -0
- {labnode_async-1.1.0 → labnode_async-1.2.0}/tests/test_serial_connection.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: labnode-async
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.2.0
|
|
4
4
|
Summary: Python3 AsyncIO Labnode driver
|
|
5
5
|
Author-email: Patrick Baus <patrick.baus@physik.tu-darmstadt.de>
|
|
6
6
|
License: GNU General Public License v3 (GPLv3)
|
|
@@ -93,6 +93,10 @@ async with IPConnection("192.168.0.2") as device:
|
|
|
93
93
|
...
|
|
94
94
|
```
|
|
95
95
|
|
|
96
|
+
Every device class names its type: `device_identifier()` returns the `DeviceIdentifier` reported by the Labnode, e.g.
|
|
97
|
+
`DeviceIdentifier.PID`, and `device_name()` a human-readable name, e.g. `"PID Controller"`. Both are class methods, so
|
|
98
|
+
they can be called on the class as well as on a device.
|
|
99
|
+
|
|
96
100
|
See [examples/](/examples/) for more working examples.
|
|
97
101
|
|
|
98
102
|
## Versioning
|
|
@@ -41,6 +41,10 @@ async with IPConnection("192.168.0.2") as device:
|
|
|
41
41
|
...
|
|
42
42
|
```
|
|
43
43
|
|
|
44
|
+
Every device class names its type: `device_identifier()` returns the `DeviceIdentifier` reported by the Labnode, e.g.
|
|
45
|
+
`DeviceIdentifier.PID`, and `device_name()` a human-readable name, e.g. `"PID Controller"`. Both are class methods, so
|
|
46
|
+
they can be called on the class as well as on a device.
|
|
47
|
+
|
|
44
48
|
See [examples/](/examples/) for more working examples.
|
|
45
49
|
|
|
46
50
|
## Versioning
|
|
@@ -78,7 +78,7 @@ async def main():
|
|
|
78
78
|
# await device.set_secondary_config(1)
|
|
79
79
|
|
|
80
80
|
# Test getters
|
|
81
|
-
print(f"Device Type: {device.device_identifier.name}")
|
|
81
|
+
print(f"Device Type: {device.device_name()} ({device.device_identifier().name})")
|
|
82
82
|
print(f"Controller API version: {'.'.join(map(str, device.api_version))}")
|
|
83
83
|
print(f"Controller hardware version: {'.'.join(map(str, await device.get_hardware_version()))}")
|
|
84
84
|
print(f"Controller software version: {'.'.join(map(str, await device.get_software_version()))}")
|
|
@@ -18,7 +18,7 @@ version_tuple: tuple[int | str, ...]
|
|
|
18
18
|
commit_id: str | None
|
|
19
19
|
__commit_id__: str | None
|
|
20
20
|
|
|
21
|
-
__version__ = version = '1.
|
|
22
|
-
__version_tuple__ = version_tuple = (1,
|
|
21
|
+
__version__ = version = '1.2.0'
|
|
22
|
+
__version_tuple__ = version_tuple = (1, 2, 0)
|
|
23
23
|
|
|
24
|
-
__commit_id__ = commit_id = '
|
|
24
|
+
__commit_id__ = commit_id = 'g39d32f6e4'
|
|
@@ -44,6 +44,16 @@ class Labnode(ABC):
|
|
|
44
44
|
The device identifier version of the device
|
|
45
45
|
"""
|
|
46
46
|
|
|
47
|
+
@classmethod
|
|
48
|
+
@abstractmethod
|
|
49
|
+
def device_name(cls) -> str:
|
|
50
|
+
"""
|
|
51
|
+
Returns
|
|
52
|
+
-------
|
|
53
|
+
str
|
|
54
|
+
The human-readable name of the device type, e.g. "PID Controller"
|
|
55
|
+
"""
|
|
56
|
+
|
|
47
57
|
@property
|
|
48
58
|
def api_version(self) -> tuple[int, int, int]:
|
|
49
59
|
"""
|
|
@@ -61,6 +61,7 @@ class PidController(Labnode): # pylint: disable=too-many-public-methods
|
|
|
61
61
|
"""
|
|
62
62
|
|
|
63
63
|
__DEVICE_IDENTIFIER = DeviceIdentifier.PID
|
|
64
|
+
__DEVICE_NAME = "PID Controller"
|
|
64
65
|
|
|
65
66
|
@classmethod
|
|
66
67
|
@override
|
|
@@ -68,6 +69,12 @@ class PidController(Labnode): # pylint: disable=too-many-public-methods
|
|
|
68
69
|
"""The device identifier used to identify the device type"""
|
|
69
70
|
return cls.__DEVICE_IDENTIFIER
|
|
70
71
|
|
|
72
|
+
@classmethod
|
|
73
|
+
@override
|
|
74
|
+
def device_name(cls) -> str:
|
|
75
|
+
"""The human-readable name of the device type"""
|
|
76
|
+
return cls.__DEVICE_NAME
|
|
77
|
+
|
|
71
78
|
_RAW_TO_UNIT: dict[PidFunctionID, Callable] = {
|
|
72
79
|
# We need to truncate to 100 %rH according to the datasheet.
|
|
73
80
|
# The datasheet is *wrong* about the conversion formula. Slightly wrong, but wrong nonetheless.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: labnode-async
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.2.0
|
|
4
4
|
Summary: Python3 AsyncIO Labnode driver
|
|
5
5
|
Author-email: Patrick Baus <patrick.baus@physik.tu-darmstadt.de>
|
|
6
6
|
License: GNU General Public License v3 (GPLv3)
|
|
@@ -93,6 +93,10 @@ async with IPConnection("192.168.0.2") as device:
|
|
|
93
93
|
...
|
|
94
94
|
```
|
|
95
95
|
|
|
96
|
+
Every device class names its type: `device_identifier()` returns the `DeviceIdentifier` reported by the Labnode, e.g.
|
|
97
|
+
`DeviceIdentifier.PID`, and `device_name()` a human-readable name, e.g. `"PID Controller"`. Both are class methods, so
|
|
98
|
+
they can be called on the class as well as on a device.
|
|
99
|
+
|
|
96
100
|
See [examples/](/examples/) for more working examples.
|
|
97
101
|
|
|
98
102
|
## Versioning
|
|
@@ -60,6 +60,8 @@ def test_properties() -> None:
|
|
|
60
60
|
connection = FakeConnection()
|
|
61
61
|
controller = PidController(connection, NEW_API) # type: ignore[arg-type]
|
|
62
62
|
assert PidController.device_identifier() is DeviceIdentifier.PID
|
|
63
|
+
assert PidController.device_name() == "PID Controller"
|
|
64
|
+
assert controller.device_name() == "PID Controller"
|
|
63
65
|
assert controller.api_version == NEW_API
|
|
64
66
|
assert controller.connection is connection # type: ignore[comparison-overlap]
|
|
65
67
|
assert str(controller) == "Labnode at FakeConnection"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|