diff --git a/.mailmap b/.mailmap index 77a23a6afca..dcaec405867 100644 --- a/.mailmap +++ b/.mailmap @@ -81,6 +81,9 @@ Gaurav Gautam gautam1168 Gerrit Leck Gerrit Leck Gerrit Leck +Haleel Sada +Haleel Sada haleelsada + Isaac Smith Isaac Smith Isaac Smith <71480393+smithis7@users.noreply.github.com> Isaac Smith smithis7 <71480393+smithis7@users.noreply.github.com> diff --git a/benchmarks/benchmark_run_tardis.py b/benchmarks/benchmark_run_tardis.py index 7a62dc5822a..26f458015a9 100644 --- a/benchmarks/benchmark_run_tardis.py +++ b/benchmarks/benchmark_run_tardis.py @@ -2,19 +2,39 @@ import os from tardis.io.configuration.config_reader import Configuration from tardis import run_tardis +from astropy import units as u class Benchmarkruntardis: """Class to benchmark the run_tardis function. """ timeout = 200 - - def setup(self): + params = ['branch85_w7', 'uniform','power_law','exponential'] + param_names = ['Density'] + + def setup(self, density): filename = "tardis_configv1_benchmark.yml" dir_path = os.path.dirname(os.path.realpath(__file__)) path = os.path.join(dir_path, "data", filename) config = Configuration.from_yaml(path) config.atom_data = "kurucz_cd23_chianti_H_He.h5" + config.model.structure.density.type = density + config.model.structure.velocity.start = 1000 * u.km/u.s + config.model.structure.velocity.stop = 2000 * u.km/u.s + config.model.structure.velocity.num = 20 + if density == 'uniform': + config.model.structure.density.time_0 = 1 * u.day + config.model.structure.density.value = 5e-10 * u.kg/u.cm**3 + elif density == 'power_law': + config.model.structure.density.time_0 = 1 * u.day + config.model.structure.density.rho_0 = 5e-10 * u.kg/u.cm**3 + config.model.structure.density.v_0 = 500 * u.km/u.s + config.model.structure.density.exponent = -2 + elif density == 'exponential': + config.model.structure.density.time_0 = 1 * u.day + config.model.structure.density.rho_0 = 5e-10 * u.kg/u.cm**3 + config.model.structure.density.v_0 = 500 * u.km/u.s self.config = config - - def time_run_tardis(self): - sim = run_tardis(self.config, log_level="ERROR", show_progress_bars=False) + + def time_run_tardis(self,density): + sim = run_tardis(self.config, log_level="ERROR", + show_progress_bars=False) diff --git a/benchmarks/benchmark_sdec_plotter.py b/benchmarks/benchmark_sdec_plotter.py new file mode 100644 index 00000000000..01742096e5c --- /dev/null +++ b/benchmarks/benchmark_sdec_plotter.py @@ -0,0 +1,28 @@ +import os +from tardis.io.configuration.config_reader import Configuration +from tardis import run_tardis +from tardis.visualization import SDECPlotter + + +class BenchmarkSDECplotter: + """Class to benchmark Spectral element DEComposition (SDEC) Plot. + """ + timeout = 200 + + def setup(self): + filename = "tardis_configv1_benchmark.yml" + dir_path = os.path.dirname(os.path.realpath(__file__)) + path = os.path.join(dir_path, "data", filename) + config = Configuration.from_yaml(path) + config.atom_data = "kurucz_cd23_chianti_H_He.h5" + self.config = config + self.sim = run_tardis(self.config, virtual_packet_logging=True) + + def time_sdec_plot_mpl(self): + plotter = SDECPlotter.from_simulation(self.sim) + plotter.generate_plot_mpl() + + def time_sdec_plot_ply(self): + plotter = SDECPlotter.from_simulation(self.sim) + plotter.generate_plot_ply() +