Skip to content

Commit 7860a1f

Browse files
authored
Pyro.run_sim() should not return the simulation object (#232)
add an explicit get method to get it
1 parent b15e3e6 commit 7860a1f

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

pyro/pyro_sim.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -196,8 +196,6 @@ def run_sim(self):
196196

197197
self.sim.finalize()
198198

199-
return self.sim
200-
201199
def single_step(self):
202200
"""
203201
Do a single step
@@ -253,9 +251,9 @@ def __repr__(self):
253251
return s
254252

255253
def get_var(self, v):
256-
"""
257-
Alias for cc_data's get_var routine, returns the cell-centered data
258-
given the variable name v.
254+
"""Alias for the data's get_var routine, returns the
255+
simulation data given the variable name v.
256+
259257
"""
260258

261259
if not self.is_initialized:
@@ -264,15 +262,19 @@ def get_var(self, v):
264262
return self.sim.cc_data.get_var(v)
265263

266264
def get_grid(self):
267-
"""
268-
Return the underlying grid object for the simulation
265+
"""Return the underlying grid object for the simulation
266+
269267
"""
270268

271269
if not self.is_initialized:
272270
msg.fail("ERROR: problem has not been initialized")
273271

274272
return self.sim.cc_data.grid
275273

274+
def get_sim(self):
275+
"""Return the Simulation object"""
276+
return self.sim
277+
276278

277279
class PyroBenchmark(Pyro):
278280
"""

0 commit comments

Comments
 (0)