Skip to content

Commit

Permalink
Ensure renderer params are restored by OutputMagic
Browse files Browse the repository at this point in the history
  • Loading branch information
philippjfr committed Apr 12, 2017
1 parent 1285b99 commit 7a12f53
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions holoviews/ipython/magics.py
Expand Up @@ -346,6 +346,9 @@ def output(self, line, cell=None):

restore_copy = OrderedDict(OutputMagic.options.items())
prev_backend = Store.current_backend
renderer = Store.renderers[prev_backend]
render_params = [(k, v) for k, v in renderer.get_param_values()
if k in self.render_params]
try:
options = OrderedDict([(k, v) for k, v in OutputMagic.options.items()
if k in self.remembered])
Expand All @@ -355,15 +358,15 @@ def output(self, line, cell=None):
OutputMagic.options = new_options
except Exception as e:
OutputMagic.options = restore_copy
self._set_render_options(restore_copy, prev_backend)
self._set_render_options(dict(render_params, **restore_copy), prev_backend)
print('Error: %s' % str(e))
print("For help with the %output magic, call %output?\n")
return

if cell is not None:
self.shell.run_cell(cell, store_history=STORE_HISTORY)
OutputMagic.options = restore_copy
self._set_render_options(restore_copy, prev_backend)
self._set_render_options(dict(render_params, **restore_copy), prev_backend)


@classmethod
Expand Down

0 comments on commit 7a12f53

Please sign in to comment.