projects
/
ieee754fpu.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
632a42b
)
Implement PartitionedSignal.like()
author
Cesar Strauss
<cestrauss@gmail.com>
Sat, 23 Jan 2021 20:31:39 +0000
(17:31 -0300)
committer
Cesar Strauss
<cestrauss@gmail.com>
Sat, 23 Jan 2021 20:31:39 +0000
(17:31 -0300)
src/ieee754/part/partsig.py
patch
|
blob
|
history
diff --git
a/src/ieee754/part/partsig.py
b/src/ieee754/part/partsig.py
index ab14bf9909fff362e132fab4b676bb228d9fd121..fb06a1b9e0a625889db4ef5c15cb4145cf6da776 100644
(file)
--- a/
src/ieee754/part/partsig.py
+++ b/
src/ieee754/part/partsig.py
@@
-60,6
+60,14
@@
class PartitionedSignal:
def eq(self, val):
return self.sig.eq(getsig(val))
+ @staticmethod
+ def like(other, *args, **kwargs):
+ """Builds a new PartitionedSignal with the same PartitionPoints and
+ Signal properties as the other"""
+ result = PartitionedSignal(other.partpoints)
+ result.sig = Signal.like(other.sig, *args, **kwargs)
+ return result
+
# unary ops that do not require partitioning
def __invert__(self):