From 4d2d54ab8fb1971c7261c3b26edc21a598f68a12 Mon Sep 17 00:00:00 2001 From: Wolfgang Kerzendorf Date: Fri, 22 Sep 2023 15:02:35 -0400 Subject: [PATCH 1/2] rename RadialModel1D to SimulationState --- tardis/grid/base.py | 4 +- tardis/io/model/model_reader.py | 4 +- tardis/io/model_reader.py | 4 +- tardis/io/tests/test_model_reader.py | 4 +- tardis/model/base.py | 2 +- tardis/model/tests/test_base.py | 156 +++++++++--------- tardis/model/tests/test_csvy_model.py | 8 +- tardis/model/tests/test_density.py | 6 +- .../montecarlo_numba/tests/conftest.py | 4 +- tardis/plasma/tests/test_nlte_solver.py | 2 +- .../tests/test_tardis_model_density_config.py | 4 +- tardis/simulation/base.py | 76 ++++----- tardis/simulation/tests/test_simulation.py | 6 +- tardis/tests/fixtures/atom_data.py | 4 +- .../integration_tests/test_integration.py | 4 +- tardis/visualization/tools/sdec_plot.py | 4 +- .../visualization/widgets/custom_abundance.py | 6 +- tardis/visualization/widgets/shell_info.py | 8 +- .../widgets/tests/test_shell_info.py | 10 +- 19 files changed, 158 insertions(+), 158 deletions(-) diff --git a/tardis/grid/base.py b/tardis/grid/base.py index 30fbe740f30..91599f5833d 100644 --- a/tardis/grid/base.py +++ b/tardis/grid/base.py @@ -4,7 +4,7 @@ import tardis from tardis.io.configuration.config_reader import Configuration -from tardis.model import Radial1DModel +from tardis.model import SimulationState def _set_tardis_config_property(tardis_config, key, value): @@ -108,7 +108,7 @@ def grid_row_to_model(self, row_index): model : tardis.model.base.Radial1DModel """ rowconfig = self.grid_row_to_config(row_index) - model = Radial1DModel.from_config(rowconfig) + model = SimulationState.from_config(rowconfig) return model def run_sim_from_grid(self, row_index, **tardiskwargs): diff --git a/tardis/io/model/model_reader.py b/tardis/io/model/model_reader.py index e388d65f1de..989157b620a 100644 --- a/tardis/io/model/model_reader.py +++ b/tardis/io/model/model_reader.py @@ -332,7 +332,7 @@ def model_from_hdf(fname): new_model : tardis.model.Radial1DModel """ - from tardis.model import Radial1DModel + from tardis.model import SimulationState d = {} @@ -371,7 +371,7 @@ def model_from_hdf(fname): d["time_explosion_cgs"], ) - new_model = Radial1DModel( + new_model = SimulationState( velocity=d["velocity_cgs"], density=homologous_density, abundance=d["abundance"], diff --git a/tardis/io/model_reader.py b/tardis/io/model_reader.py index b6080301a2c..2d512a65aa2 100644 --- a/tardis/io/model_reader.py +++ b/tardis/io/model_reader.py @@ -881,7 +881,7 @@ def model_from_hdf(fname): new_model : tardis.model.Radial1DModel """ - from tardis.model import Radial1DModel + from tardis.model import SimulationState d = {} @@ -918,7 +918,7 @@ def model_from_hdf(fname): d["homologous_density"]["density_0"], d["homologous_density"]["time_0"] ) - new_model = Radial1DModel( + new_model = SimulationState( velocity=d["velocity_cgs"], homologous_density=homologous_density, abundance=d["abundance"], diff --git a/tardis/io/tests/test_model_reader.py b/tardis/io/tests/test_model_reader.py index d2b7e839e53..1d3196fe19e 100644 --- a/tardis/io/tests/test_model_reader.py +++ b/tardis/io/tests/test_model_reader.py @@ -133,7 +133,7 @@ def test_simple_read_cmfgen_density(cmfgen_fname): def test_model_to_dict(simulation_verysimple): - model = simulation_verysimple.model + model = simulation_verysimple.simulation_state model_dict, isotope_abundance = model_to_dict(model) @@ -181,7 +181,7 @@ def test_model_to_dict(simulation_verysimple): def test_store_model_to_hdf(simulation_verysimple, tmp_path): - model = simulation_verysimple.model + model = simulation_verysimple.simulation_state fname = tmp_path / "model.h5" diff --git a/tardis/model/base.py b/tardis/model/base.py index 5d0d0dd152a..4d5e94abeda 100644 --- a/tardis/model/base.py +++ b/tardis/model/base.py @@ -136,7 +136,7 @@ def number(self): return (self.mass).divide(self.composition.atomic_mass, axis=0) -class Radial1DModel(HDFWriterMixin): +class SimulationState(HDFWriterMixin): """ An object that hold information about the individual shells. diff --git a/tardis/model/tests/test_base.py b/tardis/model/tests/test_base.py index 676717ba8a7..b0c2cd17774 100644 --- a/tardis/model/tests/test_base.py +++ b/tardis/model/tests/test_base.py @@ -6,7 +6,7 @@ from numpy.testing import assert_almost_equal, assert_array_almost_equal from tardis.io.configuration.config_reader import Configuration -from tardis.model import Radial1DModel +from tardis.model import SimulationState from tardis.io.decay import IsotopeAbundances @@ -16,36 +16,36 @@ def setup(self, example_configuration_dir): self.config = Configuration.from_yaml( example_configuration_dir / "paper1_tardis_configv1.yml" ) - self.model = Radial1DModel.from_config(self.config) + self.simulation_state = SimulationState.from_config(self.config) def test_abundances(self): oxygen_abundance = self.config.model.abundances.O assert_array_almost_equal( - oxygen_abundance, self.model.abundance.loc[8].values + oxygen_abundance, self.simulation_state.abundance.loc[8].values ) def test_velocities(self): velocity = self.config.model.structure.velocity assert_almost_equal( - velocity.start.cgs.value, self.model.v_inner[0].cgs.value + velocity.start.cgs.value, self.simulation_state.v_inner[0].cgs.value ) assert_almost_equal( - velocity.stop.cgs.value, self.model.v_outer[-1].cgs.value + velocity.stop.cgs.value, self.simulation_state.v_outer[-1].cgs.value ) - assert len(self.model.v_outer) == velocity.num + assert len(self.simulation_state.v_outer) == velocity.num def test_densities(self): assert_almost_equal( - self.model.density[0].cgs.value, + self.simulation_state.density[0].cgs.value, (7.542803599143591e-14 * u.Unit("g/cm^3")).value, ) assert_almost_equal( - self.model.density[-1].cgs.value, + self.simulation_state.density[-1].cgs.value, (1.432259798833509e-15 * u.Unit("g/cm^3")).value, ) def test_time_explosion(self): - assert_almost_equal(self.model.time_explosion.to(u.day).value, 13.0) + assert_almost_equal(self.simulation_state.time_explosion.to(u.day).value, 13.0) class TestModelFromASCIIDensity: @@ -54,16 +54,16 @@ def setup(self, example_model_file_dir): self.config = Configuration.from_yaml( example_model_file_dir / "tardis_configv1_ascii_density.yml" ) - self.model = Radial1DModel.from_config(self.config) + self.simulation_state = SimulationState.from_config(self.config) def test_velocities(self): - assert self.model.v_inner.unit == u.Unit("cm/s") - assert_almost_equal(self.model.v_inner[0].value, 1e4 * 1e5) + assert self.simulation_state.v_inner.unit == u.Unit("cm/s") + assert_almost_equal(self.simulation_state.v_inner[0].value, 1e4 * 1e5) def test_abundances(self): oxygen_abundance = self.config.model.abundances.O assert_array_almost_equal( - oxygen_abundance, self.model.abundance.loc[8].values + oxygen_abundance, self.simulation_state.abundance.loc[8].values ) @@ -73,16 +73,16 @@ def setup(self, example_model_file_dir): self.config = Configuration.from_yaml( example_model_file_dir / "tardis_configv1_artis_density.yml" ) - self.model = Radial1DModel.from_config(self.config) + self.simulation_state = SimulationState.from_config(self.config) def test_velocities(self): - assert self.model.v_inner.unit == u.Unit("cm/s") - assert_almost_equal(self.model.v_inner[0].value, 1.259375e03 * 1e5) + assert self.simulation_state.v_inner.unit == u.Unit("cm/s") + assert_almost_equal(self.simulation_state.v_inner[0].value, 1.259375e03 * 1e5) def test_abundances(self): oxygen_abundance = self.config.model.abundances.O assert_array_almost_equal( - oxygen_abundance, self.model.abundance.loc[8].values + oxygen_abundance, self.simulation_state.abundance.loc[8].values ) @@ -95,15 +95,15 @@ def setup(self, example_model_file_dir): self.config.model.abundances.type = "file" self.config.model.abundances.filename = "artis_abundances.dat" self.config.model.abundances.filetype = "artis" - self.model = Radial1DModel.from_config(self.config) + self.simulation_state = SimulationState.from_config(self.config) def test_velocities(self): - assert self.model.v_inner.unit == u.Unit("cm/s") - assert_almost_equal(self.model.v_inner[0].value, 1.259375e03 * 1e5) + assert self.simulation_state.v_inner.unit == u.Unit("cm/s") + assert_almost_equal(self.simulation_state.v_inner[0].value, 1.259375e03 * 1e5) def test_abundances(self): assert_almost_equal( - self.model.abundance.loc[14, 54], 0.21864420000000001 + self.simulation_state.abundance.loc[14, 54], 0.21864420000000001 ) @@ -117,14 +117,14 @@ def setup(self, example_model_file_dir): self.config.model.abundances.type = "file" self.config.model.abundances.filename = "artis_abundances.dat" self.config.model.abundances.filetype = "artis" - self.model = Radial1DModel.from_config(self.config) + self.simulation_state = SimulationState.from_config(self.config) def test_velocities(self): - assert self.model.v_inner.unit == u.Unit("cm/s") - assert_almost_equal(self.model.v_inner[0].to(u.km / u.s).value, 9000) + assert self.simulation_state.v_inner.unit == u.Unit("cm/s") + assert_almost_equal(self.simulation_state.v_inner[0].to(u.km / u.s).value, 9000) def test_abundances(self): - assert_almost_equal(self.model.abundance.loc[14, 31], 2.156751e-01) + assert_almost_equal(self.simulation_state.abundance.loc[14, 31], 2.156751e-01) class TestModelFromUniformDensity: @@ -133,11 +133,11 @@ def setup(self, example_configuration_dir): self.config = Configuration.from_yaml( example_configuration_dir / "tardis_configv1_uniform_density.yml" ) - self.model = Radial1DModel.from_config(self.config) + self.simulation_state = SimulationState.from_config(self.config) def test_density(self): assert_array_almost_equal( - self.model.density.to(u.Unit("g / cm3")).value, 1.0e-14 + self.simulation_state.density.to(u.Unit("g / cm3")).value, 1.0e-14 ) @@ -148,10 +148,10 @@ def setup(self, example_configuration_dir): example_configuration_dir / "tardis_configv1_uniform_density.yml" ) self.config.plasma.initial_t_inner = 2508 * u.K - self.model = Radial1DModel.from_config(self.config) + self.simulation_state = SimulationState.from_config(self.config) def test_initial_temperature(self): - assert_almost_equal(self.model.t_inner.value, 2508) + assert_almost_equal(self.simulation_state.t_inner.value, 2508) class TestModelFromArtisDensityAbundancesAllAscii: @@ -162,55 +162,55 @@ def setup(self, example_model_file_dir): ) self.config.model.structure.filename = "density.dat" self.config.model.abundances.filename = "abund.dat" - self.model = Radial1DModel.from_config(self.config) + self.simulation_state = SimulationState.from_config(self.config) def test_velocities(self): - assert self.model.v_inner.unit == u.Unit("cm/s") - assert_almost_equal(self.model.v_inner[0].to(u.km / u.s).value, 11000) + assert self.simulation_state.v_inner.unit == u.Unit("cm/s") + assert_almost_equal(self.simulation_state.v_inner[0].to(u.km / u.s).value, 11000) def test_abundances(self): - assert_almost_equal(self.model.abundance.loc[14, 0], 0.1) - assert_almost_equal(self.model.abundance.loc[14, 1], 0.2) - assert_almost_equal(self.model.abundance.loc[14, 2], 0.2) - assert_almost_equal(self.model.abundance.loc[14, 3], 0.2) - assert_almost_equal(self.model.abundance.loc[14, 4], 0.2) - assert_almost_equal(self.model.abundance.loc[14, 5], 0.2) - assert_almost_equal(self.model.abundance.loc[14, 6], 0.0) - assert_almost_equal(self.model.abundance.loc[6, 0], 0.0) - assert_almost_equal(self.model.abundance.loc[6, 1], 0.0) - assert_almost_equal(self.model.abundance.loc[6, 2], 0.0) - assert_almost_equal(self.model.abundance.loc[6, 3], 0.0) - assert_almost_equal(self.model.abundance.loc[6, 4], 0.0) - assert_almost_equal(self.model.abundance.loc[6, 5], 0.0) - assert_almost_equal(self.model.abundance.loc[6, 6], 0.5) + assert_almost_equal(self.simulation_state.abundance.loc[14, 0], 0.1) + assert_almost_equal(self.simulation_state.abundance.loc[14, 1], 0.2) + assert_almost_equal(self.simulation_state.abundance.loc[14, 2], 0.2) + assert_almost_equal(self.simulation_state.abundance.loc[14, 3], 0.2) + assert_almost_equal(self.simulation_state.abundance.loc[14, 4], 0.2) + assert_almost_equal(self.simulation_state.abundance.loc[14, 5], 0.2) + assert_almost_equal(self.simulation_state.abundance.loc[14, 6], 0.0) + assert_almost_equal(self.simulation_state.abundance.loc[6, 0], 0.0) + assert_almost_equal(self.simulation_state.abundance.loc[6, 1], 0.0) + assert_almost_equal(self.simulation_state.abundance.loc[6, 2], 0.0) + assert_almost_equal(self.simulation_state.abundance.loc[6, 3], 0.0) + assert_almost_equal(self.simulation_state.abundance.loc[6, 4], 0.0) + assert_almost_equal(self.simulation_state.abundance.loc[6, 5], 0.0) + assert_almost_equal(self.simulation_state.abundance.loc[6, 6], 0.5) def test_densities(self): assert_almost_equal( - self.model.density[0].to(u.Unit("g/cm3")).value, + self.simulation_state.density[0].to(u.Unit("g/cm3")).value, 9.7656229e-11 / 13.0**3, ) assert_almost_equal( - self.model.density[1].to(u.Unit("g/cm3")).value, + self.simulation_state.density[1].to(u.Unit("g/cm3")).value, 4.8170911e-11 / 13.0**3, ) assert_almost_equal( - self.model.density[2].to(u.Unit("g/cm3")).value, + self.simulation_state.density[2].to(u.Unit("g/cm3")).value, 2.5600000e-11 / 13.0**3, ) assert_almost_equal( - self.model.density[3].to(u.Unit("g/cm3")).value, + self.simulation_state.density[3].to(u.Unit("g/cm3")).value, 1.4450533e-11 / 13.0**3, ) assert_almost_equal( - self.model.density[4].to(u.Unit("g/cm3")).value, + self.simulation_state.density[4].to(u.Unit("g/cm3")).value, 8.5733893e-11 / 13.0**3, ) assert_almost_equal( - self.model.density[5].to(u.Unit("g/cm3")).value, + self.simulation_state.density[5].to(u.Unit("g/cm3")).value, 5.3037103e-11 / 13.0**3, ) assert_almost_equal( - self.model.density[6].to(u.Unit("g/cm3")).value, + self.simulation_state.density[6].to(u.Unit("g/cm3")).value, 3.3999447e-11 / 13.0**3, ) @@ -219,7 +219,7 @@ def test_ascii_reader_power_law(example_configuration_dir): config = Configuration.from_yaml( example_configuration_dir / "tardis_configv1_density_power_law_test.yml" ) - model = Radial1DModel.from_config(config) + simulation_state = SimulationState.from_config(config) expected_densites = [ 3.29072513e-14, @@ -244,10 +244,10 @@ def test_ascii_reader_power_law(example_configuration_dir): 1.93928168e-15, ] - assert model.no_of_shells == 20 + assert simulation_state.no_of_shells == 20 for i, mdens in enumerate(expected_densites): assert_almost_equal( - model.density[i].to(u.Unit("g / (cm3)")).value, mdens + simulation_state.density[i].to(u.Unit("g / (cm3)")).value, mdens ) @@ -256,7 +256,7 @@ def test_ascii_reader_exponential_law(example_configuration_dir): example_configuration_dir / "tardis_configv1_density_exponential_test.yml" ) - model = Radial1DModel.from_config(config) + simulation_state = SimulationState.from_config(config) expected_densites = [ 5.18114795e-14, @@ -282,10 +282,10 @@ def test_ascii_reader_exponential_law(example_configuration_dir): ] expected_unit = "g / (cm3)" - assert model.no_of_shells == 20 + assert simulation_state.no_of_shells == 20 for i, mdens in enumerate(expected_densites): - assert_almost_equal(model.density[i].value, mdens) - assert model.density[i].unit == u.Unit(expected_unit) + assert_almost_equal(simulation_state.density[i].value, mdens) + assert simulation_state.density[i].unit == u.Unit(expected_unit) @pytest.fixture @@ -301,29 +301,29 @@ def test_model_decay(simple_isotope_abundance, example_configuration_dir): config = Configuration.from_yaml( example_configuration_dir / "tardis_configv1_verysimple.yml" ) - model = Radial1DModel.from_config(config) + simulation_state = SimulationState.from_config(config) - model.raw_isotope_abundance = simple_isotope_abundance - decayed = simple_isotope_abundance.decay(model.time_explosion).as_atoms() + simulation_state.raw_isotope_abundance = simple_isotope_abundance + decayed = simple_isotope_abundance.decay(simulation_state.time_explosion).as_atoms() norm_factor = 1.4 assert_almost_equal( - model.abundance.loc[8][0], - model.raw_abundance.loc[8][0] / norm_factor, + simulation_state.abundance.loc[8][0], + simulation_state.raw_abundance.loc[8][0] / norm_factor, decimal=4, ) assert_almost_equal( - model.abundance.loc[14][0], - (model.raw_abundance.loc[14][0] + decayed.loc[14][0]) / norm_factor, + simulation_state.abundance.loc[14][0], + (simulation_state.raw_abundance.loc[14][0] + decayed.loc[14][0]) / norm_factor, decimal=4, ) assert_almost_equal( - model._abundance.loc[12][5], - (model.raw_abundance.loc[12][5] + decayed.loc[12][5]) / norm_factor, + simulation_state._abundance.loc[12][5], + (simulation_state.raw_abundance.loc[12][5] + decayed.loc[12][5]) / norm_factor, decimal=4, ) assert_almost_equal( - model.abundance.loc[6][12], + simulation_state.abundance.loc[6][12], (decayed.loc[6][12]) / norm_factor, decimal=4, ) @@ -338,7 +338,7 @@ def test_model_decay(simple_isotope_abundance, example_configuration_dir): ], ) def test_radial_1D_geometry_volume(simulation_verysimple, index, expected): - geometry = simulation_verysimple.model.model_state.geometry + geometry = simulation_verysimple.simulation_state.model_state.geometry volume = geometry.volume assert volume.unit == u.Unit("cm3") @@ -371,7 +371,7 @@ def test_radial_1D_geometry_volume(simulation_verysimple, index, expected): def test_composition_elemental_number_density( simulation_verysimple, index, expected ): - comp = simulation_verysimple.model.model_state.composition + comp = simulation_verysimple.simulation_state.model_state.composition assert_almost_equal( comp.elemental_number_density.loc[index], expected, decimal=-2 @@ -387,7 +387,7 @@ def test_composition_elemental_number_density( ], ) def test_model_state_mass(simulation_verysimple, index, expected): - model_state = simulation_verysimple.model.model_state + model_state = simulation_verysimple.simulation_state.model_state assert_almost_equal((model_state.mass).loc[index], expected, decimal=-27) @@ -401,7 +401,7 @@ def test_model_state_mass(simulation_verysimple, index, expected): ], ) def test_model_state_number(simulation_verysimple, index, expected): - model_state = simulation_verysimple.model.model_state + model_state = simulation_verysimple.simulation_state.model_state assert_almost_equal((model_state.number).loc[index], expected, decimal=-47) @@ -412,7 +412,7 @@ def non_uniform_model_state(atomic_dataset, example_model_file_dir): example_model_file_dir / "tardis_configv1_isotope_iabund.yml" ) atom_data = atomic_dataset - model = Radial1DModel.from_config(config, atom_data=atom_data) + model = SimulationState.from_config(config, atom_data=atom_data) return model.model_state @@ -469,7 +469,7 @@ def test_number(self, model_state): @pytest.fixture(scope="module", autouse=True) def to_hdf_buffer(hdf_file_path, simulation_verysimple): - simulation_verysimple.model.to_hdf(hdf_file_path, overwrite=True) + simulation_verysimple.simulation_state.to_hdf(hdf_file_path, overwrite=True) model_scalar_attrs = ["t_inner"] @@ -479,7 +479,7 @@ def to_hdf_buffer(hdf_file_path, simulation_verysimple): def test_hdf_model_scalars(hdf_file_path, simulation_verysimple, attr): path = os.path.join("model", "scalars") expected = pd.read_hdf(hdf_file_path, path)[attr] - actual = getattr(simulation_verysimple.model, attr) + actual = getattr(simulation_verysimple.simulation_state, attr) if hasattr(actual, "cgs"): actual = actual.cgs.value assert_almost_equal(actual, expected) @@ -492,7 +492,7 @@ def test_hdf_model_scalars(hdf_file_path, simulation_verysimple, attr): def test_hdf_model_nparray(hdf_file_path, simulation_verysimple, attr): path = os.path.join("model", attr) expected = pd.read_hdf(hdf_file_path, path) - actual = getattr(simulation_verysimple.model, attr) + actual = getattr(simulation_verysimple.simulation_state, attr) if hasattr(actual, "cgs"): actual = actual.cgs.value assert_almost_equal(actual, expected.values) diff --git a/tardis/model/tests/test_csvy_model.py b/tardis/model/tests/test_csvy_model.py index 93a5b7b2e5f..8e8f69c1b6b 100644 --- a/tardis/model/tests/test_csvy_model.py +++ b/tardis/model/tests/test_csvy_model.py @@ -6,7 +6,7 @@ import os from astropy import units as u from tardis.io.configuration.config_reader import Configuration -from tardis.model import Radial1DModel +from tardis.model import SimulationState import pytest @@ -35,8 +35,8 @@ def test_compare_models(model_config_fnames): csvy_config_file, old_config_file = model_config_fnames tardis_config = Configuration.from_yaml(csvy_config_file) tardis_config_old = Configuration.from_yaml(old_config_file) - csvy_model = Radial1DModel.from_csvy(tardis_config) - config_model = Radial1DModel.from_config(tardis_config_old) + csvy_model = SimulationState.from_csvy(tardis_config) + config_model = SimulationState.from_config(tardis_config_old) csvy_model_props = csvy_model.get_properties().keys() config_model_props = config_model.get_properties().keys() npt.assert_array_equal(csvy_model_props, config_model_props) @@ -80,7 +80,7 @@ def csvy_model_test_abundances(example_csvy_file_dir): """Returns Radial1DModel to use to test abundances dataframes""" csvypath = example_csvy_file_dir / "csvy_model_to_test_abundances.yml" config = Configuration.from_yaml(csvypath) - csvy_model_test_abundances = Radial1DModel.from_csvy(config) + csvy_model_test_abundances = SimulationState.from_csvy(config) return csvy_model_test_abundances diff --git a/tardis/model/tests/test_density.py b/tardis/model/tests/test_density.py index c9451211088..fd7035ec9f7 100644 --- a/tardis/model/tests/test_density.py +++ b/tardis/model/tests/test_density.py @@ -10,11 +10,11 @@ @pytest.fixture(scope="module", autouse=True) def to_hdf_buffer(hdf_file_path, simulation_verysimple): - simulation_verysimple.model.to_hdf(hdf_file_path, overwrite=True) + simulation_verysimple.simulation_state.to_hdf(hdf_file_path, overwrite=True) def test_hdf_density_0(hdf_file_path, simulation_verysimple): - actual = simulation_verysimple.model.density + actual = simulation_verysimple.simulation_state.density if hasattr(actual, "cgs"): actual = actual.cgs.value path = os.path.join("model", "density") @@ -23,7 +23,7 @@ def test_hdf_density_0(hdf_file_path, simulation_verysimple): def test_hdf_time_0(hdf_file_path, simulation_verysimple): - actual = simulation_verysimple.model.time_explosion + actual = simulation_verysimple.simulation_state.time_explosion if hasattr(actual, "cgs"): actual = actual.cgs.value path = os.path.join("model", "scalars") diff --git a/tardis/montecarlo/montecarlo_numba/tests/conftest.py b/tardis/montecarlo/montecarlo_numba/tests/conftest.py index 6b2c92b5308..d7e7b5e26dc 100644 --- a/tardis/montecarlo/montecarlo_numba/tests/conftest.py +++ b/tardis/montecarlo/montecarlo_numba/tests/conftest.py @@ -34,12 +34,12 @@ def verysimple_opacity_state(nb_simulation_verysimple): @pytest.fixture(scope="package") def verysimple_numba_radial_1d_geometry(nb_simulation_verysimple): - return nb_simulation_verysimple.model.model_state.geometry.to_numba() + return nb_simulation_verysimple.simulation_state.model_state.geometry.to_numba() @pytest.fixture(scope="package") def verysimple_numba_model(nb_simulation_verysimple): - model = nb_simulation_verysimple.model + model = nb_simulation_verysimple.simulation_state return NumbaModel( model.time_explosion.to("s").value, ) diff --git a/tardis/plasma/tests/test_nlte_solver.py b/tardis/plasma/tests/test_nlte_solver.py index b53dbc72fbd..fe47b496e97 100644 --- a/tardis/plasma/tests/test_nlte_solver.py +++ b/tardis/plasma/tests/test_nlte_solver.py @@ -6,7 +6,7 @@ from copy import deepcopy from numpy.testing import assert_allclose, assert_almost_equal from tardis.io.configuration.config_reader import Configuration -from tardis.model.base import Radial1DModel +from tardis.model.base import SimulationState from tardis.plasma.properties import NLTERateEquationSolver from tardis.io.atom_data.base import AtomData from tardis.plasma.properties.ion_population import IonNumberDensity diff --git a/tardis/plasma/tests/test_tardis_model_density_config.py b/tardis/plasma/tests/test_tardis_model_density_config.py index 89b4a514502..6bb6ff6dbdf 100644 --- a/tardis/plasma/tests/test_tardis_model_density_config.py +++ b/tardis/plasma/tests/test_tardis_model_density_config.py @@ -1,7 +1,7 @@ import pytest from tardis.io.configuration.config_reader import Configuration -from tardis.model import Radial1DModel +from tardis.model import SimulationState from tardis.plasma.standard_plasmas import assemble_plasma from numpy.testing import assert_almost_equal @@ -15,7 +15,7 @@ def tardis_model_density_config(example_model_file_dir): @pytest.fixture() def raw_model(tardis_model_density_config): - return Radial1DModel.from_config(tardis_model_density_config) + return SimulationState.from_config(tardis_model_density_config) @pytest.fixture() diff --git a/tardis/simulation/base.py b/tardis/simulation/base.py index be4b8f6eefa..629c49894fa 100644 --- a/tardis/simulation/base.py +++ b/tardis/simulation/base.py @@ -9,7 +9,7 @@ from tardis import model from tardis.montecarlo.base import MontecarloTransport -from tardis.model import Radial1DModel +from tardis.model import SimulationState from tardis.plasma.standard_plasmas import assemble_plasma from tardis.io.util import HDFWriterMixin from tardis.io.configuration.config_reader import ConfigurationError @@ -107,7 +107,7 @@ class Simulation(PlasmaStateStorerMixin, HDFWriterMixin): """ hdf_properties = [ - "model", + "simulation_state", "plasma", "transport", "iterations_w", @@ -120,7 +120,7 @@ class Simulation(PlasmaStateStorerMixin, HDFWriterMixin): def __init__( self, iterations, - model, + simulation_state, plasma, transport, no_of_packets, @@ -134,12 +134,12 @@ def __init__( convergence_plots_kwargs, show_progress_bars, ): - super(Simulation, self).__init__(iterations, model.no_of_shells) + super(Simulation, self).__init__(iterations, simulation_state.no_of_shells) self.converged = False self.iterations = iterations self.iterations_executed = 0 - self.model = model + self.simulation_state = simulation_state self.plasma = plasma self.transport = transport self.no_of_packets = no_of_packets @@ -215,7 +215,7 @@ def _get_convergence_status( self, t_rad, w, t_inner, estimated_t_rad, estimated_w, estimated_t_inner ): # FIXME: Move the convergence checking in its own class. - no_of_shells = self.model.no_of_shells + no_of_shells = self.simulation_state.no_of_shells convergence_t_rad = ( abs(t_rad - estimated_t_rad) / estimated_t_rad @@ -279,15 +279,15 @@ def advance_state(self): estimated_w, ) = self.transport.calculate_radiationfield_properties() estimated_t_inner = self.estimate_t_inner( - self.model.t_inner, + self.simulation_state.t_inner, self.luminosity_requested, t_inner_update_exponent=self.convergence_strategy.t_inner_update_exponent, ) converged = self._get_convergence_status( - self.model.t_rad, - self.model.w, - self.model.t_inner, + self.simulation_state.t_rad, + self.simulation_state.w, + self.simulation_state.t_inner, estimated_t_rad, estimated_w, estimated_t_inner, @@ -296,12 +296,12 @@ def advance_state(self): # calculate_next_plasma_state equivalent # FIXME: Should convergence strategy have its own class? next_t_rad = self.damped_converge( - self.model.t_rad, + self.simulation_state.t_rad, estimated_t_rad, self.convergence_strategy.t_rad.damping_constant, ) next_w = self.damped_converge( - self.model.w, + self.simulation_state.w, estimated_w, self.convergence_strategy.w.damping_constant, ) @@ -309,40 +309,40 @@ def advance_state(self): self.iterations_executed + 1 ) % self.convergence_strategy.lock_t_inner_cycles == 0: next_t_inner = self.damped_converge( - self.model.t_inner, + self.simulation_state.t_inner, estimated_t_inner, self.convergence_strategy.t_inner.damping_constant, ) else: - next_t_inner = self.model.t_inner + next_t_inner = self.simulation_state.t_inner if hasattr(self, "convergence_plots"): self.convergence_plots.fetch_data( name="t_inner", - value=self.model.t_inner.value, + value=self.simulation_state.t_inner.value, item_type="value", ) self.convergence_plots.fetch_data( - name="t_rad", value=self.model.t_rad, item_type="iterable" + name="t_rad", value=self.simulation_state.t_rad, item_type="iterable" ) self.convergence_plots.fetch_data( - name="w", value=self.model.w, item_type="iterable" + name="w", value=self.simulation_state.w, item_type="iterable" ) self.convergence_plots.fetch_data( - name="velocity", value=self.model.velocity, item_type="iterable" + name="velocity", value=self.simulation_state.velocity, item_type="iterable" ) self.log_plasma_state( - self.model.t_rad, - self.model.w, - self.model.t_inner, + self.simulation_state.t_rad, + self.simulation_state.w, + self.simulation_state.t_inner, next_t_rad, next_w, next_t_inner, ) - self.model.t_rad = next_t_rad - self.model.w = next_w - self.model.blackbody_packet_source.temperature = next_t_inner + self.simulation_state.t_rad = next_t_rad + self.simulation_state.w = next_w + self.simulation_state.blackbody_packet_source.temperature = next_t_inner # model.calculate_j_blues() equivalent # model.update_plasmas() equivalent @@ -350,7 +350,7 @@ def advance_state(self): if "nlte_data" in self.plasma.outputs_dict: self.plasma.store_previous_properties() - update_properties = dict(t_rad=self.model.t_rad, w=self.model.w) + update_properties = dict(t_rad=self.simulation_state.t_rad, w=self.simulation_state.w) # A check to see if the plasma is set with JBluesDetailed, in which # case it needs some extra kwargs. if "j_blue_estimator" in self.plasma.outputs_dict: @@ -375,7 +375,7 @@ def iterate(self, no_of_packets, no_of_virtual_packets=0): f"\n\tStarting iteration {(self.iterations_executed + 1):d} of {self.iterations:d}" ) self.transport.run( - self.model, + self.simulation_state, self.plasma, no_of_packets, no_of_virtual_packets=no_of_virtual_packets, @@ -422,10 +422,10 @@ def run_convergence(self): while self.iterations_executed < self.iterations - 1: self.store_plasma_state( self.iterations_executed, - self.model.w, - self.model.t_rad, + self.simulation_state.w, + self.simulation_state.t_rad, self.plasma.electron_densities, - self.model.t_inner, + self.simulation_state.t_inner, ) self.iterate(self.no_of_packets) self.converged = self.advance_state() @@ -447,10 +447,10 @@ def run_final(self): """ self.store_plasma_state( self.iterations_executed, - self.model.w, - self.model.t_rad, + self.simulation_state.w, + self.simulation_state.t_rad, self.plasma.electron_densities, - self.model.t_inner, + self.simulation_state.t_inner, ) self.iterate(self.last_no_of_packets, self.no_of_virtual_packets) @@ -458,7 +458,7 @@ def run_final(self): if hasattr(self, "convergence_plots"): self.convergence_plots.fetch_data( name="t_inner", - value=self.model.t_inner.value, + value=self.simulation_state.t_inner.value, item_type="value", ) self.convergence_plots.update( @@ -632,21 +632,21 @@ def from_config( # Allow overriding some config structures. This is useful in some # unit tests, and could be extended in all the from_config classmethods. if "model" in kwargs: - model = kwargs["model"] + simulation_state = kwargs["model"] else: if hasattr(config, "csvy_model"): - model = Radial1DModel.from_csvy( + simulation_state = SimulationState.from_csvy( config, atom_data=kwargs.get("atom_data", None) ) else: - model = Radial1DModel.from_config( + simulation_state = SimulationState.from_config( config, atom_data=kwargs.get("atom_data", None) ) if "plasma" in kwargs: plasma = kwargs["plasma"] else: plasma = assemble_plasma( - config, model, atom_data=kwargs.get("atom_data", None) + config, simulation_state, atom_data=kwargs.get("atom_data", None) ) if "transport" in kwargs: if packet_source is not None: @@ -694,7 +694,7 @@ def from_config( return cls( iterations=config.montecarlo.iterations, - model=model, + simulation_state=simulation_state, plasma=plasma, transport=transport, show_convergence_plots=show_convergence_plots, diff --git a/tardis/simulation/tests/test_simulation.py b/tardis/simulation/tests/test_simulation.py index e44519281f8..75536b9a7ee 100644 --- a/tardis/simulation/tests/test_simulation.py +++ b/tardis/simulation/tests/test_simulation.py @@ -54,7 +54,7 @@ def simulation_one_loop( "iterations_electron_densities", "iterations_t_inner", ] - simulation.model.hdf_properties = ["t_radiative", "dilution_factor"] + simulation.simulation_state.hdf_properties = ["t_radiative", "dilution_factor"] simulation.transport.hdf_properties = [ "j_estimator", "nu_bar_estimator", @@ -64,7 +64,7 @@ def simulation_one_loop( simulation.to_hdf( tardis_ref_data, "", "test_simulation", overwrite=True ) - simulation.model.to_hdf( + simulation.simulation_state.to_hdf( tardis_ref_data, "", "test_simulation", overwrite=True ) simulation.transport.to_hdf( @@ -88,7 +88,7 @@ def test_plasma_estimates(simulation_one_loop, refdata, name): try: actual = getattr(simulation_one_loop.transport, name) except AttributeError: - actual = getattr(simulation_one_loop.model, name) + actual = getattr(simulation_one_loop.simulation_state, name) if name in ["t_radiative", "output_nu", "output_energy"]: # removing the quantitiness of the data actual = actual.value diff --git a/tardis/tests/fixtures/atom_data.py b/tardis/tests/fixtures/atom_data.py index 68036b900b7..fb506011c8a 100644 --- a/tardis/tests/fixtures/atom_data.py +++ b/tardis/tests/fixtures/atom_data.py @@ -4,7 +4,7 @@ from tardis.io.atom_data.base import AtomData from tardis.io.configuration.config_reader import Configuration -from tardis.model.base import Radial1DModel +from tardis.model.base import SimulationState DEFAULT_ATOM_DATA_UUID = "864f1753714343c41f99cb065710cace" @@ -84,4 +84,4 @@ def tardis_model_config_nlte(example_configuration_dir): @pytest.fixture # (scope="session") def nlte_raw_model(tardis_model_config_nlte): - return Radial1DModel.from_config(tardis_model_config_nlte) + return SimulationState.from_config(tardis_model_config_nlte) diff --git a/tardis/tests/integration_tests/test_integration.py b/tardis/tests/integration_tests/test_integration.py index 8f9c97f2acc..a380763e12a 100644 --- a/tardis/tests/integration_tests/test_integration.py +++ b/tardis/tests/integration_tests/test_integration.py @@ -176,7 +176,7 @@ def plot_t_rad(self): ax.set_ylabel("t_rad") result_line = ax.plot( - self.result.model.t_rad.cgs, + self.result.simulation_state.t_rad.cgs, color="blue", marker=".", label="Result", @@ -192,7 +192,7 @@ def plot_t_rad(self): error_line = error_ax.plot( ( 1 - - self.result.model.t_rad.cgs.value + - self.result.simulation_state.t_rad.cgs.value / self.reference["/simulation/model/t_rad"] ), color="red", diff --git a/tardis/visualization/tools/sdec_plot.py b/tardis/visualization/tools/sdec_plot.py index bcd3195c11b..63806535a39 100644 --- a/tardis/visualization/tools/sdec_plot.py +++ b/tardis/visualization/tools/sdec_plot.py @@ -165,8 +165,8 @@ def from_simulation(cls, sim, packets_mode): lines_df = sim.plasma.atomic_data.lines.reset_index().set_index( "line_id" ) - r_inner = sim.model.r_inner - t_inner = sim.model.t_inner + r_inner = sim.simulation_state.r_inner + t_inner = sim.simulation_state.t_inner time_of_simulation = sim.transport.time_of_simulation if packets_mode == "virtual": diff --git a/tardis/visualization/widgets/custom_abundance.py b/tardis/visualization/widgets/custom_abundance.py index f5586d75266..6e08567f1ad 100644 --- a/tardis/visualization/widgets/custom_abundance.py +++ b/tardis/visualization/widgets/custom_abundance.py @@ -14,7 +14,7 @@ from tardis.io.model.readers.generic_readers import read_uniform_abundances from tardis.util.base import quantity_linspace, is_valid_nuclide_or_elem from tardis.io.configuration.config_reader import Configuration -from tardis.model import Radial1DModel +from tardis.model import SimulationState from tardis.io.model.parse_density_configuration import ( calculate_power_law_density, calculate_exponential_density, @@ -198,9 +198,9 @@ def from_yml(cls, fpath): config = Configuration.from_yaml(fpath) if hasattr(config, "csvy_model"): - model = Radial1DModel.from_csvy(config) + model = SimulationState.from_csvy(config) else: - model = Radial1DModel.from_config(config) + model = SimulationState.from_config(config) velocity = model.velocity density_t_0 = model.time_explosion diff --git a/tardis/visualization/widgets/shell_info.py b/tardis/visualization/widgets/shell_info.py index 336c8f580cf..5dcc709cd4b 100644 --- a/tardis/visualization/widgets/shell_info.py +++ b/tardis/visualization/widgets/shell_info.py @@ -184,8 +184,8 @@ def __init__(self, sim_model): TARDIS Simulation object produced by running a simulation """ super().__init__( - sim_model.model.t_radiative, - sim_model.model.w, + sim_model.simulation_state.t_radiative, + sim_model.simulation_state.w, sim_model.plasma.abundance, sim_model.plasma.number_density, sim_model.plasma.ion_number_density, @@ -210,8 +210,8 @@ def __init__(self, hdf_fpath): """ with pd.HDFStore(hdf_fpath, "r") as sim_data: super().__init__( - sim_data["/simulation/model/t_radiative"], - sim_data["/simulation/model/w"], + sim_data["/simulation/simulation_state/t_radiative"], + sim_data["/simulation/simulation_state/w"], sim_data["/simulation/plasma/abundance"], sim_data["/simulation/plasma/number_density"], sim_data["/simulation/plasma/ion_number_density"], diff --git a/tardis/visualization/widgets/tests/test_shell_info.py b/tardis/visualization/widgets/tests/test_shell_info.py index 8d6af014617..4c08233d8d2 100644 --- a/tardis/visualization/widgets/tests/test_shell_info.py +++ b/tardis/visualization/widgets/tests/test_shell_info.py @@ -13,8 +13,8 @@ @pytest.fixture(scope="class") def base_shell_info(simulation_verysimple): return BaseShellInfo( - simulation_verysimple.model.t_radiative, - simulation_verysimple.model.w, + simulation_verysimple.simulation_state.t_radiative, + simulation_verysimple.simulation_state.w, simulation_verysimple.plasma.abundance, simulation_verysimple.plasma.number_density, simulation_verysimple.plasma.ion_number_density, @@ -39,16 +39,16 @@ class TestBaseShellInfo: def test_shells_data(self, base_shell_info, simulation_verysimple): shells_data = base_shell_info.shells_data() assert shells_data.shape == ( - len(simulation_verysimple.model.t_radiative), + len(simulation_verysimple.simulation_state.t_radiative), 2, ) assert np.allclose( shells_data.iloc[:, 0].map(np.float64), - simulation_verysimple.model.t_radiative.value, + simulation_verysimple.simulation_state.t_radiative.value, ) assert np.allclose( shells_data.iloc[:, 1].map(np.float64), - simulation_verysimple.model.w, + simulation_verysimple.simulation_state.w, ) @pytest.mark.parametrize("shell_num", [1, 20]) From 551a95a7087b4f92b0467aabdedce6d94fb00431 Mon Sep 17 00:00:00 2001 From: Wolfgang Kerzendorf Date: Sat, 23 Sep 2023 12:28:15 -0400 Subject: [PATCH 2/2] black files --- tardis/model/tests/test_base.py | 34 ++++++++++++++----- .../montecarlo_numba/tests/conftest.py | 4 ++- tardis/simulation/base.py | 20 ++++++++--- tardis/simulation/tests/test_simulation.py | 5 ++- 4 files changed, 47 insertions(+), 16 deletions(-) diff --git a/tardis/model/tests/test_base.py b/tardis/model/tests/test_base.py index b0c2cd17774..f86fd982204 100644 --- a/tardis/model/tests/test_base.py +++ b/tardis/model/tests/test_base.py @@ -45,7 +45,9 @@ def test_densities(self): ) def test_time_explosion(self): - assert_almost_equal(self.simulation_state.time_explosion.to(u.day).value, 13.0) + assert_almost_equal( + self.simulation_state.time_explosion.to(u.day).value, 13.0 + ) class TestModelFromASCIIDensity: @@ -77,7 +79,9 @@ def setup(self, example_model_file_dir): def test_velocities(self): assert self.simulation_state.v_inner.unit == u.Unit("cm/s") - assert_almost_equal(self.simulation_state.v_inner[0].value, 1.259375e03 * 1e5) + assert_almost_equal( + self.simulation_state.v_inner[0].value, 1.259375e03 * 1e5 + ) def test_abundances(self): oxygen_abundance = self.config.model.abundances.O @@ -99,7 +103,9 @@ def setup(self, example_model_file_dir): def test_velocities(self): assert self.simulation_state.v_inner.unit == u.Unit("cm/s") - assert_almost_equal(self.simulation_state.v_inner[0].value, 1.259375e03 * 1e5) + assert_almost_equal( + self.simulation_state.v_inner[0].value, 1.259375e03 * 1e5 + ) def test_abundances(self): assert_almost_equal( @@ -121,10 +127,14 @@ def setup(self, example_model_file_dir): def test_velocities(self): assert self.simulation_state.v_inner.unit == u.Unit("cm/s") - assert_almost_equal(self.simulation_state.v_inner[0].to(u.km / u.s).value, 9000) + assert_almost_equal( + self.simulation_state.v_inner[0].to(u.km / u.s).value, 9000 + ) def test_abundances(self): - assert_almost_equal(self.simulation_state.abundance.loc[14, 31], 2.156751e-01) + assert_almost_equal( + self.simulation_state.abundance.loc[14, 31], 2.156751e-01 + ) class TestModelFromUniformDensity: @@ -166,7 +176,9 @@ def setup(self, example_model_file_dir): def test_velocities(self): assert self.simulation_state.v_inner.unit == u.Unit("cm/s") - assert_almost_equal(self.simulation_state.v_inner[0].to(u.km / u.s).value, 11000) + assert_almost_equal( + self.simulation_state.v_inner[0].to(u.km / u.s).value, 11000 + ) def test_abundances(self): assert_almost_equal(self.simulation_state.abundance.loc[14, 0], 0.1) @@ -304,7 +316,9 @@ def test_model_decay(simple_isotope_abundance, example_configuration_dir): simulation_state = SimulationState.from_config(config) simulation_state.raw_isotope_abundance = simple_isotope_abundance - decayed = simple_isotope_abundance.decay(simulation_state.time_explosion).as_atoms() + decayed = simple_isotope_abundance.decay( + simulation_state.time_explosion + ).as_atoms() norm_factor = 1.4 assert_almost_equal( @@ -314,12 +328,14 @@ def test_model_decay(simple_isotope_abundance, example_configuration_dir): ) assert_almost_equal( simulation_state.abundance.loc[14][0], - (simulation_state.raw_abundance.loc[14][0] + decayed.loc[14][0]) / norm_factor, + (simulation_state.raw_abundance.loc[14][0] + decayed.loc[14][0]) + / norm_factor, decimal=4, ) assert_almost_equal( simulation_state._abundance.loc[12][5], - (simulation_state.raw_abundance.loc[12][5] + decayed.loc[12][5]) / norm_factor, + (simulation_state.raw_abundance.loc[12][5] + decayed.loc[12][5]) + / norm_factor, decimal=4, ) assert_almost_equal( diff --git a/tardis/montecarlo/montecarlo_numba/tests/conftest.py b/tardis/montecarlo/montecarlo_numba/tests/conftest.py index d7e7b5e26dc..3bf3a2552ac 100644 --- a/tardis/montecarlo/montecarlo_numba/tests/conftest.py +++ b/tardis/montecarlo/montecarlo_numba/tests/conftest.py @@ -34,7 +34,9 @@ def verysimple_opacity_state(nb_simulation_verysimple): @pytest.fixture(scope="package") def verysimple_numba_radial_1d_geometry(nb_simulation_verysimple): - return nb_simulation_verysimple.simulation_state.model_state.geometry.to_numba() + return ( + nb_simulation_verysimple.simulation_state.model_state.geometry.to_numba() + ) @pytest.fixture(scope="package") diff --git a/tardis/simulation/base.py b/tardis/simulation/base.py index 629c49894fa..0aee0bb1773 100644 --- a/tardis/simulation/base.py +++ b/tardis/simulation/base.py @@ -134,7 +134,9 @@ def __init__( convergence_plots_kwargs, show_progress_bars, ): - super(Simulation, self).__init__(iterations, simulation_state.no_of_shells) + super(Simulation, self).__init__( + iterations, simulation_state.no_of_shells + ) self.converged = False self.iterations = iterations @@ -323,13 +325,17 @@ def advance_state(self): item_type="value", ) self.convergence_plots.fetch_data( - name="t_rad", value=self.simulation_state.t_rad, item_type="iterable" + name="t_rad", + value=self.simulation_state.t_rad, + item_type="iterable", ) self.convergence_plots.fetch_data( name="w", value=self.simulation_state.w, item_type="iterable" ) self.convergence_plots.fetch_data( - name="velocity", value=self.simulation_state.velocity, item_type="iterable" + name="velocity", + value=self.simulation_state.velocity, + item_type="iterable", ) self.log_plasma_state( @@ -350,7 +356,9 @@ def advance_state(self): if "nlte_data" in self.plasma.outputs_dict: self.plasma.store_previous_properties() - update_properties = dict(t_rad=self.simulation_state.t_rad, w=self.simulation_state.w) + update_properties = dict( + t_rad=self.simulation_state.t_rad, w=self.simulation_state.w + ) # A check to see if the plasma is set with JBluesDetailed, in which # case it needs some extra kwargs. if "j_blue_estimator" in self.plasma.outputs_dict: @@ -646,7 +654,9 @@ def from_config( plasma = kwargs["plasma"] else: plasma = assemble_plasma( - config, simulation_state, atom_data=kwargs.get("atom_data", None) + config, + simulation_state, + atom_data=kwargs.get("atom_data", None), ) if "transport" in kwargs: if packet_source is not None: diff --git a/tardis/simulation/tests/test_simulation.py b/tardis/simulation/tests/test_simulation.py index 75536b9a7ee..d4f68ff3cc5 100644 --- a/tardis/simulation/tests/test_simulation.py +++ b/tardis/simulation/tests/test_simulation.py @@ -54,7 +54,10 @@ def simulation_one_loop( "iterations_electron_densities", "iterations_t_inner", ] - simulation.simulation_state.hdf_properties = ["t_radiative", "dilution_factor"] + simulation.simulation_state.hdf_properties = [ + "t_radiative", + "dilution_factor", + ] simulation.transport.hdf_properties = [ "j_estimator", "nu_bar_estimator",