skieffer / hola

Human-like Orthogonal Layout Algorithm
47 stars 10 forks source link

Unusable water-level 0 (again) #4

Closed jdwaterson closed 8 years ago

jdwaterson commented 8 years ago

Hi there, I recently reported #3 and you fixed it very promptly, so thanks for that.

I've found another similar-looking problem, so feel I should let you know. The error is basically the same as last time, viz:

$ ./hola_basic < arc.gml >! arc-hola.gml
Traceback (most recent call last):
  File "./hola_basic", line 16, in <module>
    main()
  File "./hola_basic", line 11, in main
    hola(G)
  File "/Users/jdw/src/hola/hola/hola.py", line 468, in hola
    faceset = reattachTrees2(P, trees, iel, projLogger, config)
  File "/Users/jdw/src/hola/hola/treeplacement.py", line 68, in reattachTrees2
    ps = tp.getBestProjSeq(iel)
  File "/Users/jdw/src/hola/hola/faces.py", line 783, in getBestProjSeq
    self.evaluateExpansionOptions(iel)
  File "/Users/jdw/src/hola/hola/faces.py", line 774, in evaluateExpansionOptions
    self.expansionOptions = self.face.evaluateExpansionOptions(self, iel)
  File "/Users/jdw/src/hola/hola/faces.py", line 1601, in evaluateExpansionOptions
    projseqs.extend(wd.buildProjSeqs(ps0))
  File "/Users/jdw/src/hola/hola/water.py", line 133, in buildProjSeqs
    pses = g0.tryAllLevelsRec(ps0, grem)
  File "/Users/jdw/src/hola/hola/water.py", line 259, in tryAllLevelsRec
    raise Exception(msg)
Exception: Unusable Level 0!
Raised at lineno: 685

And I'm using essentially the same graph data as before. But what's different here is presumably some aspect of the GML representation, because this time the graph is coming from some of my own code, rather than from yEd.

It's possible that it's my GML serializer that's broken. It's very crude, as will be obvious from looking at the output. But yEd can read it okay (and after it's tidied up the graph and transformed the output, HOLA processes the results just fine).

Anyway the offending file is here:

arc.gml.txt

skieffer commented 8 years ago

Rats -- I was a bit hasty with the last fix and missed a possible sign change.

Your GML is fine, as far as I can tell. This run just happened to trigger a case the last one didn't, and one that I had overlooked.

Thanks for letting me know! Keep 'em coming.