From bc9b277060e6f4c4eecbd56b779c01059d25d754 Mon Sep 17 00:00:00 2001 From: rozyczko Date: Wed, 15 Oct 2025 13:32:36 +0200 Subject: [PATCH] set the save flag when loading experiment --- src/easyreflectometry/project.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/easyreflectometry/project.py b/src/easyreflectometry/project.py index 6f25fba3..70c3cd36 100644 --- a/src/easyreflectometry/project.py +++ b/src/easyreflectometry/project.py @@ -264,6 +264,16 @@ def load_new_experiment(self, path: Union[Path, str]) -> None: new_experiment.model = self.models[model_index] self._experiments[new_index] = new_experiment # self._current_model_index = new_index + self._with_experiments = True + + # Set the resolution function if variance data is present + if sum(new_experiment.ye) != 0: + q = new_experiment.x + reflectivity = new_experiment.y + q_error = new_experiment.xe + # TODO: set resolution function based on value of control in GUI + resolution_function = Pointwise(q_data_points=[q, reflectivity, q_error]) + self.models[model_index].resolution_function = resolution_function def load_experiment_for_model_at_index(self, path: Union[Path, str], index: Optional[int] = 0) -> None: self._experiments[index] = load_as_dataset(str(path))