diff --git a/src/elli/solver.py b/src/elli/solver.py index e0e8d48a..4f3ada49 100644 --- a/src/elli/solver.py +++ b/src/elli/solver.py @@ -26,8 +26,11 @@ class Solver(ABC): def calculate(self) -> Result: pass - def __init__(self, experiment: "Experiment") -> None: - self.experiment = deepcopy(experiment) + def __init__(self, experiment: "Experiment", save_experiment: bool = False) -> None: + if save_experiment: + self.experiment = deepcopy(experiment) + else: + self.experiment = experiment self.structure = self.experiment.structure self.lbda = self.experiment.lbda self.theta_i = self.experiment.theta_i diff --git a/src/elli/solver4x4.py b/src/elli/solver4x4.py index 6c3a10cd..8f57e22a 100644 --- a/src/elli/solver4x4.py +++ b/src/elli/solver4x4.py @@ -314,9 +314,12 @@ def get_k_z( return sqrt(k_z2) def __init__( - self, experiment: "Experiment", propagator: Propagator = PropagatorExpm() + self, + experiment: "Experiment", + propagator: Propagator = PropagatorExpm(), + save_experiment: bool = False, ) -> None: - super().__init__(experiment) + super().__init__(experiment, save_experiment) self.propagator = propagator def calculate(self) -> Result: