Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rename RadialModel1D to SimulationState #2417

Merged
merged 2 commits into from
Sep 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading