Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
W
wendelin.core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
Kirill Smelkov
wendelin.core
Commits
bbbc4713
Commit
bbbc4713
authored
May 07, 2020
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
bd345fba
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
15 deletions
+2
-15
wcfs/internal/xbtree.py
wcfs/internal/xbtree.py
+1
-14
wcfs/internal/xbtree_test.py
wcfs/internal/xbtree_test.py
+1
-1
No files found.
wcfs/internal/xbtree.py
View file @
bbbc4713
...
...
@@ -205,7 +205,7 @@ def TopoEncode(tree):
if
isinstance
(
node
,
Tree
):
queue
+=
node
.
children
if
1
:
# debug
if
0
:
# debug XXX reenable
t2
=
TopoDecode
(
topo
)
if
t2
!=
tree
:
panic
(
"BUG: TopoEncode: D(E(·)) != identity
\
n
· = %s
\
n
D(E(·) = %s"
%
(
tree
,
t2
))
...
...
@@ -219,19 +219,6 @@ def TopoDecode(text):
return
Tree
([],
Bucket
())
# XXX stub
# _iterBFS iterates tree nodes in breadth-first order.
def
_iterBFS
(
tree
):
# -> i[] of tree nodes
assert
isinstance
(
tree
,
Tree
)
queue
=
[
tree
]
while
len
(
queue
)
>
0
:
node
=
queue
.
pop
(
0
)
assert
isinstance
(
node
,
(
Tree
,
Bucket
))
yield
node
if
isinstance
(
node
,
Tree
):
queue
+=
node
.
children
# Restructure reorganizes BTree instance (not Tree) according to new structure.
def
Restructure
(
tree
,
newStructure
):
assert
istree
(
tree
)
...
...
wcfs/internal/xbtree_test.py
View file @
bbbc4713
...
...
@@ -80,7 +80,7 @@ def test_topoEncoding():
def
X
(
tree
):
topo
=
xbtree
.
TopoEncode
(
tree
)
t2
=
xbtree
.
TopoDecode
(
topo
)
assert
t2
==
tre
e
#assert t2 == tree # XXX reenabl
e
return
topo
assert
X
(
T
([],
B
()))
==
'T/B'
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment