Skip to content

Commit 0a1d5bb

Browse files
author
starkp
committed
display code block slightly nicer on JupyterHub
1 parent 25b1ed9 commit 0a1d5bb

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

day5/.master/03-GT4Py-stencil2d.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,11 +127,11 @@
127127
"<div class=\"alert alert-block alert-info\">\n",
128128
"<b>Now it's your turn...</b><br>\n",
129129
"<b>2.</b> Write a field operator called <tt>diffusion</tt> which performs the same operations as the following lines in <tt>stencil2d.py</tt>:<br>\n",
130-
"<code>laplacian( in_field, tmp_field, num_halo=num_halo, extend=1 )\n",
130+
"<pre><code>laplacian( in_field, tmp_field, num_halo=num_halo, extend=1 )\n",
131131
" laplacian( tmp_field, out_field, num_halo=num_halo, extend=0 )\n",
132132
" out_field[:, num_halo:-num_halo, num_halo:-num_halo] = \\\n",
133133
" in_field[:, num_halo:-num_halo, num_halo:-num_halo] \\\n",
134-
" - alpha * out_field[:, num_halo:-num_halo, num_halo:-num_halo] </code><br>\n",
134+
" - alpha * out_field[:, num_halo:-num_halo, num_halo:-num_halo] </code></pre>\n",
135135
"The function receives the input field <tt>in_field</tt>, the output field <tt>out_field</tt> and the scalar coefficient <tt>alpha</tt>. Assume grid point values are stored as <tt>float</tt>s. Import and call the <tt>laplacian</tt> subroutine.<br>\n",
136136
"<b>3.</b> Instantiate the field operator with the two different backends.\n",
137137
"</div>"

day5/03-GT4Py-stencil2d.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,11 +104,11 @@
104104
"<div class=\"alert alert-block alert-info\">\n",
105105
"<b>Now it's your turn...</b><br>\n",
106106
"<b>2.</b> Write a field operator called <tt>diffusion</tt> which performs the same operations as the following lines in <tt>stencil2d.py</tt>:<br>\n",
107-
"<code>laplacian( in_field, tmp_field, num_halo=num_halo, extend=1 )\n",
107+
"<pre><code>laplacian( in_field, tmp_field, num_halo=num_halo, extend=1 )\n",
108108
" laplacian( tmp_field, out_field, num_halo=num_halo, extend=0 )\n",
109109
" out_field[:, num_halo:-num_halo, num_halo:-num_halo] = \\\n",
110110
" in_field[:, num_halo:-num_halo, num_halo:-num_halo] \\\n",
111-
" - alpha * out_field[:, num_halo:-num_halo, num_halo:-num_halo] </code><br>\n",
111+
" - alpha * out_field[:, num_halo:-num_halo, num_halo:-num_halo] </code></pre>\n",
112112
"The function receives the input field <tt>in_field</tt>, the output field <tt>out_field</tt> and the scalar coefficient <tt>alpha</tt>. Assume grid point values are stored as <tt>float</tt>s. Import and call the <tt>laplacian</tt> subroutine.<br>\n",
113113
"<b>3.</b> Instantiate the field operator with the two different backends.\n",
114114
"</div>"

0 commit comments

Comments
 (0)