diff --git a/yt/frontends/ramses/data_structures.py b/yt/frontends/ramses/data_structures.py index a240ae8fe9..3d45af138c 100644 --- a/yt/frontends/ramses/data_structures.py +++ b/yt/frontends/ramses/data_structures.py @@ -799,7 +799,7 @@ class RAMSESDataset(Dataset): force_cosmological: Optional[bool] _force_max_level: tuple[int, str] _bbox: Optional[list[list[float]]] - self_shielding: Optional[bool] + self_shielding: Optional[bool] = None def __init__( self, @@ -1122,7 +1122,7 @@ def caster(val): has_namelist = self.read_namelist() if self.self_shielding is None and has_namelist: - nml = self.ds.parameters["namelist"] + nml = self.parameters["namelist"] # "self_shielding" is stored in physics_params in older versions of the code physics_params = nml.get("physics_params", default={})