From 37e8e2a146b97cc4d2472ee34300c6cd2e7679a3 Mon Sep 17 00:00:00 2001 From: Min RK Date: Tue, 4 Apr 2017 16:36:42 +0200 Subject: [PATCH] comment display_id_map structure --- nbconvert/preprocessors/execute.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/nbconvert/preprocessors/execute.py b/nbconvert/preprocessors/execute.py index e17d5b41f..77eea43c7 100644 --- a/nbconvert/preprocessors/execute.py +++ b/nbconvert/preprocessors/execute.py @@ -11,7 +11,7 @@ except ImportError: from Queue import Empty # Py 2 -from traitlets import List, Unicode, Bool, Enum, Any, Type, default +from traitlets import List, Unicode, Bool, Enum, Any, Type, Dict, default from nbformat.v4 import output_from_msg from .base import Preprocessor @@ -161,7 +161,15 @@ def _km_default(self): raise ImportError("`nbconvert --execute` requires the jupyter_client package: `pip install jupyter_client`") return KernelManager - _display_id_map = {} + # mapping of locations of outputs with a given display_id + # tracks cell index and output index within cell.outputs for + # each appearance of the display_id + # { + # 'display_id': { + # cell_idx: [output_idx,] + # } + # } + _display_id_map = Dict() def preprocess(self, nb, resources): """