Skip to content

Commit

Permalink
Change parameters in benchmarks (#2782)
Browse files Browse the repository at this point in the history
* change parameters in benchmarks

Signed-off-by: Asish Kumar <[email protected]>

* change parameters in benchmarks

Signed-off-by: Asish Kumar <[email protected]>

---------

Signed-off-by: Asish Kumar <[email protected]>
  • Loading branch information
officialasishkumar authored Aug 12, 2024
1 parent 31fa786 commit 18dcec8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 12 deletions.
2 changes: 1 addition & 1 deletion benchmarks/opacities_opacity.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def time_photoabsorption_opacity_calculation(self):
)

def time_pair_creation_opacity_calculation(self):
energy = 255.9
energy = 1240
ejecta_density = 100000.009
iron_group_fraction = 0.5
calculate_opacity.pair_creation_opacity_calculation(
Expand Down
17 changes: 6 additions & 11 deletions benchmarks/transport_montecarlo_packet_trackers.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
from tardis.transport.montecarlo import packet_trackers


@parameterize({"num_packets": [10, 100], "length": [10, 50]})
class BenchmarkTransportMontecarloPacketTrackers(BenchmarkBase):
"""
Class to benchmark the numba R packet function.
Expand All @@ -18,21 +17,17 @@ class BenchmarkTransportMontecarloPacketTrackers(BenchmarkBase):
repeat = 2

@functools.cache
def setup(self, num_packets, length):
def setup(self):
sim = self.simulation_rpacket_tracking_enabled
self.TransportState = sim.transport.transport_state

def time_rpacket_trackers_to_dataframe(self, num_packets, length):
def time_rpacket_trackers_to_dataframe(self):
packet_trackers.rpacket_trackers_to_dataframe(
self.TransportState.rpacket_tracker
)

def time_generate_rpacket_tracker_list(self, num_packets, length):
packet_trackers.generate_rpacket_tracker_list(num_packets, length)
def time_generate_rpacket_tracker_list(self):
packet_trackers.generate_rpacket_tracker_list(50, 10)

def time_generate_rpacket_last_interaction_tracker_list(
self, num_packets, length
):
packet_trackers.generate_rpacket_last_interaction_tracker_list(
num_packets
)
def time_generate_rpacket_last_interaction_tracker_list(self):
packet_trackers.generate_rpacket_last_interaction_tracker_list(50)

0 comments on commit 18dcec8

Please sign in to comment.