From 4e2c756cfdc459ef3dfb51657cd9752b8c109cd5 Mon Sep 17 00:00:00 2001 From: Florian Feurstein Date: Thu, 3 Aug 2023 11:19:28 +0200 Subject: [PATCH 1/5] Update operator_overloading.py fix bug from issue https://github.com/semiversus/python-broqer/issues/43 --- broqer/operator_overloading.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/broqer/operator_overloading.py b/broqer/operator_overloading.py index 22a84b2..80d621e 100644 --- a/broqer/operator_overloading.py +++ b/broqer/operator_overloading.py @@ -5,7 +5,7 @@ # pylint: disable=cyclic-import import broqer -from broqer import Publisher +from broqer import Publisher, op from broqer.operator import Operator @@ -125,7 +125,7 @@ def apply_operator_overloading(): '__getitem__', '__floordiv__', '__truediv__'): def _op(operand_left, operand_right, operation=method): if isinstance(operand_right, Publisher): - return broqer.op.CombineLatest(operand_left, operand_right, + return op.CombineLatest(operand_left, operand_right, map_=getattr(operator, operation)) return MapConstant(operand_left, operand_right, From a5a214a70c871af45efe1f7e8088951f82aa8143 Mon Sep 17 00:00:00 2001 From: Florian Feurstein Date: Thu, 3 Aug 2023 11:23:02 +0200 Subject: [PATCH 2/5] Update operator_overloading.py fix linter errors --- broqer/operator_overloading.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/broqer/operator_overloading.py b/broqer/operator_overloading.py index 80d621e..8f5b108 100644 --- a/broqer/operator_overloading.py +++ b/broqer/operator_overloading.py @@ -4,7 +4,6 @@ from typing import Any as Any_ # pylint: disable=cyclic-import -import broqer from broqer import Publisher, op from broqer.operator import Operator @@ -126,8 +125,7 @@ def apply_operator_overloading(): def _op(operand_left, operand_right, operation=method): if isinstance(operand_right, Publisher): return op.CombineLatest(operand_left, operand_right, - map_=getattr(operator, - operation)) + map_=getattr(operator, operation)) return MapConstant(operand_left, operand_right, getattr(operator, operation)) From f636406f3feb6202497b947ed0bb306505b752d9 Mon Sep 17 00:00:00 2001 From: Florian Feurstein Date: Thu, 3 Aug 2023 11:28:52 +0200 Subject: [PATCH 3/5] Update operator_overloading.py trying to fix cyclic import --- broqer/operator_overloading.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/broqer/operator_overloading.py b/broqer/operator_overloading.py index 8f5b108..daef8e0 100644 --- a/broqer/operator_overloading.py +++ b/broqer/operator_overloading.py @@ -4,7 +4,8 @@ from typing import Any as Any_ # pylint: disable=cyclic-import -from broqer import Publisher, op +from broqer.op import CombineLatest +from broqer import Publisher from broqer.operator import Operator @@ -124,7 +125,7 @@ def apply_operator_overloading(): '__getitem__', '__floordiv__', '__truediv__'): def _op(operand_left, operand_right, operation=method): if isinstance(operand_right, Publisher): - return op.CombineLatest(operand_left, operand_right, + return CombineLatest(operand_left, operand_right, map_=getattr(operator, operation)) return MapConstant(operand_left, operand_right, getattr(operator, operation)) From c6ada44ba8c19076a9ab180606b7245b5f569862 Mon Sep 17 00:00:00 2001 From: Florian Feurstein Date: Thu, 3 Aug 2023 11:48:25 +0200 Subject: [PATCH 4/5] Update operator_overloading.py fix linter errors --- broqer/operator_overloading.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/broqer/operator_overloading.py b/broqer/operator_overloading.py index daef8e0..dab1e6f 100644 --- a/broqer/operator_overloading.py +++ b/broqer/operator_overloading.py @@ -126,7 +126,7 @@ def apply_operator_overloading(): def _op(operand_left, operand_right, operation=method): if isinstance(operand_right, Publisher): return CombineLatest(operand_left, operand_right, - map_=getattr(operator, operation)) + map_=getattr(operator, operation)) return MapConstant(operand_left, operand_right, getattr(operator, operation)) From 08c21e3f64ef53a0129619f5a6b132b4ba37a560 Mon Sep 17 00:00:00 2001 From: Florian Feurstein Date: Thu, 3 Aug 2023 12:01:55 +0200 Subject: [PATCH 5/5] Update operator_overloading.py --- broqer/operator_overloading.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/broqer/operator_overloading.py b/broqer/operator_overloading.py index dab1e6f..28c5714 100644 --- a/broqer/operator_overloading.py +++ b/broqer/operator_overloading.py @@ -4,7 +4,6 @@ from typing import Any as Any_ # pylint: disable=cyclic-import -from broqer.op import CombineLatest from broqer import Publisher from broqer.operator import Operator @@ -125,6 +124,7 @@ def apply_operator_overloading(): '__getitem__', '__floordiv__', '__truediv__'): def _op(operand_left, operand_right, operation=method): if isinstance(operand_right, Publisher): + from broqer.op import CombineLatest return CombineLatest(operand_left, operand_right, map_=getattr(operator, operation)) return MapConstant(operand_left, operand_right,