Skip to content

Commit

Permalink
Fix formal integral benchmark
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewfullard committed Jul 30, 2024
1 parent b1f869b commit ee38232
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions benchmarks/spectrum_formal_integral.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
import tardis.spectrum.formal_integral as formal_integral
from benchmarks.benchmark_base import BenchmarkBase

config.THREADING_LAYER='workqueue'
config.THREADING_LAYER = "workqueue"


class BenchmarkTransportMontecarloFormalIntegral(BenchmarkBase):
"""
Expand All @@ -33,12 +34,20 @@ def time_intensity_black_body(self, parameters):
# Benchmark for functions in FormalIntegrator class
def time_FormalIntegrator_functions(self):
FormalIntegrator = formal_integral.FormalIntegrator(
self.simulation_verysimple.simulation_state, self.simulation_verysimple.plasma, self.simulation_verysimple.transport
self.simulation_verysimple.simulation_state,
self.simulation_verysimple.plasma,
self.simulation_verysimple.transport,
)
FormalIntegrator.calculate_spectrum(
self.simulation_verysimple.spectrum_solver.spectrum_frequency_grid[
:-1
]
)
FormalIntegrator.calculate_spectrum(self.simulation_verysimple.spectrum_solver.spectrum_real_packets.frequency)
FormalIntegrator.make_source_function()
FormalIntegrator.generate_numba_objects()
FormalIntegrator.formal_integral(
self.simulation_verysimple.spectrum_solver.spectrum_real_packets.frequency,
1000
self.simulation_verysimple.spectrum_solver.spectrum_frequency_grid[
:-1
],
1000,
)

0 comments on commit ee38232

Please sign in to comment.