Comparison¶
etcion.comparison
¶
Model comparison and diff utilities (EPIC-024, FEAT-24.1 / FEAT-24.2).
FieldChange(field, old, new)
dataclass
¶
A single field-level change between two concept snapshots.
ConceptChange(concept_id, concept_type, changes)
dataclass
¶
A concept present in both models whose fields differ.
ModelDiff(added, removed, modified)
dataclass
¶
Immutable result of comparing two models.
to_dict()
¶
Return a JSON-serializable dict representation.
Source code in src/etcion/comparison.py
45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 | |
summary()
¶
Return a human-readable one-line summary.
Source code in src/etcion/comparison.py
68 69 70 71 72 73 74 | |
diff_models(model_a, model_b, *, match_by='id')
¶
Compare two models and return a structured diff.
:param model_a: Baseline ("before") model.
:param model_b: Revised ("after") model.
:param match_by: "id" matches concepts by id; "type_name" matches
by (type_name, name) tuple.
:returns: A frozen :class:ModelDiff.
Source code in src/etcion/comparison.py
114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 | |