Skip to content

Commit c07f6a4

Browse files
authored
a few docs fixes (#284)
we don't need to turn off verbosity or I/O for Pyro() runs anymore
1 parent dfe5d1d commit c07f6a4

File tree

3 files changed

+60
-56
lines changed

3 files changed

+60
-56
lines changed

docs/source/compressible-convergence.ipynb

Lines changed: 30 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -69,31 +69,16 @@
6969
},
7070
{
7171
"cell_type": "code",
72-
"execution_count": null,
72+
"execution_count": 3,
7373
"id": "cc7c0964-e0cf-43f4-8ca8-3ea6ed11c9fd",
7474
"metadata": {},
75-
"outputs": [
76-
{
77-
"name": "stdout",
78-
"output_type": "stream",
79-
"text": [
80-
"\u001b[1mpyro ...\u001b[0m\n",
81-
"\u001b[1minitializing the acoustic pulse problem...\u001b[0m\n",
82-
"\u001b[1mpyro ...\u001b[0m\n",
83-
"\u001b[1minitializing the acoustic pulse problem...\u001b[0m\n",
84-
"\u001b[1mpyro ...\u001b[0m\n",
85-
"\u001b[1minitializing the acoustic pulse problem...\u001b[0m\n",
86-
"\u001b[1mpyro ...\u001b[0m\n",
87-
"\u001b[1minitializing the acoustic pulse problem...\u001b[0m\n"
88-
]
89-
}
90-
],
75+
"outputs": [],
9176
"source": [
9277
"sims = []\n",
9378
"\n",
9479
"for N in [32, 64, 128, 256]:\n",
9580
" dt = timestep(N)\n",
96-
" params = {\"driver.fix_dt\": dt, \"mesh.nx\": N, \"mesh.ny\": N, \"driver.verbose\": 0}\n",
81+
" params = {\"driver.fix_dt\": dt, \"mesh.nx\": N, \"mesh.ny\": N}\n",
9782
" p = Pyro(\"compressible\")\n",
9883
" p.initialize_problem(problem_name=\"acoustic_pulse\", inputs_dict=params)\n",
9984
" p.run_sim()\n",
@@ -111,7 +96,7 @@
11196
},
11297
{
11398
"cell_type": "code",
114-
"execution_count": null,
99+
"execution_count": 4,
115100
"id": "9705ab17-81c6-4b8a-becd-6a9af75371e1",
116101
"metadata": {},
117102
"outputs": [],
@@ -122,10 +107,20 @@
122107
},
123108
{
124109
"cell_type": "code",
125-
"execution_count": null,
110+
"execution_count": 5,
126111
"id": "97d051b5-563a-40ea-a838-9b4f7832380f",
127112
"metadata": {},
128-
"outputs": [],
113+
"outputs": [
114+
{
115+
"name": "stdout",
116+
"output_type": "stream",
117+
"text": [
118+
" 64 -> 32 : 0.0002674195946900653\n",
119+
"128 -> 64 : 5.7696409241208797e-05\n",
120+
"256 -> 128 : 1.3860268814816614e-05\n"
121+
]
122+
}
123+
],
129124
"source": [
130125
"for coarse, fine in pairwise(sims):\n",
131126
" cvar = coarse.get_var(var)\n",
@@ -161,7 +156,7 @@
161156
},
162157
{
163158
"cell_type": "code",
164-
"execution_count": null,
159+
"execution_count": 6,
165160
"id": "dd7a64cb-992e-4e0f-96f7-c8c03c0ca3eb",
166161
"metadata": {},
167162
"outputs": [],
@@ -170,7 +165,7 @@
170165
"\n",
171166
"for N in [32, 64, 128, 256]:\n",
172167
" dt = timestep(N)\n",
173-
" params = {\"driver.fix_dt\": dt, \"mesh.nx\": N, \"mesh.ny\": N, \"driver.verbose\": 0}\n",
168+
" params = {\"driver.fix_dt\": dt, \"mesh.nx\": N, \"mesh.ny\": N}\n",
174169
" p = Pyro(\"compressible_fv4\")\n",
175170
" p.initialize_problem(problem_name=\"acoustic_pulse\", inputs_dict=params)\n",
176171
" p.run_sim()\n",
@@ -179,10 +174,20 @@
179174
},
180175
{
181176
"cell_type": "code",
182-
"execution_count": null,
177+
"execution_count": 7,
183178
"id": "f03120c8-bc1d-4f0d-b79f-e498c64076a3",
184179
"metadata": {},
185-
"outputs": [],
180+
"outputs": [
181+
{
182+
"name": "stdout",
183+
"output_type": "stream",
184+
"text": [
185+
" 64 -> 32 : 6.519131423273572e-05\n",
186+
"128 -> 64 : 4.825569192556014e-06\n",
187+
"256 -> 128 : 3.0769222917915304e-07\n"
188+
]
189+
}
190+
],
186191
"source": [
187192
"for coarse, fine in pairwise(sims):\n",
188193
" cvar = coarse.get_var(var)\n",

docs/source/compressible-rt-compare.ipynb

Lines changed: 27 additions & 26 deletions
Large diffs are not rendered by default.

docs/source/running.rst

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,7 @@ Pyro class
5252
----------
5353

5454
Alternatively, pyro can be run using the :func:`Pyro <pyro.pyro_sim.Pyro>` class. This provides
55-
an interface that enables simulations to be set up and run in a Jupyter notebook -- see
56-
``examples/examples.ipynb`` for an example notebook. A simulation can be set up and run
55+
an interface that enables simulations to be set up and run in a Jupyter notebook. A simulation can be set up and run
5756
by carrying out the following steps:
5857

5958
* create a :func:`Pyro <pyro.pyro_sim.Pyro>` object, initializing it with a specific solver
@@ -67,7 +66,7 @@ Kelvin-Helmholtz problem ``kh``, we would do the following:
6766
6867
from pyro import Pyro
6968
p = Pyro("compressible")
70-
p.initialize_problem(problem_name="kh")
69+
p.initialize_problem("kh")
7170
p.run_sim()
7271
7372
This will use the default set of parameters for the problem specified
@@ -99,8 +98,7 @@ verbosity for the previous example, we would do:
9998
.. code-block:: python
10099
101100
parameters = {"driver.verbose": 1}
102-
p.initialize_problem(problem_name="kh",
103-
inputs_dict=parameters)
101+
p.initialize_problem("kh", inputs_dict=parameters)
104102
105103
It's possible to evolve the simulation forward timestep by timestep manually using
106104
the :func:`single_step <pyro.pyro_sim.Pyro.single_step>` function (rather than allowing

0 commit comments

Comments
 (0)