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
664b8044
Commit
664b8044
authored
5 years ago
by
Jacob Wahlman
Browse files
Options
Downloads
Patches
Plain Diff
Fixed smaller typing issues and moved traverse test
parent
57456644
No related branches found
No related tags found
3 merge requests
!7
Resolve "Operation Traversing"
,
!4
Operation Tree Traversing
,
!2
Integrated ID system, traversing and som signal tests
Pipeline
#9894
passed
5 years ago
Stage: build
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
b_asic/traverse_tree.py
+5
-5
5 additions, 5 deletions
b_asic/traverse_tree.py
test/traverse/test_traverse_tree.py
+0
-0
0 additions, 0 deletions
test/traverse/test_traverse_tree.py
with
5 additions
and
5 deletions
b_asic/traverse_tree.py
+
5
−
5
View file @
664b8044
...
...
@@ -8,7 +8,7 @@ TODO:
- When we no more out ports can be traversed return results and end.
"""
from
typing
import
List
from
typing
import
List
,
Optional
from
collections
import
deque
from
b_asic.operation
import
Operation
...
...
@@ -39,16 +39,16 @@ class Traverse:
return
visited
def
traverse
(
self
,
_
type
:
Operation
=
None
)
->
List
[
Operation
]:
def
traverse
(
self
,
type
_
:
Optional
[
Operation
]
=
None
)
->
List
[
Operation
]:
"""
Traverse the the operation tree and return operation where type matches.
If the type is None then return the entire tree.
Keyword arguments:
_
type
-- the operation type to search for (default None)
type
_
-- the operation type to search for (default None)
"""
operations
:
List
[
Operation
]
=
self
.
_breadth_first_search
(
self
.
_initial_operation
)
if
_
type
is
not
None
:
operations
=
[
oper
for
oper
in
operations
if
isinstance
(
oper
,
_
type
)]
if
type
_
is
not
None
:
operations
=
[
oper
for
oper
in
operations
if
isinstance
(
oper
,
type
_
)]
return
operations
This diff is collapsed.
Click to expand it.
test/test_traverse_tree.py
→
test/
traverse/
test_traverse_tree.py
+
0
−
0
View file @
664b8044
File moved
This diff is collapsed.
Click to expand it.
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