From 1eb651ecf71d18340643b51047f4e58f7b0d8f08 Mon Sep 17 00:00:00 2001 From: Atharva Arya Date: Sun, 19 Dec 2021 13:29:13 +0530 Subject: [PATCH 1/2] Pass virtual_packet_logging as an argument in montecarlo main loop --- tardis/montecarlo/montecarlo_numba/base.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tardis/montecarlo/montecarlo_numba/base.py b/tardis/montecarlo/montecarlo_numba/base.py index dbac64d17e1..27b762b5382 100644 --- a/tardis/montecarlo/montecarlo_numba/base.py +++ b/tardis/montecarlo/montecarlo_numba/base.py @@ -85,6 +85,7 @@ def montecarlo_radial1d( runner.spectrum_frequency.value, number_of_vpackets, packet_seeds, + montecarlo_configuration.VPACKET_LOGGING, iteration=iteration, show_progress_bars=show_progress_bars, no_of_packets=no_of_packets, @@ -134,6 +135,7 @@ def montecarlo_main_loop( spectrum_frequency, number_of_vpackets, packet_seeds, + virtual_packet_logging, iteration, show_progress_bars, no_of_packets, @@ -262,7 +264,7 @@ def montecarlo_main_loop( continue v_packets_energy_hist[idx] += vpackets_energy[j] - if montecarlo_configuration.VPACKET_LOGGING: + if virtual_packet_logging: for vpacket_collection in vpacket_collections: vpackets_nu = vpacket_collection.nus[: vpacket_collection.idx] vpackets_energy = vpacket_collection.energies[ From 5a730d9cfe0dc1d451a210e024930318117d8d69 Mon Sep 17 00:00:00 2001 From: Atharva Arya Date: Fri, 24 Dec 2021 18:44:00 +0530 Subject: [PATCH 2/2] Add docstring --- tardis/montecarlo/montecarlo_numba/base.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tardis/montecarlo/montecarlo_numba/base.py b/tardis/montecarlo/montecarlo_numba/base.py index 27b762b5382..6f722871a34 100644 --- a/tardis/montecarlo/montecarlo_numba/base.py +++ b/tardis/montecarlo/montecarlo_numba/base.py @@ -155,6 +155,8 @@ def montecarlo_main_loop( number_of_vpackets : int VPackets released per interaction packet_seeds : numpy.array + virtual_packet_logging : bool + Option to enable virtual packet logging. """ output_nus = np.empty_like(packet_collection.packets_output_nu) last_interaction_types = (