summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNao Pross <np@0hm.ch>2024-06-02 15:39:09 +0200
committerNao Pross <np@0hm.ch>2024-06-02 15:39:09 +0200
commit1e86d0946280b05e7ee41bb772041e234ec6d8e7 (patch)
tree3544729a957500945b1eeb675a67d802c5214373
parentAllow any iterable as argument of poly.block_diag (diff)
downloadpolymatrix-1e86d0946280b05e7ee41bb772041e234ec6d8e7.tar.gz
polymatrix-1e86d0946280b05e7ee41bb772041e234ec6d8e7.zip
Give better name to member of BroadcastPolyMatrix
-rw-r--r--polymatrix/polymatrix/impl.py2
-rw-r--r--polymatrix/polymatrix/mixins.py5
2 files changed, 4 insertions, 3 deletions
diff --git a/polymatrix/polymatrix/impl.py b/polymatrix/polymatrix/impl.py
index bb42313..a6a1acf 100644
--- a/polymatrix/polymatrix/impl.py
+++ b/polymatrix/polymatrix/impl.py
@@ -38,7 +38,7 @@ class PolyMatrixImpl(PolyMatrix):
@dataclassabc.dataclassabc(frozen=True)
class BroadcastPolyMatrixImpl(BroadcastPolyMatrixMixin):
- data: PolyDict
+ polynomial: PolyDict
shape: tuple[int, int]
diff --git a/polymatrix/polymatrix/mixins.py b/polymatrix/polymatrix/mixins.py
index c12f4cc..bb2fc17 100644
--- a/polymatrix/polymatrix/mixins.py
+++ b/polymatrix/polymatrix/mixins.py
@@ -118,7 +118,8 @@ class BroadcastPolyMatrixMixin(PolyMatrixMixin, ABC):
"""
@property
@abstractmethod
- def data(self) -> PolyDict: ...
+ def polynomial(self) -> PolyDict:
+ """ Scalar polynomial that is broadcasted. """
@override
def at(self, row: int, col: int) -> PolyDict:
@@ -129,7 +130,7 @@ class BroadcastPolyMatrixMixin(PolyMatrixMixin, ABC):
@override
def get_poly(self, col: int, row: int) -> PolyDict | None:
- return self.data or None
+ return self.polynomial or None
class BlockPolyMatrixMixin(PolyMatrixMixin, ABC):