Skip to content

Commit 3e0ed34

Browse files
authored
update the docs on running Pyro (#276)
we've changed how parameters work since this was last updated.
1 parent c737549 commit 3e0ed34

1 file changed

Lines changed: 27 additions & 9 deletions

File tree

docs/source/running.rst

Lines changed: 27 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -74,16 +74,31 @@ This will use the default set of parameters for the problem specified
7474
in the inputs file defined by ``DEFAULT_INPUTS`` in the problem
7575
initialization module.
7676

77+
.. note::
78+
79+
By default, I/O, visualization, and verbosity are disabled when we run in Jupyter.
80+
7781
Instead of using an inputs file to define the problem parameters, we can define a
7882
dictionary of parameters and pass them into the :func:`initialize_problem
7983
<pyro.pyro_sim.Pyro.initialize_problem>` function using the keyword argument ``inputs_dict``.
8084
If an inputs file is also passed into the function, the parameters in the dictionary
81-
will override any parameters in the file. For example, if we wished to turn off
82-
visualization for the previous example, we would do:
85+
will override any parameters in the file.
86+
87+
.. tip::
88+
89+
If you want to see all of the runtime parameters and their current values, you can
90+
simply print the ``Pyro`` object:
91+
92+
.. code:: python
93+
94+
print(p)
95+
96+
For example, if we wished to turn on
97+
verbosity for the previous example, we would do:
8398

8499
.. code-block:: python
85100
86-
parameters = {"vis.dovis": 0}
101+
parameters = {"driver.verbose": 1}
87102
p.initialize_problem(problem_name="kh",
88103
inputs_dict=parameters)
89104
@@ -112,15 +127,18 @@ parameters are stored in three places:
112127

113128
* the ``pyro/_defaults`` file
114129
* the solver's ``_defaults`` file
115-
* problem's ``_defaults`` file (named ``_problem-name.defaults`` in the
116-
solver's ``problem/`` sub-directory).
130+
* problem-specific parameters: each problem module provides a dictionary
131+
called ``PROBLEM_PARAMS`` that is used to define the problem-specific
132+
parameters and their defaults.
117133

118-
These three files are parsed at runtime to define the list of valid
134+
These defaults are parsed at runtime to define the list of valid
119135
parameters. The inputs file is read next and used to override the
120136
default value of any of these previously defined
121-
parameters. Additionally, any parameter can be specified at the end of
122-
the commandline, and these will be used to override the defaults. The
123-
collection of runtime parameters is stored in a
137+
parameters. Then any parameters passed to ``Pyro`` via a dictionary
138+
or added to the commandline when using ``pyro_sim.py`` are parsed
139+
and override the current values.
140+
141+
The collection of runtime parameters is stored in a
124142
:func:`RuntimeParameters <pyro.util.runparams.RuntimeParameters>` object.
125143

126144
The ``runparams.py`` module in ``util/`` controls access to the runtime

0 commit comments

Comments
 (0)