ATTPC / Spyral

A Python analysis library for AT-TPC data
GNU General Public License v3.0
2 stars 2 forks source link

ArtifactSchema and Validation is Fragile #128

Open DBazin opened 4 months ago

DBazin commented 4 months ago

The schema validation fails when inserting a new phase inside the pipeline, because the name of the schema expected by the phase following the new one doesn't match the schema's name of the inserted new phase, even if they have the same structure. Maybe this is moot because in most cases the phases following the inserted one will have to be customized anyway if the inserted phase changes the structure of the schema being transmitted. Something to discuss I think.

gwm17 commented 4 months ago

Yeah this is definitely worth looking at. The schema is pretty brittle the way I put it together now, particularly for inserting a Phase. For the issue you've described, was it that the structure (the dictionary/list in the schema) or the extension that was giving you problems?

DBazin commented 4 months ago

The schema of my inserted phase is actually the same structure as the previous one (ESTIMATE_SCHEMA), I just changed the name, so the validation seems to rely on that name rather than the structure itself.

gwm17 commented 4 months ago

That's weird... I overloaded the equality comparison operator to specifically only compare the individual fields. I'll look into this more carefully and see what's going on!

gwm17 commented 4 months ago

Ah ok I think I see the problem. I'm comparing two lists (or dictionaries) which is not a well defined op with == by default. Should be relatively easy to fix. Will be slated for the next release!

gwm17 commented 4 months ago

Removing the bug label, but leaving this open as it is still being discussed