Skip to content

Commit 5531e70

Browse files
committed
stderr
1 parent 1718baf commit 5531e70

File tree

1 file changed

+29
-21
lines changed

1 file changed

+29
-21
lines changed

tests/notebooks/config_InlineBackend.ipynb

Lines changed: 29 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,15 @@
55
"execution_count": 1,
66
"id": "e4221445-5518-4984-b731-aaf9840141d8",
77
"metadata": {},
8-
"outputs": [],
8+
"outputs": [
9+
{
10+
"name": "stderr",
11+
"output_type": "stream",
12+
"text": [
13+
"TODO: Probably need --nbval-current-env\n"
14+
]
15+
}
16+
],
917
"source": [
1018
"%matplotlib inline\n",
1119
"%config InlineBackend.figure_formats = 'jpeg'\n",
@@ -16,7 +24,10 @@
1624
"\n",
1725
"import matplotlib.pyplot as plt\n",
1826
"from matplotlib_inline.backend_inline import set_matplotlib_formats\n",
19-
"# TODO: --nbval-current-env"
27+
"from traitlets.config import get_config\n",
28+
"\n",
29+
"import sys\n",
30+
"print(\"TODO: Probably need --nbval-current-env\", file=sys.stderr)"
2031
]
2132
},
2233
{
@@ -127,31 +138,28 @@
127138
"metadata": {},
128139
"outputs": [
129140
{
130-
"name": "stdout",
131-
"output_type": "stream",
132-
"text": [
133-
"{'IPKernelApp': {'connection_file': 'C:\\\\Users\\\\leo\\\\AppData\\\\Roaming\\\\jupyter\\\\runtime\\\\kernel-f8c8036d-dc80-4842-ab30-cb8a4413327d.json'},\n",
134-
" 'InlineBackend': {'figure_formats': {'png', 'jpeg'},\n",
135-
" 'print_figure_kwargs': {'bbox_inches': None,\n",
136-
" 'pil_kwargs': {'quality': 90}}}}\n"
137-
]
141+
"data": {
142+
"text/plain": [
143+
"{'IPKernelApp': {'connection_file': '/Users/leo/Library/Jupyter/runtime/kernel-fd702e07-f2dc-45ba-b31a-62608c076402.json'},\n",
144+
" 'InlineBackend': {'figure_formats': {'jpeg', 'png'},\n",
145+
" 'print_figure_kwargs': {'bbox_inches': None, 'pil_kwargs': {'quality': 90}}}}"
146+
]
147+
},
148+
"execution_count": 5,
149+
"metadata": {},
150+
"output_type": "execute_result"
138151
}
139152
],
140153
"source": [
141154
"#NBVAL_IGNORE_OUTPUT\n",
142155
"# For demonstration purposes only, the Inline Back-end\n",
143156
"# configuration does not change.\n",
144-
"try:\n",
145-
" import pprint\n",
146-
" from traitlets.config import get_config\n",
147-
" c = get_config()\n",
148-
" c.InlineBackend.figure_formats = {'png', 'jpeg'}\n",
149-
" c.InlineBackend.print_figure_kwargs.update({\n",
150-
" 'pil_kwargs': {'quality' : 90}\n",
151-
" })\n",
152-
" pprint.pprint(c)\n",
153-
"except ImportError as e:\n",
154-
" print(e)"
157+
"c = get_config()\n",
158+
"c.InlineBackend.figure_formats = {'png', 'jpeg'}\n",
159+
"c.InlineBackend.print_figure_kwargs.update({\n",
160+
" 'pil_kwargs': {'quality' : 90}\n",
161+
" })\n",
162+
"c"
155163
]
156164
}
157165
],

0 commit comments

Comments
 (0)