diff --git a/src/easyreflectometry/fitting.py b/src/easyreflectometry/fitting.py index bdb5eb61..37f73b19 100644 --- a/src/easyreflectometry/fitting.py +++ b/src/easyreflectometry/fitting.py @@ -487,7 +487,10 @@ class FitRun: zero). The per-dataset objective values add up to the pooled one: the engine's per-dataset results are disjoint slices of the pooled residuals. - A record is history: read it, do not write to its dictionaries. + A record is history: read it, do not write to it. Being frozen, it + protects its fields from reassignment, but not the ``pooled`` and + ``per_dataset`` dictionaries inside them, which are plain and shared with + every holder of the record. Copy them before changing anything. """ status: str diff --git a/src/easyreflectometry/project.py b/src/easyreflectometry/project.py index ff8d03d1..f3d31656 100644 --- a/src/easyreflectometry/project.py +++ b/src/easyreflectometry/project.py @@ -657,7 +657,12 @@ def record_fit(self, prepared: PreparedFit, results: Optional[list] = None, stat @property def last_fit(self) -> Optional[FitRun]: - """The record of the latest fit recorded with :meth:`record_fit`, or None.""" + """The record of the latest fit recorded with :meth:`record_fit`, or None. + + The record is read-only history. Its ``pooled`` and ``per_dataset`` + dictionaries are shared with the record itself, so copy them before + changing anything; see :class:`~easyreflectometry.fitting.FitRun`. + """ return self._last_fit # ----- structural parameter paths -----