-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
recursive runtime error (when using template feature) #17
Comments
problem arises in the deepcopy command (ln 702). https://docs.python.org/2/library/copy.html
Using a standard (shallow) copy allows the layout to be loaded, and assigns all the correct figure / axis objects, but then produces an error in make_mplfigures(). In [11]: layout.make_mplfigures()AttributeError Traceback (most recent call last) /home/caveman/Documents/src/python/ANALYSIS/lib/python2.7/site-packages/figurefirst/svg_to_axes.pyc in make_mplfigures(self) /home/caveman/Documents/src/python/ANALYSIS/lib/python2.7/site-packages/figurefirst/svg_to_axes.pyc in flatten_dict(d) /home/caveman/Documents/src/python/ANALYSIS/lib/python2.7/site-packages/figurefirst/svg_to_axes.pyc in traverse(kl, d) /home/caveman/Documents/src/python/ANALYSIS/lib/python2.7/site-packages/figurefirst/svg_to_axes.pyc in traverse(kl, d) /home/caveman/Documents/src/python/ANALYSIS/lib/python2.7/site-packages/figurefirst/svg_to_axes.pyc in traverse(kl, d) AttributeError: 'unicode' object has no attribute 'items' In [12]: ax = layout.axes[(u'windypad_template', u'vinegar_60sccm')] |
Possible hacky solution: make it possible to clear the target layers BEFORE make_group_tree is called. This might require saving an intermediate svg file, which is then reloaded? |
Attached files include a layout which can be opened (layout = figurefirst.svg_to_axes.FigureLayout('figure1_output_test2_works.svg') with figurefirst, and one that is the output from my script, which produces the runtime error (layout = figurefirst.svg_to_axes.FigureLayout('figure1_output_test2.svg'). Deleting the layers added by figurefirst eliminates the runtime error.
Note: change .txt to .svg
figure1_output_test2_works.txt
figure1_output_test2.txt
Error:
File "/home/caveman/Documents/src/python/ANALYSIS/lib/python2.7/site-packages/figurefirst/svg_to_axes.py", line 541, in __init__ figuretree,grouptree,leafs,svgitemtree = self.make_group_tree() File "/home/caveman/Documents/src/python/ANALYSIS/lib/python2.7/site-packages/figurefirst/svg_to_axes.py", line 702, in make_group_tree newv = copy.deepcopy(figuretree[l.template_source]) File "/usr/lib/python2.7/copy.py", line 190, in deepcopy y = _reconstruct(x, rv, 1, memo) File "/usr/lib/python2.7/copy.py", line 334, in _reconstruct state = deepcopy(state, memo) File "/usr/lib/python2.7/copy.py", line 163, in deepcopy y = copier(x, memo) File "/usr/lib/python2.7/copy.py", line 257, in _deepcopy_dict y[deepcopy(key, memo)] = deepcopy(value, memo) File "/usr/lib/python2.7/copy.py", line 163, in deepcopy y = copier(x, memo)
The text was updated successfully, but these errors were encountered: