Skip to content

Commit

Permalink
Move OUTSIDE_EJECTA to PacketStatus ENUM
Browse files Browse the repository at this point in the history
  • Loading branch information
Sumit112192 committed Jul 30, 2024
1 parent a542b37 commit edd7f43
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
6 changes: 1 addition & 5 deletions tardis/transport/montecarlo/r_packet.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,7 @@ class PacketStatus(IntEnum):
EMITTED = 1
REABSORBED = 2
ADIABATIC_COOLING = 4


class PacketEjectaStatus(IntEnum):
OUT_EJECTA = -1
IN_EJECTA = 1
OUTSIDE_EJECTA = -1


rpacket_spec = [
Expand Down
5 changes: 2 additions & 3 deletions tardis/transport/montecarlo/single_packet_loop.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
from tardis.transport.montecarlo.r_packet import (
InteractionType,
PacketStatus,
PacketEjectaStatus,
)
from tardis.transport.montecarlo.r_packet_transport import (
move_packet_across_shell_boundary,
Expand Down Expand Up @@ -87,7 +86,7 @@ def single_packet_loop(

rpacket_tracker.track(r_packet)
rpacket_tracker.track_boundary_interaction(

Check warning on line 88 in tardis/transport/montecarlo/single_packet_loop.py

View check run for this annotation

Codecov / codecov/patch

tardis/transport/montecarlo/single_packet_loop.py#L88

Added line #L88 was not covered by tests
PacketEjectaStatus.OUT_EJECTA, r_packet.current_shell_id
PacketStatus.OUTSIDE_EJECTA, r_packet.current_shell_id
)

# this part of the code is temporary and will be better incorporated
Expand Down Expand Up @@ -178,7 +177,7 @@ def single_packet_loop(
temp_next_shell_id = (

Check warning on line 177 in tardis/transport/montecarlo/single_packet_loop.py

View check run for this annotation

Codecov / codecov/patch

tardis/transport/montecarlo/single_packet_loop.py#L177

Added line #L177 was not covered by tests
r_packet.current_shell_id
if r_packet.status == PacketStatus.IN_PROCESS
else PacketEjectaStatus.OUT_EJECTA
else PacketStatus.OUTSIDE_EJECTA
)
rpacket_tracker.track_boundary_interaction(

Check warning on line 182 in tardis/transport/montecarlo/single_packet_loop.py

View check run for this annotation

Codecov / codecov/patch

tardis/transport/montecarlo/single_packet_loop.py#L182

Added line #L182 was not covered by tests
temp_current_shell_id, temp_next_shell_id
Expand Down

0 comments on commit edd7f43

Please sign in to comment.