Skip to content

Commit

Permalink
Removed not necessary comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Knights-Templars committed Dec 3, 2024
1 parent 984b95e commit 0f9976e
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 16 deletions.
15 changes: 1 addition & 14 deletions tardis/energy_input/gamma_ray_packet_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -745,16 +745,6 @@ def create_packets(
decays_per_isotope["radiation"] == "g"
]

# sample packets from the gamma-ray lines at time = t0 : which is the start of the gamma-ray simulation
# sampled_packets_df_t0 = sampled_packets_df_gamma[sampled_packets_df_gamma.index.get_level_values("time") == self.times[0] * (u.s).to(u.d)]
# sample same number of packets as the gamma-ray lines at time = 0
# sampled_packets_df_gamma_t0 = sampled_packets_df_t0.sample(
# n=number_of_packets,
# weights="decay_energy_erg",
# replace=True,
# random_state=np.random.RandomState(self.base_seed),
# )

# sample packets from the time evolving dataframe
sampled_packets_df = sampled_packets_df_gamma.sample(

Check warning on line 749 in tardis/energy_input/gamma_ray_packet_source.py

View check run for this annotation

Codecov / codecov/patch

tardis/energy_input/gamma_ray_packet_source.py#L749

Added line #L749 was not covered by tests
n=number_of_packets,
Expand All @@ -771,15 +761,12 @@ def create_packets(
shells = sampled_packets_df.index.get_level_values("shell_number")

Check warning on line 761 in tardis/energy_input/gamma_ray_packet_source.py

View check run for this annotation

Codecov / codecov/patch

tardis/energy_input/gamma_ray_packet_source.py#L761

Added line #L761 was not covered by tests

# get the inner and outer velocity boundaries for each packet to compute
# the initial radii
sampled_packets_df["inner_velocity"] = self.inner_velocities[shells]
sampled_packets_df["outer_velocity"] = self.outer_velocities[shells]

# sample radii at time = 0
# The radii of the packets at what ever time they are emitted
initial_radii = self.create_packet_radii(sampled_packets_df)
# sample decay times

# TODO: Rewrite this without for loop. This is expensive
# get the time step index of the packets
decay_time_indices = sampled_packets_df.index.get_level_values("time_index")

Check warning on line 771 in tardis/energy_input/gamma_ray_packet_source.py

View check run for this annotation

Codecov / codecov/patch

tardis/energy_input/gamma_ray_packet_source.py#L771

Added line #L771 was not covered by tests

Expand Down
2 changes: 0 additions & 2 deletions tardis/energy_input/main_gamma_ray_loop.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,10 +206,8 @@ def run_gamma_ray_loop(
for i in range(num_decays)
]

time_current = []
for i, p in enumerate(packets):
total_energy[p.shell, p.time_index] += isotope_positron_fraction[i] * energy_per_packet

Check warning on line 210 in tardis/energy_input/main_gamma_ray_loop.py

View check run for this annotation

Codecov / codecov/patch

tardis/energy_input/main_gamma_ray_loop.py#L209-L210

Added lines #L209 - L210 were not covered by tests
time_current.append(p.time_start)

logger.info(f"Total energy deposited by the positrons is {total_energy.sum().sum()}")

Check warning on line 212 in tardis/energy_input/main_gamma_ray_loop.py

View check run for this annotation

Codecov / codecov/patch

tardis/energy_input/main_gamma_ray_loop.py#L212

Added line #L212 was not covered by tests

Expand Down

0 comments on commit 0f9976e

Please sign in to comment.