From 99b2a81780e2ca999b6fd4bebb9be9e3c2ec2393 Mon Sep 17 00:00:00 2001 From: Sumit112192 Date: Wed, 14 Aug 2024 17:27:43 +0530 Subject: [PATCH 1/3] Add status property to RPacketLastInteractionTracker --- tardis/transport/montecarlo/packet_trackers.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tardis/transport/montecarlo/packet_trackers.py b/tardis/transport/montecarlo/packet_trackers.py index 20db5244de6..b5792f6cf4d 100644 --- a/tardis/transport/montecarlo/packet_trackers.py +++ b/tardis/transport/montecarlo/packet_trackers.py @@ -4,6 +4,7 @@ import numpy as np import pandas as pd +from tardis.transport.montecarlo.r_packet import PacketStatus boundary_interaction_dtype = np.dtype( [ @@ -211,6 +212,7 @@ def rpacket_trackers_to_dataframe(rpacket_trackers): rpacket_last_interaction_tracker_spec = [ ("index", int64), + ("status", int64), ("r", float64), ("nu", float64), ("energy", float64), @@ -227,6 +229,8 @@ class RPacketLastInteractionTracker(object): ---------- index : int Index position of each RPacket + status : INT_ENUM + status of the RPacket whether it has been Reabsorbed or emiited. r : float Radius of the shell where the RPacket is present nu : float @@ -244,6 +248,7 @@ def __init__(self): Initialize properties with default values """ self.index = -1 + self.status = PacketStatus.IN_PROCESS self.r = -1.0 self.nu = 0.0 self.energy = 0.0 @@ -255,6 +260,7 @@ def track(self, r_packet): Track properties of RPacket and override the previous values """ self.index = r_packet.index + self.status = r_packet.status self.r = r_packet.r self.nu = r_packet.nu self.energy = r_packet.energy From 21614fa03b70ca3a67e41fbe378e1356904f15d8 Mon Sep 17 00:00:00 2001 From: Sumit112192 Date: Wed, 14 Aug 2024 17:29:08 +0530 Subject: [PATCH 2/3] Fix typo --- tardis/transport/montecarlo/packet_trackers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tardis/transport/montecarlo/packet_trackers.py b/tardis/transport/montecarlo/packet_trackers.py index b5792f6cf4d..5c7e1b2a861 100644 --- a/tardis/transport/montecarlo/packet_trackers.py +++ b/tardis/transport/montecarlo/packet_trackers.py @@ -230,7 +230,7 @@ class RPacketLastInteractionTracker(object): index : int Index position of each RPacket status : INT_ENUM - status of the RPacket whether it has been Reabsorbed or emiited. + status of the RPacket whether it has been reabsorbed or emitted. r : float Radius of the shell where the RPacket is present nu : float From 85787999dfd611d0d5f6799ffa02b93ef8b6e6e3 Mon Sep 17 00:00:00 2001 From: Sumit112192 Date: Fri, 30 Aug 2024 18:03:04 +0530 Subject: [PATCH 3/3] Docstring update --- tardis/transport/montecarlo/packet_trackers.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tardis/transport/montecarlo/packet_trackers.py b/tardis/transport/montecarlo/packet_trackers.py index 5c7e1b2a861..b8f803f5daf 100644 --- a/tardis/transport/montecarlo/packet_trackers.py +++ b/tardis/transport/montecarlo/packet_trackers.py @@ -229,8 +229,10 @@ class RPacketLastInteractionTracker(object): ---------- index : int Index position of each RPacket - status : INT_ENUM + status : ENUM status of the RPacket whether it has been reabsorbed or emitted. + 1: EMITTED + 2: REABSORBED r : float Radius of the shell where the RPacket is present nu : float