Skip to content

Commit 92605af

Browse files
authored
allow for "from pyro import Pyro" (#233)
1 parent 0e34de9 commit 92605af

File tree

7 files changed

+15
-12
lines changed

7 files changed

+15
-12
lines changed

docs/source/compressible-convergence.ipynb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@
2020
},
2121
{
2222
"cell_type": "code",
23-
"execution_count": 19,
23+
"execution_count": 1,
2424
"id": "0c19f42b-16f1-48a8-ba19-e07f5addabd1",
2525
"metadata": {},
2626
"outputs": [],
2727
"source": [
28-
"from pyro.pyro_sim import Pyro"
28+
"from pyro import Pyro"
2929
]
3030
},
3131
{
@@ -42,7 +42,7 @@
4242
},
4343
{
4444
"cell_type": "code",
45-
"execution_count": 20,
45+
"execution_count": 2,
4646
"id": "90900ff2-27b5-4642-a1de-006a9a30d975",
4747
"metadata": {},
4848
"outputs": [],
@@ -216,7 +216,7 @@
216216
"name": "python",
217217
"nbconvert_exporter": "python",
218218
"pygments_lexer": "ipython3",
219-
"version": "3.12.4"
219+
"version": "3.12.5"
220220
}
221221
},
222222
"nbformat": 4,

docs/source/running.rst

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,12 +65,15 @@ Kelvin-Helmholtz problem ``kh``, we would do the following:
6565

6666
.. code-block:: python
6767
68-
from pyro.pyro_sim import Pyro
68+
from pyro import Pyro
6969
p = Pyro("compressible")
70-
p.initialize_problem(problem_name="kh",
71-
inputs_file="inputs.kh")
70+
p.initialize_problem(problem_name="kh")
7271
p.run_sim()
7372
73+
This will use the default set of parameters for the problem specified
74+
in the inputs file defined by ``DEFAULT_INPUTS`` in the problem
75+
initialization module.
76+
7477
Instead of using an inputs file to define the problem parameters, we can define a
7578
dictionary of parameters and pass them into the :func:`initialize_problem
7679
<pyro.pyro_sim.Pyro.initialize_problem>` function using the keyword argument ``inputs_dict``.
@@ -82,7 +85,6 @@ visualization for the previous example, we would do:
8285
8386
parameters = {"vis.dovis": 0}
8487
p.initialize_problem(problem_name="kh",
85-
inputs_file="inputs.kh",
8688
inputs_dict=parameters)
8789
8890
It's possible to evolve the simulation forward timestep by timestep manually using

examples/examples.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"metadata": {},
1616
"outputs": [],
1717
"source": [
18-
"from pyro.pyro_sim import Pyro"
18+
"from pyro import Pyro"
1919
]
2020
},
2121
{

pyro/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,5 @@
99

1010
from pyro.mesh import (BC, ArrayIndexer, ArrayIndexerFC, CellCenterData2d,
1111
FaceCenterData2d, FV2d, Grid2d, RKIntegrator)
12+
from pyro.pyro_sim import Pyro
1213
from pyro.util import RuntimeParameters, TimerCollection

pyro/solver-test.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"metadata": {},
1616
"outputs": [],
1717
"source": [
18-
"from pyro.pyro_sim import Pyro"
18+
"from pyro import Pyro"
1919
]
2020
},
2121
{

pyro/solver_test_swe.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"metadata": {},
77
"outputs": [],
88
"source": [
9-
"from pyro.pyro_sim import Pyro\n",
9+
"from pyro import Pyro\n",
1010
"solver = \"swe\""
1111
]
1212
},

pyro/tests/test_pyro.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import numpy as np
22
from numpy.testing import assert_array_equal
33

4-
from pyro.pyro_sim import Pyro
4+
from pyro import Pyro
55

66

77
class TestSimulation:

0 commit comments

Comments
 (0)