Skip to content

Commit

Permalink
rename RadialModel1D to SimulationState (tardis-sn#2417)
Browse files Browse the repository at this point in the history
* rename RadialModel1D to SimulationState

* black files
  • Loading branch information
wkerzendorf authored Sep 26, 2023
1 parent ff5a120 commit aea441c
Show file tree
Hide file tree
Showing 19 changed files with 189 additions and 158 deletions.
4 changes: 2 additions & 2 deletions tardis/grid/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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):
Expand Down
4 changes: 2 additions & 2 deletions tardis/io/model/model_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {}

Expand Down Expand Up @@ -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"],
Expand Down
4 changes: 2 additions & 2 deletions tardis/io/model_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {}

Expand Down Expand Up @@ -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"],
Expand Down
4 changes: 2 additions & 2 deletions tardis/io/tests/test_model_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -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"

Expand Down
2 changes: 1 addition & 1 deletion tardis/model/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Loading

0 comments on commit aea441c

Please sign in to comment.