diff --git a/src/easyreflectometry/project.py b/src/easyreflectometry/project.py index 6ac00ab1..4480b828 100644 --- a/src/easyreflectometry/project.py +++ b/src/easyreflectometry/project.py @@ -24,6 +24,7 @@ from easyreflectometry.model import PercentageFhwm from easyreflectometry.sample import Layer from easyreflectometry.sample import MaterialCollection +from easyreflectometry.sample import Material from easyreflectometry.sample import Multilayer from easyreflectometry.sample import Sample from easyreflectometry.sample.collections.base_collection import BaseCollection @@ -211,22 +212,22 @@ def path_json(self): def get_index_air(self) -> int: if 'Air' not in [material.name for material in self._materials]: - self._materials.add_material('Air', 0.0, 0.0) + self._materials.add_material(Material(name='Air', sld=0.0, isld=0.0)) return [material.name for material in self._materials].index('Air') def get_index_si(self) -> int: if 'Si' not in [material.name for material in self._materials]: - self._materials.add_material('Si', 2.07, 0.0) + self._materials.add_material(Material(name='Si', sld=2.07, isld=0.0)) return [material.name for material in self._materials].index('Si') def get_index_sio2(self) -> int: if 'SiO2' not in [material.name for material in self._materials]: - self._materials.add_material('SiO2', 3.47, 0.0) + self._materials.add_material(Material(name='SiO2', sld=3.47, isld=0.0)) return [material.name for material in self._materials].index('SiO2') def get_index_d2o(self) -> int: if 'D2O' not in [material.name for material in self._materials]: - self._materials.add_material('D2O', 6.36, 0.0) + self._materials.add_material(Material(name='D2O', sld=6.36, isld=0.0)) return [material.name for material in self._materials].index('D2O') def load_experiment_for_model_at_index(self, path: Union[Path, str], index: Optional[int] = 0) -> None: