Skip to content

Commit 0e34de9

Browse files
authored
disable verbosity by default when directly using Pyro() (#231)
Now in a notebook, we don't get the "pyro..." message or the message from the initial conditions. This can still be overridden by passing a verbosity into Pyro() via the parameters dictionary.
1 parent 5834466 commit 0e34de9

File tree

35 files changed

+146
-184
lines changed

35 files changed

+146
-184
lines changed

examples/examples.ipynb

Lines changed: 74 additions & 136 deletions
Large diffs are not rendered by default.

pyro/advection/problems/smooth.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010

1111
def init_data(my_data, rp):
1212
""" initialize the smooth advection problem """
13-
del rp # this problem doesn't use runtime params
1413

15-
msg.bold("initializing the smooth advection problem...")
14+
if rp.get_param("driver.verbose"):
15+
msg.bold("initializing the smooth advection problem...")
1616

1717
# make sure that we are passed a valid patch object
1818
if not isinstance(my_data, patch.CellCenterData2d):

pyro/advection/problems/tophat.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88

99
def init_data(myd, rp):
1010
""" initialize the tophat advection problem """
11-
del rp # this problem doesn't use runtime params
1211

13-
msg.bold("initializing the tophat advection problem...")
12+
if rp.get_param("driver.verbose"):
13+
msg.bold("initializing the tophat advection problem...")
1414

1515
# make sure that we are passed a valid patch object
1616
if not isinstance(myd, patch.CellCenterData2d):

pyro/advection_nonuniform/problems/slotted.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@
88

99
def init_data(my_data, rp):
1010
""" initialize the slotted advection problem """
11-
msg.bold("initializing the slotted advection problem...")
11+
12+
if rp.get_param("driver.verbose"):
13+
msg.bold("initializing the slotted advection problem...")
1214

1315
# make sure that we are passed a valid patch object
1416
if not isinstance(my_data, patch.CellCenterData2d):

pyro/burgers/problems/converge.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010

1111
def init_data(my_data, rp):
1212
""" initialize the smooth burgers convergence problem """
13-
del rp # this problem doesn't use runtime params
1413

15-
msg.bold("initializing the smooth burgers convergence problem...")
14+
if rp.get_param("driver.verbose"):
15+
msg.bold("initializing the smooth burgers convergence problem...")
1616

1717
# make sure that we are passed a valid patch object
1818
if not isinstance(my_data, patch.CellCenterData2d):

pyro/burgers/problems/test.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88

99
def init_data(myd, rp):
1010
""" initialize the burgers test problem """
11-
del rp # this problem doesn't use runtime params
1211

13-
msg.bold("initializing the burgers test problem...")
12+
if rp.get_param("driver.verbose"):
13+
msg.bold("initializing the burgers test problem...")
1414

1515
# make sure that we are passed a valid patch object
1616
if not isinstance(myd, patch.CellCenterData2d):

pyro/burgers/problems/tophat.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88

99
def init_data(myd, rp):
1010
""" initialize the tophat burgers problem """
11-
del rp # this problem doesn't use runtime params
1211

13-
msg.bold("initializing the tophat burgers problem...")
12+
if rp.get_param("driver.verbose"):
13+
msg.bold("initializing the tophat burgers problem...")
1414

1515
# make sure that we are passed a valid patch object
1616
if not isinstance(myd, patch.CellCenterData2d):

pyro/compressible/problems/acoustic_pulse.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ def init_data(myd, rp):
1212
"""initialize the acoustic_pulse problem. This comes from
1313
McCourquodale & Coella 2011"""
1414

15-
msg.bold("initializing the acoustic pulse problem...")
15+
if rp.get_param("driver.verbose"):
16+
msg.bold("initializing the acoustic pulse problem...")
1617

1718
# make sure that we are passed a valid patch object
1819
if not isinstance(myd, (patch.CellCenterData2d, fv.FV2d)):

pyro/compressible/problems/advect.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111
def init_data(my_data, rp):
1212
""" initialize a smooth advection problem for testing convergence """
1313

14-
msg.bold("initializing the advect problem...")
14+
if rp.get_param("driver.verbose"):
15+
msg.bold("initializing the advect problem...")
1516

1617
# make sure that we are passed a valid patch object
1718
if not isinstance(my_data, patch.CellCenterData2d):

pyro/compressible/problems/bubble.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111
def init_data(my_data, rp):
1212
""" initialize the bubble problem """
1313

14-
msg.bold("initializing the bubble problem...")
14+
if rp.get_param("driver.verbose"):
15+
msg.bold("initializing the bubble problem...")
1516

1617
# make sure that we are passed a valid patch object
1718
if not isinstance(my_data, patch.CellCenterData2d):

0 commit comments

Comments
 (0)