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.
Files changed (62) hide show
  1. {labnode_async-1.1.0 → labnode_async-1.2.0}/PKG-INFO +5 -1
  2. {labnode_async-1.1.0 → labnode_async-1.2.0}/README.md +4 -0
  3. {labnode_async-1.1.0 → labnode_async-1.2.0}/examples/pid.py +1 -1
  4. {labnode_async-1.1.0 → labnode_async-1.2.0}/labnode_async/_version.py +3 -3
  5. {labnode_async-1.1.0 → labnode_async-1.2.0}/labnode_async/labnode.py +10 -0
  6. {labnode_async-1.1.0 → labnode_async-1.2.0}/labnode_async/pid_controller.py +7 -0
  7. {labnode_async-1.1.0 → labnode_async-1.2.0}/labnode_async.egg-info/PKG-INFO +5 -1
  8. {labnode_async-1.1.0 → labnode_async-1.2.0}/labnode_async.egg-info/scm_version.json +2 -2
  9. {labnode_async-1.1.0 → labnode_async-1.2.0}/tests/test_pid_controller.py +2 -0
  10. {labnode_async-1.1.0 → labnode_async-1.2.0}/.github/dependabot.yml +0 -0
  11. {labnode_async-1.1.0 → labnode_async-1.2.0}/.github/workflows/code-coverage-comment.yml +0 -0
  12. {labnode_async-1.1.0 → labnode_async-1.2.0}/.github/workflows/code-coverage.yml +0 -0
  13. {labnode_async-1.1.0 → labnode_async-1.2.0}/.github/workflows/documentation.yml +0 -0
  14. {labnode_async-1.1.0 → labnode_async-1.2.0}/.github/workflows/pre-commit.yml +0 -0
  15. {labnode_async-1.1.0 → labnode_async-1.2.0}/.github/workflows/publish-pypi.yml +0 -0
  16. {labnode_async-1.1.0 → labnode_async-1.2.0}/.github/workflows/publish-test-pypi.yml +0 -0
  17. {labnode_async-1.1.0 → labnode_async-1.2.0}/.github/workflows/pylint.yml +0 -0
  18. {labnode_async-1.1.0 → labnode_async-1.2.0}/.github/workflows/tests.yml +0 -0
  19. {labnode_async-1.1.0 → labnode_async-1.2.0}/.github/workflows/zizmor.yml +0 -0
  20. {labnode_async-1.1.0 → labnode_async-1.2.0}/.github/zizmor.yml +0 -0
  21. {labnode_async-1.1.0 → labnode_async-1.2.0}/.gitignore +0 -0
  22. {labnode_async-1.1.0 → labnode_async-1.2.0}/.pre-commit-config.yaml +0 -0
  23. {labnode_async-1.1.0 → labnode_async-1.2.0}/LICENSE +0 -0
  24. {labnode_async-1.1.0 → labnode_async-1.2.0}/doc/Makefile +0 -0
  25. {labnode_async-1.1.0 → labnode_async-1.2.0}/doc/source/conf.py +0 -0
  26. {labnode_async-1.1.0 → labnode_async-1.2.0}/doc/source/examples.rst +0 -0
  27. {labnode_async-1.1.0 → labnode_async-1.2.0}/doc/source/index.rst +0 -0
  28. {labnode_async-1.1.0 → labnode_async-1.2.0}/doc/source/modules.rst +0 -0
  29. {labnode_async-1.1.0 → labnode_async-1.2.0}/doc/source/readme.rst +0 -0
  30. {labnode_async-1.1.0 → labnode_async-1.2.0}/examples/simple.py +0 -0
  31. {labnode_async-1.1.0 → labnode_async-1.2.0}/labnode_async/__init__.py +0 -0
  32. {labnode_async-1.1.0 → labnode_async-1.2.0}/labnode_async/connection.py +0 -0
  33. {labnode_async-1.1.0 → labnode_async-1.2.0}/labnode_async/device_factory.py +0 -0
  34. {labnode_async-1.1.0 → labnode_async-1.2.0}/labnode_async/devices.py +0 -0
  35. {labnode_async-1.1.0 → labnode_async-1.2.0}/labnode_async/errors.py +0 -0
  36. {labnode_async-1.1.0 → labnode_async-1.2.0}/labnode_async/ip_connection.py +0 -0
  37. {labnode_async-1.1.0 → labnode_async-1.2.0}/labnode_async/py.typed +0 -0
  38. {labnode_async-1.1.0 → labnode_async-1.2.0}/labnode_async/serial_connection.py +0 -0
  39. {labnode_async-1.1.0 → labnode_async-1.2.0}/labnode_async.egg-info/SOURCES.txt +0 -0
  40. {labnode_async-1.1.0 → labnode_async-1.2.0}/labnode_async.egg-info/dependency_links.txt +0 -0
  41. {labnode_async-1.1.0 → labnode_async-1.2.0}/labnode_async.egg-info/requires.txt +0 -0
  42. {labnode_async-1.1.0 → labnode_async-1.2.0}/labnode_async.egg-info/scm_file_list.json +0 -0
  43. {labnode_async-1.1.0 → labnode_async-1.2.0}/labnode_async.egg-info/top_level.txt +0 -0
  44. {labnode_async-1.1.0 → labnode_async-1.2.0}/pyproject.toml +0 -0
  45. {labnode_async-1.1.0 → labnode_async-1.2.0}/requirements-workflows.txt +0 -0
  46. {labnode_async-1.1.0 → labnode_async-1.2.0}/setup.cfg +0 -0
  47. {labnode_async-1.1.0 → labnode_async-1.2.0}/setup.py +0 -0
  48. {labnode_async-1.1.0 → labnode_async-1.2.0}/tests/__init__.py +0 -0
  49. {labnode_async-1.1.0 → labnode_async-1.2.0}/tests/fake_labnode.py +0 -0
  50. {labnode_async-1.1.0 → labnode_async-1.2.0}/tests/test_closing_the_transport.py +0 -0
  51. {labnode_async-1.1.0 → labnode_async-1.2.0}/tests/test_connecting.py +0 -0
  52. {labnode_async-1.1.0 → labnode_async-1.2.0}/tests/test_connection.py +0 -0
  53. {labnode_async-1.1.0 → labnode_async-1.2.0}/tests/test_context_manager.py +0 -0
  54. {labnode_async-1.1.0 → labnode_async-1.2.0}/tests/test_device_factory.py +0 -0
  55. {labnode_async-1.1.0 → labnode_async-1.2.0}/tests/test_invalid_replies.py +0 -0
  56. {labnode_async-1.1.0 → labnode_async-1.2.0}/tests/test_ip_connection.py +0 -0
  57. {labnode_async-1.1.0 → labnode_async-1.2.0}/tests/test_lost_connection.py +0 -0
  58. {labnode_async-1.1.0 → labnode_async-1.2.0}/tests/test_oversized_packet.py +0 -0
  59. {labnode_async-1.1.0 → labnode_async-1.2.0}/tests/test_pid_invalid_format.py +0 -0
  60. {labnode_async-1.1.0 → labnode_async-1.2.0}/tests/test_request_data.py +0 -0
  61. {labnode_async-1.1.0 → labnode_async-1.2.0}/tests/test_request_ids.py +0 -0
  62. {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.1.0
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.1.0'
22
- __version_tuple__ = version_tuple = (1, 1, 0)
21
+ __version__ = version = '1.2.0'
22
+ __version_tuple__ = version_tuple = (1, 2, 0)
23
23
 
24
- __commit_id__ = commit_id = 'g75a8a704b'
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.1.0
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
@@ -1,7 +1,7 @@
1
1
  {
2
- "tag": "1.1.0",
2
+ "tag": "1.2.0",
3
3
  "distance": 0,
4
- "node": "g75a8a704bb432afebb26a040e7b6a45183c3a6a8",
4
+ "node": "g39d32f6e404e77c1c5aeda357a12c8cd2cc5ea2d",
5
5
  "dirty": false,
6
6
  "branch": "HEAD",
7
7
  "node_date": "2026-12-05"
@@ -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