From 83ba729a23d0dddd9b23a6cba2bbbc0b8186b11a Mon Sep 17 00:00:00 2001 From: Daniel Kohler <11864045+ddkohler@users.noreply.github.com> Date: Sun, 16 Feb 2025 11:23:28 -0600 Subject: [PATCH 01/36] Update _is_sensor.py --- yaqd-core/yaqd_core/_is_sensor.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/yaqd-core/yaqd_core/_is_sensor.py b/yaqd-core/yaqd_core/_is_sensor.py index 1e050f9..f5f4971 100644 --- a/yaqd-core/yaqd_core/_is_sensor.py +++ b/yaqd-core/yaqd_core/_is_sensor.py @@ -5,7 +5,8 @@ import asyncio import pathlib -from typing import Any +from typing import Dict, Any, Union, Tuple, List +from __future__ import annotations import yaqd_core @@ -15,10 +16,10 @@ def __init__( self, name: str, config: dict[str, Any], config_filepath: pathlib.Path ): super().__init__(name, config, config_filepath) - self._measured: dict = dict() # values must be numbers or arrays - self._channel_names: list[str] = [] - self._channel_units: dict[str, str] = dict() - self._channel_shapes: dict[str, tuple[int, ...]] = dict() + self._measured: MeasureType = dict() # values must be numbers or arrays + self._channel_names: List[str] = [] + self._channel_units: Dict[str, str] = dict() + self._channel_shapes: Dict[str, Tuple[..., int]] = dict() self._measurement_id = 0 self._measured["measurement_id"] = self._measurement_id From 47459ae77de807dead4decb810c8a75291043cb5 Mon Sep 17 00:00:00 2001 From: Daniel Kohler <11864045+ddkohler@users.noreply.github.com> Date: Sun, 16 Feb 2025 11:26:11 -0600 Subject: [PATCH 02/36] Update _is_sensor.py --- yaqd-core/yaqd_core/_is_sensor.py | 1 - 1 file changed, 1 deletion(-) diff --git a/yaqd-core/yaqd_core/_is_sensor.py b/yaqd-core/yaqd_core/_is_sensor.py index f5f4971..e9446df 100644 --- a/yaqd-core/yaqd_core/_is_sensor.py +++ b/yaqd-core/yaqd_core/_is_sensor.py @@ -6,7 +6,6 @@ import asyncio import pathlib from typing import Dict, Any, Union, Tuple, List -from __future__ import annotations import yaqd_core From 5f726e5c07a8f1869172d5cea57615cca624ad41 Mon Sep 17 00:00:00 2001 From: Daniel Kohler <11864045+ddkohler@users.noreply.github.com> Date: Sun, 16 Feb 2025 11:26:59 -0600 Subject: [PATCH 03/36] Update _is_sensor.py --- yaqd-core/yaqd_core/_is_sensor.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yaqd-core/yaqd_core/_is_sensor.py b/yaqd-core/yaqd_core/_is_sensor.py index e9446df..6f21541 100644 --- a/yaqd-core/yaqd_core/_is_sensor.py +++ b/yaqd-core/yaqd_core/_is_sensor.py @@ -18,7 +18,7 @@ def __init__( self._measured: MeasureType = dict() # values must be numbers or arrays self._channel_names: List[str] = [] self._channel_units: Dict[str, str] = dict() - self._channel_shapes: Dict[str, Tuple[..., int]] = dict() + self._channel_shapes: Dict[str, Tuple[int, ...]] = dict() self._measurement_id = 0 self._measured["measurement_id"] = self._measurement_id From 192e7b10f8f57854d1141324798cf0a2bb28551f Mon Sep 17 00:00:00 2001 From: Daniel Kohler <11864045+ddkohler@users.noreply.github.com> Date: Sun, 16 Feb 2025 12:03:28 -0600 Subject: [PATCH 04/36] Update _is_sensor.py --- yaqd-core/yaqd_core/_is_sensor.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/yaqd-core/yaqd_core/_is_sensor.py b/yaqd-core/yaqd_core/_is_sensor.py index 6f21541..db4d9b5 100644 --- a/yaqd-core/yaqd_core/_is_sensor.py +++ b/yaqd-core/yaqd_core/_is_sensor.py @@ -5,7 +5,7 @@ import asyncio import pathlib -from typing import Dict, Any, Union, Tuple, List +from typing import Any import yaqd_core @@ -16,9 +16,9 @@ def __init__( ): super().__init__(name, config, config_filepath) self._measured: MeasureType = dict() # values must be numbers or arrays - self._channel_names: List[str] = [] - self._channel_units: Dict[str, str] = dict() - self._channel_shapes: Dict[str, Tuple[int, ...]] = dict() + self._channel_names: list[str] = [] + self._channel_units: dict[str, str] = dict() + self._channel_shapes: dict[str, tuple[int, ...]] = dict() self._measurement_id = 0 self._measured["measurement_id"] = self._measurement_id From ce21a957e29d8385fe4423160bd7705eca8a6e4a Mon Sep 17 00:00:00 2001 From: Daniel Kohler <11864045+ddkohler@users.noreply.github.com> Date: Sun, 16 Feb 2025 12:05:01 -0600 Subject: [PATCH 05/36] Update _is_sensor.py --- yaqd-core/yaqd_core/_is_sensor.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/yaqd-core/yaqd_core/_is_sensor.py b/yaqd-core/yaqd_core/_is_sensor.py index db4d9b5..ee70c25 100644 --- a/yaqd-core/yaqd_core/_is_sensor.py +++ b/yaqd-core/yaqd_core/_is_sensor.py @@ -9,6 +9,8 @@ import yaqd_core +MeasureType = dict[str, Union[float]] + class IsSensor(yaqd_core.IsDaemon): def __init__( From 575664a38cfec65f0dd8ddc3affd2755841686ba Mon Sep 17 00:00:00 2001 From: Daniel Kohler <11864045+ddkohler@users.noreply.github.com> Date: Sun, 16 Feb 2025 23:23:52 -0600 Subject: [PATCH 06/36] Update _is_sensor.py --- yaqd-core/yaqd_core/_is_sensor.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yaqd-core/yaqd_core/_is_sensor.py b/yaqd-core/yaqd_core/_is_sensor.py index ee70c25..e37a7a1 100644 --- a/yaqd-core/yaqd_core/_is_sensor.py +++ b/yaqd-core/yaqd_core/_is_sensor.py @@ -9,7 +9,7 @@ import yaqd_core -MeasureType = dict[str, Union[float]] +MeasureType = dict[str, float] class IsSensor(yaqd_core.IsDaemon): From f60c4e90686af4f88512dfde4988e538336a44a3 Mon Sep 17 00:00:00 2001 From: Daniel Kohler <11864045+ddkohler@users.noreply.github.com> Date: Mon, 17 Feb 2025 10:27:30 -0600 Subject: [PATCH 07/36] Update _is_sensor.py --- yaqd-core/yaqd_core/_is_sensor.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/yaqd-core/yaqd_core/_is_sensor.py b/yaqd-core/yaqd_core/_is_sensor.py index e37a7a1..236283a 100644 --- a/yaqd-core/yaqd_core/_is_sensor.py +++ b/yaqd-core/yaqd_core/_is_sensor.py @@ -5,11 +5,12 @@ import asyncio import pathlib -from typing import Any +from typing import Any, NewType import yaqd_core -MeasureType = dict[str, float] + +MeasureType = NewType("MeasureType", dict[str, float]) class IsSensor(yaqd_core.IsDaemon): From b4a1effad8d78a6751037af23b0dd228bf4b19c5 Mon Sep 17 00:00:00 2001 From: Daniel Kohler <11864045+ddkohler@users.noreply.github.com> Date: Mon, 17 Feb 2025 10:35:04 -0600 Subject: [PATCH 08/36] Update _is_sensor.py --- yaqd-core/yaqd_core/_is_sensor.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/yaqd-core/yaqd_core/_is_sensor.py b/yaqd-core/yaqd_core/_is_sensor.py index 236283a..11a01bd 100644 --- a/yaqd-core/yaqd_core/_is_sensor.py +++ b/yaqd-core/yaqd_core/_is_sensor.py @@ -5,12 +5,12 @@ import asyncio import pathlib -from typing import Any, NewType +from typing import Any, Dict, NewType import yaqd_core -MeasureType = NewType("MeasureType", dict[str, float]) +MeasureType = NewType("MeasureType", Dict[str, float]) class IsSensor(yaqd_core.IsDaemon): From e02fe2fb9f9f40c471149f4447c691be0fe7f66a Mon Sep 17 00:00:00 2001 From: Daniel Kohler <11864045+ddkohler@users.noreply.github.com> Date: Mon, 17 Feb 2025 10:39:42 -0600 Subject: [PATCH 09/36] Update _is_sensor.py --- yaqd-core/yaqd_core/_is_sensor.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/yaqd-core/yaqd_core/_is_sensor.py b/yaqd-core/yaqd_core/_is_sensor.py index 11a01bd..3b0d921 100644 --- a/yaqd-core/yaqd_core/_is_sensor.py +++ b/yaqd-core/yaqd_core/_is_sensor.py @@ -5,12 +5,12 @@ import asyncio import pathlib -from typing import Any, Dict, NewType +from typing import Any, Dict, TypeAlias import yaqd_core -MeasureType = NewType("MeasureType", Dict[str, float]) +MeasureType: TypeAlias = dict[str, float] class IsSensor(yaqd_core.IsDaemon): From 96698b46de44a4557756c3527d66137a05b57344 Mon Sep 17 00:00:00 2001 From: Daniel Kohler <11864045+ddkohler@users.noreply.github.com> Date: Mon, 17 Feb 2025 11:20:17 -0600 Subject: [PATCH 10/36] Update _is_sensor.py --- yaqd-core/yaqd_core/_is_sensor.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/yaqd-core/yaqd_core/_is_sensor.py b/yaqd-core/yaqd_core/_is_sensor.py index 3b0d921..c0319bf 100644 --- a/yaqd-core/yaqd_core/_is_sensor.py +++ b/yaqd-core/yaqd_core/_is_sensor.py @@ -5,12 +5,16 @@ import asyncio import pathlib -from typing import Any, Dict, TypeAlias +from typing import Any, Dict, TYPE_CHECKING import yaqd_core - -MeasureType: TypeAlias = dict[str, float] +if TYPE_CHECKING: + try: + from typing import TypeAlias + MeasureType: TypeAlias = dict[str, float] + except ImportError: # python <=3.8 + MeasureType = Dict[str, float] class IsSensor(yaqd_core.IsDaemon): From 806ee30dae6111bdeb60aa82ccac6e421d9961c4 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 17 Feb 2025 17:20:30 +0000 Subject: [PATCH 11/36] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- yaqd-core/yaqd_core/_is_sensor.py | 1 + 1 file changed, 1 insertion(+) diff --git a/yaqd-core/yaqd_core/_is_sensor.py b/yaqd-core/yaqd_core/_is_sensor.py index c0319bf..4206e87 100644 --- a/yaqd-core/yaqd_core/_is_sensor.py +++ b/yaqd-core/yaqd_core/_is_sensor.py @@ -12,6 +12,7 @@ if TYPE_CHECKING: try: from typing import TypeAlias + MeasureType: TypeAlias = dict[str, float] except ImportError: # python <=3.8 MeasureType = Dict[str, float] From e1b857e0c9494307fd249f62850ade84fc0a0a12 Mon Sep 17 00:00:00 2001 From: Daniel Kohler <11864045+ddkohler@users.noreply.github.com> Date: Mon, 17 Feb 2025 11:34:18 -0600 Subject: [PATCH 12/36] propagate to HasMeasureTrigger --- yaqd-core/yaqd_core/_has_measure_trigger.py | 4 +++- yaqd-core/yaqd_core/_is_sensor.py | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/yaqd-core/yaqd_core/_has_measure_trigger.py b/yaqd-core/yaqd_core/_has_measure_trigger.py index ed25962..fceb884 100644 --- a/yaqd-core/yaqd_core/_has_measure_trigger.py +++ b/yaqd-core/yaqd_core/_has_measure_trigger.py @@ -5,10 +5,12 @@ import asyncio import pathlib -from typing import Any +from typing import Dict, Any, Optional, TYPE_CHECKING from abc import ABC, abstractmethod from yaqd_core import IsSensor, IsDaemon +if TYPE_CHECKING: + from ._is_sensor import MeasureType class HasMeasureTrigger(IsSensor, IsDaemon, ABC): diff --git a/yaqd-core/yaqd_core/_is_sensor.py b/yaqd-core/yaqd_core/_is_sensor.py index 4206e87..f5c4fb6 100644 --- a/yaqd-core/yaqd_core/_is_sensor.py +++ b/yaqd-core/yaqd_core/_is_sensor.py @@ -9,6 +9,7 @@ import yaqd_core + if TYPE_CHECKING: try: from typing import TypeAlias From 06a063ba6c3df62021a13fca8f333ab32b04f04b Mon Sep 17 00:00:00 2001 From: Daniel Kohler <11864045+ddkohler@users.noreply.github.com> Date: Mon, 17 Feb 2025 11:35:17 -0600 Subject: [PATCH 13/36] Update _is_sensor.py --- yaqd-core/yaqd_core/_is_sensor.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/yaqd-core/yaqd_core/_is_sensor.py b/yaqd-core/yaqd_core/_is_sensor.py index f5c4fb6..d2c4feb 100644 --- a/yaqd-core/yaqd_core/_is_sensor.py +++ b/yaqd-core/yaqd_core/_is_sensor.py @@ -5,7 +5,7 @@ import asyncio import pathlib -from typing import Any, Dict, TYPE_CHECKING +from typing import Any, TYPE_CHECKING import yaqd_core @@ -16,6 +16,7 @@ MeasureType: TypeAlias = dict[str, float] except ImportError: # python <=3.8 + from typing import Dict MeasureType = Dict[str, float] From dda4db2cb28cc886dbadd868227152669c0695ec Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 17 Feb 2025 17:34:30 +0000 Subject: [PATCH 14/36] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- yaqd-core/yaqd_core/_has_measure_trigger.py | 1 + 1 file changed, 1 insertion(+) diff --git a/yaqd-core/yaqd_core/_has_measure_trigger.py b/yaqd-core/yaqd_core/_has_measure_trigger.py index fceb884..2a692b6 100644 --- a/yaqd-core/yaqd_core/_has_measure_trigger.py +++ b/yaqd-core/yaqd_core/_has_measure_trigger.py @@ -9,6 +9,7 @@ from abc import ABC, abstractmethod from yaqd_core import IsSensor, IsDaemon + if TYPE_CHECKING: from ._is_sensor import MeasureType From d07f6b1a89156d11d040a38fd11e54c8862c55ca Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 17 Feb 2025 17:35:45 +0000 Subject: [PATCH 15/36] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- yaqd-core/yaqd_core/_is_sensor.py | 1 + 1 file changed, 1 insertion(+) diff --git a/yaqd-core/yaqd_core/_is_sensor.py b/yaqd-core/yaqd_core/_is_sensor.py index d2c4feb..fc2813a 100644 --- a/yaqd-core/yaqd_core/_is_sensor.py +++ b/yaqd-core/yaqd_core/_is_sensor.py @@ -17,6 +17,7 @@ MeasureType: TypeAlias = dict[str, float] except ImportError: # python <=3.8 from typing import Dict + MeasureType = Dict[str, float] From 8d6e0e016b83ce0bc455c2d5d2aa3d5b1875f54c Mon Sep 17 00:00:00 2001 From: Daniel Kohler <11864045+ddkohler@users.noreply.github.com> Date: Mon, 17 Feb 2025 11:44:35 -0600 Subject: [PATCH 16/36] remove MeasureType --- yaqd-core/yaqd_core/_has_measure_trigger.py | 5 +---- yaqd-core/yaqd_core/_is_sensor.py | 15 ++------------- 2 files changed, 3 insertions(+), 17 deletions(-) diff --git a/yaqd-core/yaqd_core/_has_measure_trigger.py b/yaqd-core/yaqd_core/_has_measure_trigger.py index 2a692b6..ed25962 100644 --- a/yaqd-core/yaqd_core/_has_measure_trigger.py +++ b/yaqd-core/yaqd_core/_has_measure_trigger.py @@ -5,14 +5,11 @@ import asyncio import pathlib -from typing import Dict, Any, Optional, TYPE_CHECKING +from typing import Any from abc import ABC, abstractmethod from yaqd_core import IsSensor, IsDaemon -if TYPE_CHECKING: - from ._is_sensor import MeasureType - class HasMeasureTrigger(IsSensor, IsDaemon, ABC): def __init__( diff --git a/yaqd-core/yaqd_core/_is_sensor.py b/yaqd-core/yaqd_core/_is_sensor.py index fc2813a..1e050f9 100644 --- a/yaqd-core/yaqd_core/_is_sensor.py +++ b/yaqd-core/yaqd_core/_is_sensor.py @@ -5,28 +5,17 @@ import asyncio import pathlib -from typing import Any, TYPE_CHECKING +from typing import Any import yaqd_core -if TYPE_CHECKING: - try: - from typing import TypeAlias - - MeasureType: TypeAlias = dict[str, float] - except ImportError: # python <=3.8 - from typing import Dict - - MeasureType = Dict[str, float] - - class IsSensor(yaqd_core.IsDaemon): def __init__( self, name: str, config: dict[str, Any], config_filepath: pathlib.Path ): super().__init__(name, config, config_filepath) - self._measured: MeasureType = dict() # values must be numbers or arrays + self._measured: dict = dict() # values must be numbers or arrays self._channel_names: list[str] = [] self._channel_units: dict[str, str] = dict() self._channel_shapes: dict[str, tuple[int, ...]] = dict() From 40b241f8d5d316a212a8d61b2efadc9c796cf252 Mon Sep 17 00:00:00 2001 From: Daniel Kohler <11864045+ddkohler@users.noreply.github.com> Date: Mon, 17 Feb 2025 13:19:40 -0600 Subject: [PATCH 17/36] remove redundant actions --- .github/workflows/python-pytest.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/python-pytest.yml b/.github/workflows/python-pytest.yml index 7cc9631..0f3bdb8 100644 --- a/.github/workflows/python-pytest.yml +++ b/.github/workflows/python-pytest.yml @@ -3,8 +3,8 @@ name: pytest on: pull_request: types: [opened, reopened] - push: - + push: + jobs: build: From 8e6a4de6905e463bdd6094d57194113984421ff6 Mon Sep 17 00:00:00 2001 From: Daniel Kohler <11864045+ddkohler@users.noreply.github.com> Date: Mon, 17 Feb 2025 13:21:44 -0600 Subject: [PATCH 18/36] expand test py versions --- .github/workflows/python-pytest.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-pytest.yml b/.github/workflows/python-pytest.yml index 0f3bdb8..23b182e 100644 --- a/.github/workflows/python-pytest.yml +++ b/.github/workflows/python-pytest.yml @@ -10,7 +10,7 @@ jobs: strategy: matrix: - python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"] + python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] os: [ubuntu-latest, windows-latest] runs-on: ${{ matrix.os }} From e657070b0a2663badb1feb26d9937d185ad95093 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 17 Feb 2025 19:33:34 +0000 Subject: [PATCH 19/36] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- .github/workflows/python-pytest.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/python-pytest.yml b/.github/workflows/python-pytest.yml index 23b182e..8c58a1f 100644 --- a/.github/workflows/python-pytest.yml +++ b/.github/workflows/python-pytest.yml @@ -3,8 +3,8 @@ name: pytest on: pull_request: types: [opened, reopened] - push: - + push: + jobs: build: From 712e9791db4be0c05539915591356feaddb1fd73 Mon Sep 17 00:00:00 2001 From: Daniel Kohler <11864045+ddkohler@users.noreply.github.com> Date: Sun, 19 Oct 2025 10:28:49 -0500 Subject: [PATCH 20/36] initiate tests again --- yaqd-core/yaqd_core/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yaqd-core/yaqd_core/__init__.py b/yaqd-core/yaqd_core/__init__.py index 4d6729f..4397d34 100644 --- a/yaqd-core/yaqd_core/__init__.py +++ b/yaqd-core/yaqd_core/__init__.py @@ -1,6 +1,6 @@ """Core python package for implementing yaq deamons, and associated utilities.""" -from . import logging +from . import logging from .__version__ import __version__ from ._is_daemon import * From 2e04c441077a551a2f005cc6c161a7309bc888c8 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Sun, 19 Oct 2025 15:30:59 +0000 Subject: [PATCH 21/36] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- yaqd-core/yaqd_core/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yaqd-core/yaqd_core/__init__.py b/yaqd-core/yaqd_core/__init__.py index 4397d34..4d6729f 100644 --- a/yaqd-core/yaqd_core/__init__.py +++ b/yaqd-core/yaqd_core/__init__.py @@ -1,6 +1,6 @@ """Core python package for implementing yaq deamons, and associated utilities.""" -from . import logging +from . import logging from .__version__ import __version__ from ._is_daemon import * From 335f57cfdd256437ecbaf458b165c6dc57cdeea1 Mon Sep 17 00:00:00 2001 From: Daniel Kohler <11864045+ddkohler@users.noreply.github.com> Date: Mon, 20 Oct 2025 00:51:03 -0500 Subject: [PATCH 22/36] try python 3.13 curious if the freze issue still persists --- .github/workflows/python-pytest.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-pytest.yml b/.github/workflows/python-pytest.yml index 8c58a1f..7cc9631 100644 --- a/.github/workflows/python-pytest.yml +++ b/.github/workflows/python-pytest.yml @@ -10,7 +10,7 @@ jobs: strategy: matrix: - python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] + python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"] os: [ubuntu-latest, windows-latest] runs-on: ${{ matrix.os }} From 862f2bc0e59e862f9992554b36d6633432b44e15 Mon Sep 17 00:00:00 2001 From: Daniel Kohler <11864045+ddkohler@users.noreply.github.com> Date: Mon, 20 Oct 2025 10:47:01 -0500 Subject: [PATCH 23/36] Update _is_daemon.py --- yaqd-core/yaqd_core/_is_daemon.py | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) mode change 100755 => 100644 yaqd-core/yaqd_core/_is_daemon.py diff --git a/yaqd-core/yaqd_core/_is_daemon.py b/yaqd-core/yaqd_core/_is_daemon.py old mode 100755 new mode 100644 index c2940fe..b1c46a9 --- a/yaqd-core/yaqd_core/_is_daemon.py +++ b/yaqd-core/yaqd_core/_is_daemon.py @@ -297,16 +297,10 @@ async def shutdown_all(cls, sig, loop): # This is done after cancelling so that shutdown tasks which require the loop # are not themselves cancelled. [d.close() for d in cls._daemons] - tasks = [ - t - for t in asyncio.all_tasks() - if ( - t is not asyncio.current_task() - and "serve_forever" not in t.get_coro().__repr__() - ) - ] + tasks = [t for t in asyncio.all_tasks() if t is not asyncio.current_task()] for task in tasks: - logger.info(task.get_coro()) + if "process" in task.get_coro().__repr__(): + tasks.pop(tasks.index(task)) await asyncio.gather(*tasks, return_exceptions=True) [d._save_state() for d in cls._daemons] if hasattr(signal, "SIGHUP") and sig == signal.SIGHUP: From 03e3a6daad44157a45863c97de6733b2c23c0976 Mon Sep 17 00:00:00 2001 From: Daniel Kohler <11864045+ddkohler@users.noreply.github.com> Date: Mon, 20 Oct 2025 10:54:07 -0500 Subject: [PATCH 24/36] Update _is_daemon.py --- yaqd-core/yaqd_core/_is_daemon.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yaqd-core/yaqd_core/_is_daemon.py b/yaqd-core/yaqd_core/_is_daemon.py index b1c46a9..3a85920 100644 --- a/yaqd-core/yaqd_core/_is_daemon.py +++ b/yaqd-core/yaqd_core/_is_daemon.py @@ -299,7 +299,7 @@ async def shutdown_all(cls, sig, loop): [d.close() for d in cls._daemons] tasks = [t for t in asyncio.all_tasks() if t is not asyncio.current_task()] for task in tasks: - if "process" in task.get_coro().__repr__(): + if "serve_forever" in task.get_coro().__repr__(): tasks.pop(tasks.index(task)) await asyncio.gather(*tasks, return_exceptions=True) [d._save_state() for d in cls._daemons] From 4c0c4fd464415e8baff933275824327519aabac4 Mon Sep 17 00:00:00 2001 From: Daniel Kohler <11864045+ddkohler@users.noreply.github.com> Date: Mon, 20 Oct 2025 12:28:57 -0500 Subject: [PATCH 25/36] Update _is_daemon.py --- yaqd-core/yaqd_core/_is_daemon.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/yaqd-core/yaqd_core/_is_daemon.py b/yaqd-core/yaqd_core/_is_daemon.py index 3a85920..57aa83c 100644 --- a/yaqd-core/yaqd_core/_is_daemon.py +++ b/yaqd-core/yaqd_core/_is_daemon.py @@ -297,10 +297,15 @@ async def shutdown_all(cls, sig, loop): # This is done after cancelling so that shutdown tasks which require the loop # are not themselves cancelled. [d.close() for d in cls._daemons] - tasks = [t for t in asyncio.all_tasks() if t is not asyncio.current_task()] + tasks = [ + t for t in asyncio.all_tasks() + if ( + t is not asyncio.current_task() + and "serve_forever" not in t.get_coro().__repr__() + ) + ] for task in tasks: - if "serve_forever" in task.get_coro().__repr__(): - tasks.pop(tasks.index(task)) + logger.info(task.get_coro()) await asyncio.gather(*tasks, return_exceptions=True) [d._save_state() for d in cls._daemons] if hasattr(signal, "SIGHUP") and sig == signal.SIGHUP: From 2e7e5a9b68d2e047f76ee4f15f0ae08ec3cdd8c2 Mon Sep 17 00:00:00 2001 From: Daniel Kohler <11864045+ddkohler@users.noreply.github.com> Date: Mon, 20 Oct 2025 15:23:24 -0500 Subject: [PATCH 26/36] refactor asyncio loop --- yaqd-core/yaqd_core/_is_daemon.py | 45 +++++++++++++++++-------------- yaqd-core/yaqd_core/_protocol.py | 2 +- 2 files changed, 26 insertions(+), 21 deletions(-) diff --git a/yaqd-core/yaqd_core/_is_daemon.py b/yaqd-core/yaqd_core/_is_daemon.py index 57aa83c..a93615d 100644 --- a/yaqd-core/yaqd_core/_is_daemon.py +++ b/yaqd-core/yaqd_core/_is_daemon.py @@ -123,17 +123,6 @@ def _traits(cls) -> List[str]: @classmethod def main(cls): - """Run the event loop.""" - loop = asyncio.get_event_loop() - if sys.platform.startswith("win"): - signals = () - else: - signals = (signal.SIGHUP, signal.SIGTERM, signal.SIGINT) - for s in signals: - loop.add_signal_handler( - s, lambda s=s: asyncio.create_task(cls.shutdown_all(s, loop)) - ) - parser = argparse.ArgumentParser() parser.add_argument( "--config", @@ -199,19 +188,28 @@ def main(cls): with open(config_filepath, "rb") as f: config_file = tomli.load(f) - loop.create_task(cls._main(config_filepath, config_file, args)) + # Run the event loop try: - loop.run_forever() + asyncio.run( + cls._main(config_filepath, config_file, args) + ) except asyncio.CancelledError: pass - finally: - loop.close() @classmethod async def _main(cls, config_filepath, config_file, args=None): """Parse command line arguments, start event loop tasks.""" loop = asyncio.get_running_loop() - cls.__servers = [] + if sys.platform.startswith("win"): + signals = () + else: + signals = (signal.SIGHUP, signal.SIGTERM, signal.SIGINT) + for s in signals: + loop.add_signal_handler( + s, lambda s=s: asyncio.create_task(cls.shutdown_all(s, loop)) + ) + + cls.__servers = set() for section in config_file: if section == "shared-settings": continue @@ -225,7 +223,7 @@ async def _main(cls, config_filepath, config_file, args=None): while cls.__servers: awaiting = cls.__servers - cls.__servers = [] + cls.__servers = set() await asyncio.wait(awaiting) await asyncio.sleep(1) loop.stop() @@ -252,7 +250,11 @@ def server(daemon): server(daemon), config.get("host", ""), config.get("port", None) ) daemon._server = ser - cls.__servers.append(asyncio.create_task(ser.serve_forever())) + # cls.__servers.add(asyncio.create_task()) + task = asyncio.create_task(ser.serve_forever()) + cls.__servers.add(task) + # Add a done callback to remove the task from the set when it completes + task.add_done_callback(cls.__servers.discard) @classmethod def _parse_config(cls, config_file, section, args=None): @@ -300,13 +302,16 @@ async def shutdown_all(cls, sig, loop): tasks = [ t for t in asyncio.all_tasks() if ( - t is not asyncio.current_task() - and "serve_forever" not in t.get_coro().__repr__() + t is not asyncio.current_task() + # and "serve_forever" not in t.get_coro().__repr__() ) ] + logger.info("gathering") for task in tasks: logger.info(task.get_coro()) await asyncio.gather(*tasks, return_exceptions=True) + logger.info("gathered") + logger.info([task.get_coro() for task in asyncio.all_tasks()]) [d._save_state() for d in cls._daemons] if hasattr(signal, "SIGHUP") and sig == signal.SIGHUP: config_filepath = [d._config_filepath for d in cls._daemons][0] diff --git a/yaqd-core/yaqd_core/_protocol.py b/yaqd-core/yaqd_core/_protocol.py index 6644a08..10bd3fa 100644 --- a/yaqd-core/yaqd_core/_protocol.py +++ b/yaqd-core/yaqd_core/_protocol.py @@ -28,7 +28,7 @@ def connection_made(self, transport): self.transport = transport self.unpacker = avrorpc.Unpacker(self._avro_protocol) self._daemon._connection_made(peername) - self.task = asyncio.get_event_loop().create_task(self.process_requests()) + self.task = asyncio.get_running_loop().create_task(self.process_requests()) def data_received(self, data): """Process an incomming request.""" From 1910f2d3783d287a9b1a9bca3d7e0a596a330662 Mon Sep 17 00:00:00 2001 From: Daniel Kohler <11864045+ddkohler@users.noreply.github.com> Date: Mon, 20 Oct 2025 15:38:20 -0500 Subject: [PATCH 27/36] Update _fake_sensor.py --- yaqd-fakes/yaqd_fakes/_fake_sensor.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yaqd-fakes/yaqd_fakes/_fake_sensor.py b/yaqd-fakes/yaqd_fakes/_fake_sensor.py index c56f1b3..980115e 100644 --- a/yaqd-fakes/yaqd_fakes/_fake_sensor.py +++ b/yaqd-fakes/yaqd_fakes/_fake_sensor.py @@ -28,7 +28,7 @@ def __init__(self, name, config, config_filepath): self._channel_generators[name] = random_walk(min_, max_) else: raise Exception(f"channel kind {kwargs['kind']} not recognized") - asyncio.get_event_loop().create_task(self._update_measurements()) + self._loop.create_task(self._update_measurements()) async def _update_measurements(self): while True: From 5a9fef13d1d9f71f0e9aa452b1c273d496dd140c Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 20 Oct 2025 20:39:01 +0000 Subject: [PATCH 28/36] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- yaqd-core/yaqd_core/_is_daemon.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/yaqd-core/yaqd_core/_is_daemon.py b/yaqd-core/yaqd_core/_is_daemon.py index a93615d..ad6535d 100644 --- a/yaqd-core/yaqd_core/_is_daemon.py +++ b/yaqd-core/yaqd_core/_is_daemon.py @@ -190,9 +190,7 @@ def main(cls): # Run the event loop try: - asyncio.run( - cls._main(config_filepath, config_file, args) - ) + asyncio.run(cls._main(config_filepath, config_file, args)) except asyncio.CancelledError: pass @@ -300,9 +298,11 @@ async def shutdown_all(cls, sig, loop): # are not themselves cancelled. [d.close() for d in cls._daemons] tasks = [ - t for t in asyncio.all_tasks() + t + for t in asyncio.all_tasks() if ( - t is not asyncio.current_task() + t + is not asyncio.current_task() # and "serve_forever" not in t.get_coro().__repr__() ) ] From c37563056c38cb502719956f5af524981018c62f Mon Sep 17 00:00:00 2001 From: Daniel Kohler <11864045+ddkohler@users.noreply.github.com> Date: Mon, 20 Oct 2025 15:46:56 -0500 Subject: [PATCH 29/36] cleanup --- yaqd-core/yaqd_core/_is_daemon.py | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/yaqd-core/yaqd_core/_is_daemon.py b/yaqd-core/yaqd_core/_is_daemon.py index ad6535d..44e6a32 100644 --- a/yaqd-core/yaqd_core/_is_daemon.py +++ b/yaqd-core/yaqd_core/_is_daemon.py @@ -123,6 +123,7 @@ def _traits(cls) -> List[str]: @classmethod def main(cls): + """parse arguments and start the event loop""" parser = argparse.ArgumentParser() parser.add_argument( "--config", @@ -248,10 +249,8 @@ def server(daemon): server(daemon), config.get("host", ""), config.get("port", None) ) daemon._server = ser - # cls.__servers.add(asyncio.create_task()) task = asyncio.create_task(ser.serve_forever()) cls.__servers.add(task) - # Add a done callback to remove the task from the set when it completes task.add_done_callback(cls.__servers.discard) @classmethod @@ -297,21 +296,10 @@ async def shutdown_all(cls, sig, loop): # This is done after cancelling so that shutdown tasks which require the loop # are not themselves cancelled. [d.close() for d in cls._daemons] - tasks = [ - t - for t in asyncio.all_tasks() - if ( - t - is not asyncio.current_task() - # and "serve_forever" not in t.get_coro().__repr__() - ) - ] - logger.info("gathering") + tasks = [t for t in asyncio.all_tasks() if t is not asyncio.current_task()] for task in tasks: logger.info(task.get_coro()) await asyncio.gather(*tasks, return_exceptions=True) - logger.info("gathered") - logger.info([task.get_coro() for task in asyncio.all_tasks()]) [d._save_state() for d in cls._daemons] if hasattr(signal, "SIGHUP") and sig == signal.SIGHUP: config_filepath = [d._config_filepath for d in cls._daemons][0] From 8ef34189da2989e770cee8fda62aa0c4eb1a8973 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 20 Oct 2025 20:30:11 +0000 Subject: [PATCH 30/36] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- yaqd-core/yaqd_core/_is_daemon.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/yaqd-core/yaqd_core/_is_daemon.py b/yaqd-core/yaqd_core/_is_daemon.py index 44e6a32..32db9e4 100644 --- a/yaqd-core/yaqd_core/_is_daemon.py +++ b/yaqd-core/yaqd_core/_is_daemon.py @@ -296,7 +296,14 @@ async def shutdown_all(cls, sig, loop): # This is done after cancelling so that shutdown tasks which require the loop # are not themselves cancelled. [d.close() for d in cls._daemons] - tasks = [t for t in asyncio.all_tasks() if t is not asyncio.current_task()] + tasks = [ + t + for t in asyncio.all_tasks() + if ( + t is not asyncio.current_task() + and "serve_forever" not in t.get_coro().__repr__() + ) + ] for task in tasks: logger.info(task.get_coro()) await asyncio.gather(*tasks, return_exceptions=True) From 872935bb68caea6bfd690434eb789a1ba685664a Mon Sep 17 00:00:00 2001 From: Daniel Kohler <11864045+ddkohler@users.noreply.github.com> Date: Mon, 20 Oct 2025 16:00:47 -0500 Subject: [PATCH 31/36] Update _is_daemon.py cleanup --- yaqd-core/yaqd_core/_is_daemon.py | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/yaqd-core/yaqd_core/_is_daemon.py b/yaqd-core/yaqd_core/_is_daemon.py index 32db9e4..0ba6cd7 100644 --- a/yaqd-core/yaqd_core/_is_daemon.py +++ b/yaqd-core/yaqd_core/_is_daemon.py @@ -197,7 +197,7 @@ def main(cls): @classmethod async def _main(cls, config_filepath, config_file, args=None): - """Parse command line arguments, start event loop tasks.""" + """Parse command line arguments, run event loop.""" loop = asyncio.get_running_loop() if sys.platform.startswith("win"): signals = () @@ -296,16 +296,7 @@ async def shutdown_all(cls, sig, loop): # This is done after cancelling so that shutdown tasks which require the loop # are not themselves cancelled. [d.close() for d in cls._daemons] - tasks = [ - t - for t in asyncio.all_tasks() - if ( - t is not asyncio.current_task() - and "serve_forever" not in t.get_coro().__repr__() - ) - ] - for task in tasks: - logger.info(task.get_coro()) + tasks = [t for t in asyncio.all_tasks() if t is not asyncio.current_task()] await asyncio.gather(*tasks, return_exceptions=True) [d._save_state() for d in cls._daemons] if hasattr(signal, "SIGHUP") and sig == signal.SIGHUP: From f8f04b876413e4355fc86ccdae7edba795c31336 Mon Sep 17 00:00:00 2001 From: Daniel Kohler <11864045+ddkohler@users.noreply.github.com> Date: Tue, 21 Oct 2025 00:26:28 -0500 Subject: [PATCH 32/36] peek at py3.8 tests --- .github/workflows/python-pytest.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-pytest.yml b/.github/workflows/python-pytest.yml index 7cc9631..a2fec01 100644 --- a/.github/workflows/python-pytest.yml +++ b/.github/workflows/python-pytest.yml @@ -10,7 +10,7 @@ jobs: strategy: matrix: - python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"] + python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"] os: [ubuntu-latest, windows-latest] runs-on: ${{ matrix.os }} From 073555fea21c33d2891c380beaa7f1bf5154d0f3 Mon Sep 17 00:00:00 2001 From: Daniel Kohler <11864045+ddkohler@users.noreply.github.com> Date: Wed, 29 Oct 2025 00:23:51 -0500 Subject: [PATCH 33/36] Update .gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 90aa4fe..248920a 100644 --- a/.gitignore +++ b/.gitignore @@ -52,3 +52,4 @@ coverage.xml # vim *.sw? +/.vscode From cd42c8c162849cf56d8b69432a92974e09acc192 Mon Sep 17 00:00:00 2001 From: Daniel Kohler <11864045+ddkohler@users.noreply.github.com> Date: Thu, 13 Nov 2025 12:07:14 -0600 Subject: [PATCH 34/36] Update CHANGELOG.md --- yaqd-core/CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/yaqd-core/CHANGELOG.md b/yaqd-core/CHANGELOG.md index 5f8d640..0eb919b 100644 --- a/yaqd-core/CHANGELOG.md +++ b/yaqd-core/CHANGELOG.md @@ -6,6 +6,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/). ## [Unreleased] ### Fixed +- removed asyncio syntax that was removed in python 3.14 - type hints for IsSensor attributes are appropriate for _n_-dimensional data ## [2023.11.0] From dd7b2b23104c628d4edc653dc83aa0dd89d40e34 Mon Sep 17 00:00:00 2001 From: Daniel Kohler <11864045+ddkohler@users.noreply.github.com> Date: Thu, 13 Nov 2025 22:07:36 -0600 Subject: [PATCH 35/36] test with py3.14 --- .github/workflows/python-pytest.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-pytest.yml b/.github/workflows/python-pytest.yml index a2fec01..a6c2c8d 100644 --- a/.github/workflows/python-pytest.yml +++ b/.github/workflows/python-pytest.yml @@ -10,7 +10,7 @@ jobs: strategy: matrix: - python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"] + python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.14"] os: [ubuntu-latest, windows-latest] runs-on: ${{ matrix.os }} From 1cd2bf18e4f5554112a475eba490b83a9e3094fa Mon Sep 17 00:00:00 2001 From: Blaise Thompson Date: Fri, 19 Dec 2025 16:24:25 -0600 Subject: [PATCH 36/36] don't reach in and grab _loop --- yaqd-fakes/yaqd_fakes/_fake_sensor.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yaqd-fakes/yaqd_fakes/_fake_sensor.py b/yaqd-fakes/yaqd_fakes/_fake_sensor.py index 980115e..1e16845 100644 --- a/yaqd-fakes/yaqd_fakes/_fake_sensor.py +++ b/yaqd-fakes/yaqd_fakes/_fake_sensor.py @@ -28,7 +28,7 @@ def __init__(self, name, config, config_filepath): self._channel_generators[name] = random_walk(min_, max_) else: raise Exception(f"channel kind {kwargs['kind']} not recognized") - self._loop.create_task(self._update_measurements()) + asyncio.get_running_loop().create_task(self._update_measurements()) async def _update_measurements(self): while True: