Closed chillenzer closed 1 year ago
Options as I see them:
freeze
and disallow freezing of inconsistent ensemblesfreeze
, but keep a separate consistent
property to allow inconsistent frozen ensemblesProbably option 2 makes most sense.
Also strong proponent of 2. On the others:
consistent
is not a boolean but an explanation of what's inconsistent if anything. This way the user could use it interactively or in an automated session to react on freeze failures, e.g.,
>>> correlator_ensemble.freeze()
...
DataConsistencyError: The following aspects are inconsistent about your data:
...
Run <instance>.consistent() to get more details in a human- and machine-readable way.
>>> correlator_ensemble.consistent()
{<inconsistency: {'affected': ..., 'more_details': ...}, ...}
>>> for inconsistency in _:
... correlator_ensemble = cure(inconsistency, correlator_ensemble)
>>> correlator_ensemble.freeze()
# works fine
Do we want to enforce the following? (All up to duplication due to other columns.)
self.correlators["MC_Time"] == range(self.num_samples)
-> My opinion: No, because pyerrors
is totally fine with incomplete ensembles and it might make sense to, e.g., reduce autocorrelation, etc.self.correlators["Time"] == range(self.NT)
-> My opinion: Maybe. Contiguous might be a reasonable assumption. Don't think that it needs to start from 0. If you have, for example, long correlators and know already that they are contaminated with excited states for the first $n$ distances, you might want to skip them entirely in the analysis.pyerrors
gives an annoyingly cryptic error when it works out that the smallest separation between MC time indices is zero.NT
(see #27). But possibly not worth spending effort on at this point, particularly if it'll need to be removed later.Concerning duplicate handling in pyerrors
. Should be an issue there, shouldn't it?
Arguably yes.
Edit: I've raised https://github.com/fjosw/pyerrors/issues/214
Quick question: What shall happen with the consistency checks now that we have basic data validation in place upon
freeze()
? Some of them are definitely out of sync with what we have defined as our data schema (e.g. they all assume values fromrange(...)
). Others may still add value, particularly concerning consistency betweencorrelators
andvevs
. As I disallow any modification after freezing, it seems reasonable to actually move an updated set of consistency checks into thefreeze()
operation (and potentially even into the schema) and drop the@only_on_consistent_data
in favour of some@only_on_frozen_data
.