Skip to content

Commit fe7bad3

Browse files
committed
MNT: correct outdated docstrings and improve function naming.
1 parent abe5747 commit fe7bad3

File tree

1 file changed

+9
-19
lines changed

1 file changed

+9
-19
lines changed

rocketpy/simulation/monte_carlo.py

Lines changed: 9 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -304,9 +304,9 @@ def __run_in_serial(self):
304304
self._output_file,
305305
)
306306

307-
sim_monitor.update_status(sim_monitor.count)
307+
sim_monitor.print_update_status(sim_monitor.count)
308308

309-
sim_monitor.finalize_status()
309+
sim_monitor.print_final_status()
310310

311311
except KeyboardInterrupt:
312312
MonteCarlo._reprint("Keyboard Interrupt, files saved.")
@@ -398,7 +398,7 @@ def __run_in_parallel(self, n_workers=None):
398398

399399
sim_consumer.join()
400400

401-
sim_monitor.finalize_status()
401+
sim_monitor.print_final_status()
402402

403403
@staticmethod
404404
def __sim_producer(
@@ -458,7 +458,7 @@ def __sim_producer(
458458
export_queue.put((inputs_dict, outputs_dict))
459459

460460
mutex.acquire()
461-
sim_monitor.update_status(sim_idx)
461+
sim_monitor.print_update_status(sim_idx)
462462
mutex.release()
463463

464464
except Exception as error:
@@ -1310,15 +1310,15 @@ def increment(self):
13101310
self.count += 1
13111311
return self.count
13121312

1313-
def update_status(self, sim_idx):
1313+
def print_update_status(self, sim_idx):
13141314
"""Prints a message on the same line as the previous one and replaces
13151315
the previous message with the new one, deleting the extra characters
13161316
from the previous message.
13171317
13181318
Parameters
13191319
----------
1320-
msg : str
1321-
Message to be printed.
1320+
sim_idx : int
1321+
Index of the current simulation.
13221322
13231323
Returns
13241324
-------
@@ -1333,18 +1333,8 @@ def update_status(self, sim_idx):
13331333

13341334
MonteCarlo._reprint(msg, end="\r", flush=True)
13351335

1336-
def finalize_status(self):
1337-
"""Prints the final status of the simulation.
1338-
1339-
Parameters
1340-
----------
1341-
show_process_time : bool, optional
1342-
If True, the process time will be shown. Default is True.
1343-
1344-
Returns
1345-
-------
1346-
None
1347-
"""
1336+
def print_final_status(self):
1337+
"""Prints the final status of the simulation."""
13481338
print()
13491339
performed_sims = self.count - self.initial_count
13501340
msg = f"Completed {performed_sims} iterations."

0 commit comments

Comments
 (0)