Skip to content

Commit

Permalink
MonteCarlo packet progress bar completes to 100% (tardis-sn#2237)
Browse files Browse the repository at this point in the history
* Refresh packet progress bar after every iteration

* Udpdated .mailmap

* Reformatted with black
  • Loading branch information
shreyas3156 authored and smokestacklightnin committed Mar 21, 2023
1 parent 59a1719 commit 5796140
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .mailmap
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,9 @@ Sampark Sharma <[email protected]>
Shilpi Prasad <[email protected]>
Shilpi Prasad <[email protected]> Shilpi <[email protected]>

Shreyas Singh <[email protected]>
Shreyas Singh <[email protected]> shreyas3156 <[email protected]>

Satwik Kambham <[email protected]>
Satwik Kambham <[email protected]> code-explorer <[email protected]>

Expand Down
7 changes: 6 additions & 1 deletion tardis/montecarlo/montecarlo_numba/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,11 @@
)
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 +132,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 5796140

Please sign in to comment.