Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

graph cause asciidag break #6

Open
luluman opened this issue Mar 25, 2021 · 1 comment
Open

graph cause asciidag break #6

luluman opened this issue Mar 25, 2021 · 1 comment

Comments

@luluman
Copy link

luluman commented Mar 25, 2021

When I run this code, an error occurred.

from asciidag.graph import Graph
from asciidag.node import Node

graph = Graph()

nodeA = Node('A', parents=[])
nodeB = Node('B', parents=[])
nodeC = Node('C', parents=[])
nodeD = Node('D', parents=[nodeA, nodeB, nodeC])

tips = [
    Node('E',
         parents=[
             Node('F', parents=[nodeC, nodeD]),
             Node('G', parents=[Node('H', parents=[nodeD]), nodeD])
         ])
]

graph.show_nodes(tips)

This is the log.

WeChat573717b395e1376afa67889a9e41d931

Sometimes "asciidag" may succeed, which will print the right graph.

WeChat58d8bdeda6a15fbbad1fdaea2fcc4959

I have tested on python3.5.2, and it will pass when first run but failed afterward. I never success on python 3.9.2.

@sambrightman
Copy link
Owner

I can confirm the issue but haven't had chance to look into it yet.

gammahead pushed a commit to gammahead/asciidag that referenced this issue Jun 3, 2022
Iterating self.new_columns to print the octopus merge dashes
does not work because the new_column indices are not necessarily
in the same order as their corresponding parents in the merge.

Offsetting into self.new_columns using self.commit_index breaks
when self.commit_index > len(self.new_columns)

addresses sambrightman#6
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants