Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B-ASIC - Better ASIC Toolbox
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Computer Engineering
B-ASIC - Better ASIC Toolbox
Commits
033f9ee1
Commit
033f9ee1
authored
4 years ago
by
Kevin
Browse files
Options
Downloads
Patches
Plain Diff
changed split function and MAD operation
parent
4672f718
No related branches found
Branches containing commit
No related tags found
2 merge requests
!44
Resolve "Operation Replacement in a SFG"
,
!42
Resolve "Operation to SFG Conversion"
Pipeline
#14318
failed
4 years ago
Stage: test
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
b_asic/core_operations.py
+2
-2
2 additions, 2 deletions
b_asic/core_operations.py
b_asic/operation.py
+2
-2
2 additions, 2 deletions
b_asic/operation.py
test/test_core_operations.py
+12
-2
12 additions, 2 deletions
test/test_core_operations.py
with
16 additions
and
6 deletions
b_asic/core_operations.py
+
2
−
2
View file @
033f9ee1
...
...
@@ -235,8 +235,8 @@ class MAD(AbstractOperation):
TODO: More info.
"""
def
__init__
(
self
,
src0
:
Optional
[
SignalSourceProvider
]
=
None
,
src1
:
Optional
[
SignalSourceProvider
]
=
None
,
name
:
Name
=
""
):
super
().
__init__
(
input_count
=
3
,
output_count
=
1
,
name
=
name
,
input_sources
=
[
src0
,
src1
])
def
__init__
(
self
,
src0
:
Optional
[
SignalSourceProvider
]
=
None
,
src1
:
Optional
[
SignalSourceProvider
]
=
None
,
src2
:
Optional
[
SignalSourceProvider
]
=
None
,
name
:
Name
=
""
):
super
().
__init__
(
input_count
=
3
,
output_count
=
1
,
name
=
name
,
input_sources
=
[
src0
,
src1
,
src2
])
@property
def
type_name
(
self
)
->
TypeName
:
...
...
This diff is collapsed.
Click to expand it.
b_asic/operation.py
+
2
−
2
View file @
033f9ee1
...
...
@@ -329,7 +329,7 @@ class AbstractOperation(Operation, AbstractGraphComponent):
# Import here to avoid circular imports.
from
b_asic.special_operations
import
Input
try
:
result
=
self
.
evaluate
([
Input
()]
*
self
.
input_count
)
result
=
self
.
evaluate
(
*
[
Input
()]
*
self
.
input_count
)
if
isinstance
(
result
,
collections
.
Sequence
)
and
all
(
isinstance
(
e
,
Operation
)
for
e
in
result
):
return
result
if
isinstance
(
result
,
Operation
):
...
...
@@ -338,7 +338,7 @@ class AbstractOperation(Operation, AbstractGraphComponent):
pass
except
ValueError
:
pass
return
[
self
]
return
[
self
]
@property
def
neighbors
(
self
)
->
Iterable
[
GraphComponent
]:
...
...
This diff is collapsed.
Click to expand it.
test/test_core_operations.py
+
12
−
2
View file @
033f9ee1
...
...
@@ -4,8 +4,7 @@ B-ASIC test suite for the core operations.
from
b_asic
import
\
Constant
,
Addition
,
Subtraction
,
Multiplication
,
ConstantMultiplication
,
Division
,
\
SquareRoot
,
ComplexConjugate
,
Max
,
Min
,
Absolute
,
Butterfly
SquareRoot
,
ComplexConjugate
,
Max
,
Min
,
Absolute
,
Butterfly
,
MAD
class
TestConstant
:
def
test_constant_positive
(
self
):
...
...
@@ -164,3 +163,14 @@ class TestButterfly:
test_operation
=
Butterfly
()
assert
test_operation
.
evaluate_output
(
0
,
[
2
+
1j
,
3
-
2j
])
==
5
-
1j
assert
test_operation
.
evaluate_output
(
1
,
[
2
+
1j
,
3
-
2j
])
==
-
1
+
3j
def
test_split
(
self
):
but1
=
Butterfly
()
split
=
but1
.
split
()
assert
len
(
split
)
==
2
class
TestMad
:
def
test_split_mad
(
self
):
mad1
=
MAD
()
res
=
mad1
.
split
()
assert
len
(
res
)
==
2
This diff is collapsed.
Click to expand it.
Kevin Scott
@kevsc634
mentioned in issue
#17
·
4 years ago
mentioned in issue
#17
mentioned in issue #17
Toggle commit list
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment