diff --git a/holoviews/ipython/magics.py b/holoviews/ipython/magics.py index 6df0af4fdf..c66ced395b 100644 --- a/holoviews/ipython/magics.py +++ b/holoviews/ipython/magics.py @@ -91,7 +91,7 @@ def output(self, line, cell=None): print("\nFor help with the %output magic, call %output?") return - def cell_runner(cell): + def cell_runner(cell,renderer): self.shell.run_cell(cell, store_history=STORE_HISTORY) def warnfn(msg): diff --git a/holoviews/util/__init__.py b/holoviews/util/__init__.py index b0ca4bd46f..f21b6cb290 100644 --- a/holoviews/util/__init__.py +++ b/holoviews/util/__init__.py @@ -134,8 +134,13 @@ def __call__(self, *args, **options): if isinstance(obj, Dimensioned): if line: options = Store.output_settings.extract_keywords(line, {}) + for k in options.keys(): + if k not in Store.output_settings.allowed: + raise KeyError('Invalid keyword: %s' % k) if 'filename' in options: - Store.renderers[Store.current_backend].save(obj, options['filename']) + def save_fn(obj, renderer): renderer.save(obj, options['filename']) + Store.output_settings.output(line=line, cell=obj, cell_runner=save_fn, + help_prompt=help_prompt, **options) return obj elif obj is not None: return obj diff --git a/holoviews/util/settings.py b/holoviews/util/settings.py index 768a0e8e8b..eea8ab64b7 100644 --- a/holoviews/util/settings.py +++ b/holoviews/util/settings.py @@ -295,7 +295,7 @@ def output(cls, line=None, cell=None, cell_runner=None, return if cell is not None: - if cell_runner: cell_runner(cell) + if cell_runner: cell_runner(cell,renderer) # After cell restore previous options and restore # temporarily selected renderer OutputSettings.options = prev_restore