You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi Sean, I really like this project, and have just started to try it out.
Unfortunately, the current state as I've cloned seems to have some problems exporting images, which I think is related to where the Link objects pattern, color, and width attributes live.
I've managed to hack around this (see 565b459), but maybe not in the most robust way.
First off, at the current HEAD of 76859c5, running the export.py example crashes with AttributeError: 'Scene' object has no attribute 'addComponent'. Taking out the addComponent lines (which maybe aren't necessary anymore?), crashes with the following trace:
Traceback (most recent call last):
File "export.py", line 65, in <module>
view.export(path, fileFormat=fileFormat)
File "../optivis/view/svg.py", line 96, in export
svgByteString = unicode.encode(self.getSvgString(size=size))
File "../optivis/view/svg.py", line 138, in getSvgString
svgLink.draw(drawElement)
File "../optivis/view/svg.py", line 265, in draw
if len(self.link.pattern) > 0:
AttributeError: 'Link' object has no attribute 'pattern'
Probably relatedly, some tests related to links crash:
======================================================================
FAIL: test_invalid_pattern (optivis.bench.test_links.TestLinkAttributes)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/ericq/Developer/optivis/optivis/bench/test_links.py", line 62, in test_invalid_pattern
self.assertRaises(Exception, setattr, self.link, 'pattern', str('invalid'))
AssertionError: Exception not raised
======================================================================
FAIL: test_invalid_width (optivis.bench.test_links.TestLinkAttributes)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/ericq/Developer/optivis/optivis/bench/test_links.py", line 49, in test_invalid_width
self.assertRaises(Exception, setattr, self.link, 'width', -2)
AssertionError: Exception not raised
======================================================================
FAIL: test_invalid_length (optivis.bench.test_links.TestLinkInstantiation)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/ericq/Developer/optivis/optivis/bench/test_links.py", line 38, in test_invalid_length
self.assertRaises(TypeError, links.Link, self.componentA.getOutputNode('out'), self.componentB.getInputNode('fr'), None)
AssertionError: TypeError not raised
My workaround in 565b459 was just to edit view/svg.py to look for link.specs[0].pattern instead of self.link.pattern, and similar for color and width. I can't claim to have enough understanding of your code to know if this is a robust way to fix this, though.
I'm running Python 2.7.10 (from Anaconda 2.4.0) on OS X 10.11.1, just FYI.
The text was updated successfully, but these errors were encountered:
Hi Eric, thanks for this report. It looks like I forgot to update a few examples and the SVG export code when I changed the way you add links.
Could you open a pull request, please? It looks like your fixes are exactly what was required. I'm a little busy right now but next week I should have time to patch this up.
Hi Sean, I really like this project, and have just started to try it out.
Unfortunately, the current state as I've cloned seems to have some problems exporting images, which I think is related to where the Link objects
pattern
,color
, andwidth
attributes live.I've managed to hack around this (see 565b459), but maybe not in the most robust way.
First off, at the current HEAD of 76859c5, running the
export.py
example crashes withAttributeError: 'Scene' object has no attribute 'addComponent'
. Taking out theaddComponent
lines (which maybe aren't necessary anymore?), crashes with the following trace:Probably relatedly, some tests related to links crash:
My workaround in 565b459 was just to edit
view/svg.py
to look forlink.specs[0].pattern
instead ofself.link.pattern
, and similar forcolor
andwidth
. I can't claim to have enough understanding of your code to know if this is a robust way to fix this, though.I'm running Python 2.7.10 (from Anaconda 2.4.0) on OS X 10.11.1, just FYI.
The text was updated successfully, but these errors were encountered: