From 2a738730970b0475e4f65e02853db9e22ed39d97 Mon Sep 17 00:00:00 2001 From: Thomas Wiecki Date: Mon, 9 Jun 2014 17:17:37 +0200 Subject: [PATCH] BUG: Remove output arg before calling run_pipeline The IPython magic still created an output file because the output argument was only removed after the pipeline was run. This fix simply removes the argument before the call to run_pipline() when running the IPython magic. --- zipline/utils/cli.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/zipline/utils/cli.py b/zipline/utils/cli.py index c3d2307f..e5681fd0 100644 --- a/zipline/utils/cli.py +++ b/zipline/utils/cli.py @@ -121,11 +121,12 @@ def parse_cell_magic(line, cell): if not local_namespace: args['namespace'] = get_ipython().user_ns # flake8: noqa - perf = run_pipeline(print_algo=False, algo_text=cell, **args) - # If we are running inside NB, do not output to file but create a # variable instead output_var_name = args.pop('output', None) + + perf = run_pipeline(print_algo=False, algo_text=cell, **args) + if output_var_name is not None: get_ipython().user_ns[output_var_name] = perf # flake8: noqa