diff --git a/.mailmap b/.mailmap index c7559728253..c5f66f95c32 100644 --- a/.mailmap +++ b/.mailmap @@ -112,6 +112,9 @@ Kevin Cawley KevinCawley <72036796+KevinCawley@users.noreply. Kevin Yap +Kim Lingemann kimsina +Kim Lingemann kim + Laud Bentil Laud Bentil Laud Bentil diff --git a/tardis/simulation/base.py b/tardis/simulation/base.py index e47b12916c6..18d7f63ad47 100644 --- a/tardis/simulation/base.py +++ b/tardis/simulation/base.py @@ -2,6 +2,7 @@ import logging import numpy as np import pandas as pd +import tardis from astropy import units as u from tardis import constants as const from collections import OrderedDict @@ -106,6 +107,8 @@ class Simulation(PlasmaStateStorerMixin, HDFWriterMixin): convergence_plots_kwargs: dict nthreads : int The number of threads to run montecarlo with + version: str + The TARDIS version in use when instantiating the simulation object .. note:: TARDIS must be built with OpenMP support in order for ``nthreads`` to have effect. @@ -157,6 +160,7 @@ def __init__( self.luminosity_requested = luminosity_requested self.nthreads = nthreads self.show_progress_bars = show_progress_bars + self.version = tardis.__version__ if convergence_strategy.type in ("damped"): self.convergence_strategy = convergence_strategy diff --git a/tardis/simulation/tests/test_simulation.py b/tardis/simulation/tests/test_simulation.py index 88f3daff827..f877a176d39 100644 --- a/tardis/simulation/tests/test_simulation.py +++ b/tardis/simulation/tests/test_simulation.py @@ -11,6 +11,7 @@ import pandas as pd import pandas.util.testing as pdt import astropy.units as u +import tardis @pytest.fixture(scope="module") @@ -156,3 +157,8 @@ def test_plasma_state_storer_reshape( # assert_quantity_allclose( # t_rad, simulation_compare_data['test1/t_rad'] * u.Unit('K'), atol=0.0 * u.Unit('K')) + + +def test_version_tag(simulation_without_loop): + simulation = simulation_without_loop + assert simulation.version == tardis.__version__