Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add status to r packet last interaction tracker #2796

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions tardis/transport/montecarlo/packet_trackers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
[
Expand Down Expand Up @@ -211,6 +212,7 @@

rpacket_last_interaction_tracker_spec = [
("index", int64),
("status", int64),
("r", float64),
("nu", float64),
("energy", float64),
Expand All @@ -227,6 +229,10 @@
----------
index : int
Index position of each RPacket
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
Expand All @@ -244,6 +250,7 @@
Initialize properties with default values
"""
self.index = -1
self.status = PacketStatus.IN_PROCESS

Check warning on line 253 in tardis/transport/montecarlo/packet_trackers.py

View check run for this annotation

Codecov / codecov/patch

tardis/transport/montecarlo/packet_trackers.py#L253

Added line #L253 was not covered by tests
self.r = -1.0
self.nu = 0.0
self.energy = 0.0
Expand All @@ -255,6 +262,7 @@
Track properties of RPacket and override the previous values
"""
self.index = r_packet.index
self.status = r_packet.status

Check warning on line 265 in tardis/transport/montecarlo/packet_trackers.py

View check run for this annotation

Codecov / codecov/patch

tardis/transport/montecarlo/packet_trackers.py#L265

Added line #L265 was not covered by tests
self.r = r_packet.r
self.nu = r_packet.nu
self.energy = r_packet.energy
Expand Down
Loading