Refactor of flow tools - Verification of XZCorrections objects#381
Closed
matulni wants to merge 22 commits intoTeamGraphix:masterfrom
Closed
Refactor of flow tools - Verification of XZCorrections objects#381matulni wants to merge 22 commits intoTeamGraphix:masterfrom
XZCorrections objects#381matulni wants to merge 22 commits intoTeamGraphix:masterfrom
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #381 +/- ##
==========================================
- Coverage 86.31% 86.05% -0.27%
==========================================
Files 44 45 +1
Lines 6183 6756 +573
==========================================
+ Hits 5337 5814 +477
- Misses 846 942 +96 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This was referenced Dec 1, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds a new method
:func: XZCorrections.check_well_formedto verify the correctness of XZ-corrections objects.A correct$O^c$ .
XZCorrectionsinstance verifies the following properties:- Keys of the correction dictionaries are measured nodes, i.e., a subset of
- Corrections respect the partial order.
- The first layer of the partial order contains all the output nodes if there are any.
- The partial order contains all the nodes (without duplicates) and it does not have empty layers.
Flow and XZ-corrections exceptions.
This PR builds on the exception classes introduced in #378. It requires changes introduced in #378.
We detail next the full exception landscape.
--- config: layout: elk elk: mergeEdges: false nodePlacementStrategy: LINEAR_SEGMENTS --- flowchart TD a0(**Exception**) b0("**Generic[_Reason]**") m0(**XZCorrectionsError**) n0(**FlowError**) n1(CorrectionFunctionError) n2(FlowPropositionError) n3(FlowPropositionOrderError) n4(PartialOrderError) n5(PartialOrderLayerError) m1(XZCorrectionsOrderError) a0 --> m0 a0 --> n0 b0 --> m0 b0 --> n0 m0 --POEReason--> n4 m0 --POLEReason--> n5 m0 --XZCOEReason--> m1 n0 --CFEReason--> n1 n0 --FPEReason--> n2 n0 --FPOEReason--> n3 n0 --POEReason--> n4 n0 --POLEReason--> n5Arrows indicate inheritance (from parent to child).
_Reasonis a parametric type bound to the union ofFlowErrorReason | XZCorrectionsErrorReason | str. Binding tostrallows passing generic error messages toXZCorrectionsErrorandFlowError. All errors require this parameter."Reasons" (
XZCorrectionsOrderErrorReason,PartialOrderLayerErrorReason, etc.) areEnumclasses which inherit fromFlowErrorReasonorXZCorrectionsErrorReasonor both.Error subclasses:
CorrectionFunctionErrorFlowPropositionErrornodecorrection_setFlowPropositionOrderErrornodecorrection_setpast_and_present_nodesPartialOrderErrorPartialOrderLayerErrorlayer_indexlayerXZCorrectionsOrderErrornodecorrection_setpast_and_present_nodes