Skip to content

Commit

Permalink
Refresh packet progress bar after every iteration
Browse files Browse the repository at this point in the history
  • Loading branch information
shreyas3156 committed Mar 9, 2023
1 parent 239e04b commit 46a0f2e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tardis/montecarlo/montecarlo_numba/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
)
from tardis.montecarlo.montecarlo_numba import njit_dict
from numba.typed import List
from tardis.util.base import update_iterations_pbar, update_packet_pbar
from tardis.util.base import update_iterations_pbar, update_packet_pbar, refresh_packet_pbar


def montecarlo_radial1d(
Expand Down Expand Up @@ -128,6 +128,7 @@ def montecarlo_radial1d(
virt_packet_last_line_interaction_out_id
).ravel()
update_iterations_pbar(1)
refresh_packet_pbar()
# Condition for Checking if RPacket Tracking is enabled
if montecarlo_configuration.RPACKET_TRACKING:
runner.rpacket_tracker = rpacket_trackers
Expand Down
8 changes: 8 additions & 0 deletions tardis/util/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -699,6 +699,14 @@ def update_packet_pbar(i, current_iteration, no_of_packets, total_iterations):
packet_pbar.update(i)


def refresh_packet_pbar():
"""
Refresh packet progress bar after each iteration.
"""
packet_pbar.refresh()


def update_iterations_pbar(i):
"""
Update progress bar for each iteration.
Expand Down

0 comments on commit 46a0f2e

Please sign in to comment.