grus 0.2.0__tar.gz → 0.3.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {grus-0.2.0 → grus-0.3.0}/PKG-INFO +1 -1
- {grus-0.2.0 → grus-0.3.0}/docs/design/ir.md +2 -3
- {grus-0.2.0 → grus-0.3.0}/docs/design/layout-store.md +28 -17
- {grus-0.2.0 → grus-0.3.0}/grus/ir/_migrate.py +2 -2
- {grus-0.2.0 → grus-0.3.0}/grus/render/_store.py +67 -9
- {grus-0.2.0 → grus-0.3.0}/pyproject.toml +1 -1
- {grus-0.2.0 → grus-0.3.0}/schema/proto/grus/models/layout.proto +1 -1
- {grus-0.2.0 → grus-0.3.0}/tests/layout_pins.json +60 -60
- {grus-0.2.0 → grus-0.3.0}/tests/test_ir_migrate.py +4 -18
- {grus-0.2.0 → grus-0.3.0}/tests/test_layout_store.py +182 -0
- {grus-0.2.0 → grus-0.3.0}/.gitignore +0 -0
- {grus-0.2.0 → grus-0.3.0}/GLOSSARY.md +0 -0
- {grus-0.2.0 → grus-0.3.0}/LICENSE +0 -0
- {grus-0.2.0 → grus-0.3.0}/README.md +0 -0
- {grus-0.2.0 → grus-0.3.0}/buf/validate/validate_pb2.py +0 -0
- {grus-0.2.0 → grus-0.3.0}/buf/validate/validate_pb2.pyi +0 -0
- {grus-0.2.0 → grus-0.3.0}/docs/PRODUCT.md +0 -0
- {grus-0.2.0 → grus-0.3.0}/docs/design/convert.md +0 -0
- {grus-0.2.0 → grus-0.3.0}/docs/design/layout-v2.md +0 -0
- {grus-0.2.0 → grus-0.3.0}/docs/design/renderer.md +0 -0
- {grus-0.2.0 → grus-0.3.0}/docs/design/svg-output-symbol.svg +0 -0
- {grus-0.2.0 → grus-0.3.0}/docs/design/svg-output.md +0 -0
- {grus-0.2.0 → grus-0.3.0}/docs/research/pedigree-file-formats.md +0 -0
- {grus-0.2.0 → grus-0.3.0}/docs/research/phenopackets-vs-bespoke-ir.md +0 -0
- {grus-0.2.0 → grus-0.3.0}/docs/style/design-docs.md +0 -0
- {grus-0.2.0 → grus-0.3.0}/docs/style/general.md +0 -0
- {grus-0.2.0 → grus-0.3.0}/docs/style/python.md +0 -0
- {grus-0.2.0 → grus-0.3.0}/grus/cli.py +0 -0
- {grus-0.2.0 → grus-0.3.0}/grus/convert/__init__.py +0 -0
- {grus-0.2.0 → grus-0.3.0}/grus/convert/_core.py +0 -0
- {grus-0.2.0 → grus-0.3.0}/grus/convert/_kinship2.py +0 -0
- {grus-0.2.0 → grus-0.3.0}/grus/convert/_openpedigree.py +0 -0
- {grus-0.2.0 → grus-0.3.0}/grus/convert/_ped.py +0 -0
- {grus-0.2.0 → grus-0.3.0}/grus/convert/_phenopackets.py +0 -0
- {grus-0.2.0 → grus-0.3.0}/grus/convert/py.typed +0 -0
- {grus-0.2.0 → grus-0.3.0}/grus/ir/__init__.py +0 -0
- {grus-0.2.0 → grus-0.3.0}/grus/ir/_conditions.py +0 -0
- {grus-0.2.0 → grus-0.3.0}/grus/ir/_diff.py +0 -0
- {grus-0.2.0 → grus-0.3.0}/grus/ir/_serialize.py +0 -0
- {grus-0.2.0 → grus-0.3.0}/grus/ir/_validate.py +0 -0
- {grus-0.2.0 → grus-0.3.0}/grus/ir/py.typed +0 -0
- {grus-0.2.0 → grus-0.3.0}/grus/models/layout_pb2.py +0 -0
- {grus-0.2.0 → grus-0.3.0}/grus/models/layout_pb2.pyi +0 -0
- {grus-0.2.0 → grus-0.3.0}/grus/models/pedigree_pb2.py +0 -0
- {grus-0.2.0 → grus-0.3.0}/grus/models/pedigree_pb2.pyi +0 -0
- {grus-0.2.0 → grus-0.3.0}/grus/models/py.typed +0 -0
- {grus-0.2.0 → grus-0.3.0}/grus/render/__init__.py +0 -0
- {grus-0.2.0 → grus-0.3.0}/grus/render/_draw.py +0 -0
- {grus-0.2.0 → grus-0.3.0}/grus/render/_extras.py +0 -0
- {grus-0.2.0 → grus-0.3.0}/grus/render/_geometry.py +0 -0
- {grus-0.2.0 → grus-0.3.0}/grus/render/_labels.py +0 -0
- {grus-0.2.0 → grus-0.3.0}/grus/render/_layout.py +0 -0
- {grus-0.2.0 → grus-0.3.0}/grus/render/_layout2.py +0 -0
- {grus-0.2.0 → grus-0.3.0}/grus/render/_ordering.py +0 -0
- {grus-0.2.0 → grus-0.3.0}/grus/render/_raster.py +0 -0
- {grus-0.2.0 → grus-0.3.0}/grus/render/_xsolve.py +0 -0
- {grus-0.2.0 → grus-0.3.0}/grus/render/py.typed +0 -0
- {grus-0.2.0 → grus-0.3.0}/schema/proto/grus/models/pedigree.proto +0 -0
- {grus-0.2.0 → grus-0.3.0}/tests/convert_fixture/basic.pre +0 -0
- {grus-0.2.0 → grus-0.3.0}/tests/convert_fixture/family.phenopackets.json +0 -0
- {grus-0.2.0 → grus-0.3.0}/tests/convert_fixture/kinship2.csv +0 -0
- {grus-0.2.0 → grus-0.3.0}/tests/convert_fixture/simple.openpedigree.json +0 -0
- {grus-0.2.0 → grus-0.3.0}/tests/convert_fixture/trio.psam +0 -0
- {grus-0.2.0 → grus-0.3.0}/tests/convert_fixture/two_families.fam +0 -0
- {grus-0.2.0 → grus-0.3.0}/tests/goldens/carrier_inheritance.pbtxt +0 -0
- {grus-0.2.0 → grus-0.3.0}/tests/goldens/carrier_inheritance.svg +0 -0
- {grus-0.2.0 → grus-0.3.0}/tests/goldens/childless.pbtxt +0 -0
- {grus-0.2.0 → grus-0.3.0}/tests/goldens/childless.svg +0 -0
- {grus-0.2.0 → grus-0.3.0}/tests/goldens/compound_carrier.pbtxt +0 -0
- {grus-0.2.0 → grus-0.3.0}/tests/goldens/compound_carrier.svg +0 -0
- {grus-0.2.0 → grus-0.3.0}/tests/goldens/condition_fills.pbtxt +0 -0
- {grus-0.2.0 → grus-0.3.0}/tests/goldens/condition_fills.svg +0 -0
- {grus-0.2.0 → grus-0.3.0}/tests/goldens/consanguineous.pbtxt +0 -0
- {grus-0.2.0 → grus-0.3.0}/tests/goldens/consanguineous.svg +0 -0
- {grus-0.2.0 → grus-0.3.0}/tests/goldens/count_collapsed_parents.pbtxt +0 -0
- {grus-0.2.0 → grus-0.3.0}/tests/goldens/count_collapsed_parents.svg +0 -0
- {grus-0.2.0 → grus-0.3.0}/tests/goldens/count_marks.pbtxt +0 -0
- {grus-0.2.0 → grus-0.3.0}/tests/goldens/count_marks.svg +0 -0
- {grus-0.2.0 → grus-0.3.0}/tests/goldens/counts.pbtxt +0 -0
- {grus-0.2.0 → grus-0.3.0}/tests/goldens/counts.svg +0 -0
- {grus-0.2.0 → grus-0.3.0}/tests/goldens/cousins_across_family.pbtxt +0 -0
- {grus-0.2.0 → grus-0.3.0}/tests/goldens/cousins_across_family.svg +0 -0
- {grus-0.2.0 → grus-0.3.0}/tests/goldens/cousins_across_middle_sibling.pbtxt +0 -0
- {grus-0.2.0 → grus-0.3.0}/tests/goldens/cousins_across_middle_sibling.svg +0 -0
- {grus-0.2.0 → grus-0.3.0}/tests/goldens/crossing_descents.pbtxt +0 -0
- {grus-0.2.0 → grus-0.3.0}/tests/goldens/crossing_descents.svg +0 -0
- {grus-0.2.0 → grus-0.3.0}/tests/goldens/descent_across_rows.pbtxt +0 -0
- {grus-0.2.0 → grus-0.3.0}/tests/goldens/descent_across_rows.svg +0 -0
- {grus-0.2.0 → grus-0.3.0}/tests/goldens/detached_branch.pbtxt +0 -0
- {grus-0.2.0 → grus-0.3.0}/tests/goldens/detached_branch.svg +0 -0
- {grus-0.2.0 → grus-0.3.0}/tests/goldens/founder_sibship.pbtxt +0 -0
- {grus-0.2.0 → grus-0.3.0}/tests/goldens/founder_sibship.svg +0 -0
- {grus-0.2.0 → grus-0.3.0}/tests/goldens/founder_sibship_marry_in.pbtxt +0 -0
- {grus-0.2.0 → grus-0.3.0}/tests/goldens/founder_sibship_marry_in.svg +0 -0
- {grus-0.2.0 → grus-0.3.0}/tests/goldens/half_sibs.pbtxt +0 -0
- {grus-0.2.0 → grus-0.3.0}/tests/goldens/half_sibs.svg +0 -0
- {grus-0.2.0 → grus-0.3.0}/tests/goldens/hinge_family.pbtxt +0 -0
- {grus-0.2.0 → grus-0.3.0}/tests/goldens/hinge_family.svg +0 -0
- {grus-0.2.0 → grus-0.3.0}/tests/goldens/hinge_offcentre.pbtxt +0 -0
- {grus-0.2.0 → grus-0.3.0}/tests/goldens/hinge_offcentre.svg +0 -0
- {grus-0.2.0 → grus-0.3.0}/tests/goldens/lone_parent_sibships.pbtxt +0 -0
- {grus-0.2.0 → grus-0.3.0}/tests/goldens/lone_parent_sibships.svg +0 -0
- {grus-0.2.0 → grus-0.3.0}/tests/goldens/mz_twins_with_three_partners.pbtxt +0 -0
- {grus-0.2.0 → grus-0.3.0}/tests/goldens/mz_twins_with_three_partners.svg +0 -0
- {grus-0.2.0 → grus-0.3.0}/tests/goldens/sibship.pbtxt +0 -0
- {grus-0.2.0 → grus-0.3.0}/tests/goldens/sibship.svg +0 -0
- {grus-0.2.0 → grus-0.3.0}/tests/goldens/six_conditions.pbtxt +0 -0
- {grus-0.2.0 → grus-0.3.0}/tests/goldens/six_conditions.svg +0 -0
- {grus-0.2.0 → grus-0.3.0}/tests/goldens/three_generation.pbtxt +0 -0
- {grus-0.2.0 → grus-0.3.0}/tests/goldens/three_generation.svg +0 -0
- {grus-0.2.0 → grus-0.3.0}/tests/goldens/trio.pbtxt +0 -0
- {grus-0.2.0 → grus-0.3.0}/tests/goldens/trio.svg +0 -0
- {grus-0.2.0 → grus-0.3.0}/tests/goldens/twin_married.pbtxt +0 -0
- {grus-0.2.0 → grus-0.3.0}/tests/goldens/twin_married.svg +0 -0
- {grus-0.2.0 → grus-0.3.0}/tests/goldens/twin_with_two_partners.pbtxt +0 -0
- {grus-0.2.0 → grus-0.3.0}/tests/goldens/twin_with_two_partners.svg +0 -0
- {grus-0.2.0 → grus-0.3.0}/tests/goldens/twins.pbtxt +0 -0
- {grus-0.2.0 → grus-0.3.0}/tests/goldens/twins.svg +0 -0
- {grus-0.2.0 → grus-0.3.0}/tests/goldens/twins_marry_chain_stretches.pbtxt +0 -0
- {grus-0.2.0 → grus-0.3.0}/tests/goldens/twins_marry_chain_stretches.svg +0 -0
- {grus-0.2.0 → grus-0.3.0}/tests/goldens/twins_marry_cousins_apart.pbtxt +0 -0
- {grus-0.2.0 → grus-0.3.0}/tests/goldens/twins_marry_cousins_apart.svg +0 -0
- {grus-0.2.0 → grus-0.3.0}/tests/goldens/unknown_twin_with_two_partners.pbtxt +0 -0
- {grus-0.2.0 → grus-0.3.0}/tests/goldens/unknown_twin_with_two_partners.svg +0 -0
- {grus-0.2.0 → grus-0.3.0}/tests/test_cli.py +0 -0
- {grus-0.2.0 → grus-0.3.0}/tests/test_convert_core.py +0 -0
- {grus-0.2.0 → grus-0.3.0}/tests/test_convert_formats.py +0 -0
- {grus-0.2.0 → grus-0.3.0}/tests/test_fuzz_diff.py +0 -0
- {grus-0.2.0 → grus-0.3.0}/tests/test_fuzz_gen.py +0 -0
- {grus-0.2.0 → grus-0.3.0}/tests/test_fuzz_minimize.py +0 -0
- {grus-0.2.0 → grus-0.3.0}/tests/test_fuzz_shuffle.py +0 -0
- {grus-0.2.0 → grus-0.3.0}/tests/test_ir.py +0 -0
- {grus-0.2.0 → grus-0.3.0}/tests/test_ir_citations.py +0 -0
- {grus-0.2.0 → grus-0.3.0}/tests/test_layout2.py +0 -0
- {grus-0.2.0 → grus-0.3.0}/tests/test_optional_extras.py +0 -0
- {grus-0.2.0 → grus-0.3.0}/tests/test_pedigree_proto.py +0 -0
- {grus-0.2.0 → grus-0.3.0}/tests/test_pedigree_set.py +0 -0
- {grus-0.2.0 → grus-0.3.0}/tests/test_render.py +0 -0
- {grus-0.2.0 → grus-0.3.0}/tests/test_render_all.py +0 -0
- {grus-0.2.0 → grus-0.3.0}/tests/test_render_raster.py +0 -0
- {grus-0.2.0 → grus-0.3.0}/tests/test_render_set.py +0 -0
- {grus-0.2.0 → grus-0.3.0}/tests/test_svg_output.py +0 -0
- {grus-0.2.0 → grus-0.3.0}/tests/test_xsolve.py +0 -0
- {grus-0.2.0 → grus-0.3.0}/tests/xsolve/tie_face.pbtxt +0 -0
|
@@ -215,9 +215,8 @@ A removed field's number and name are reserved, never reused: `condition_id` tak
|
|
|
215
215
|
that states no inheritance takes its name's stated one; entries of one name stating different modes, or one person
|
|
216
216
|
with two entries of one name (pre-1.0 allowed affected and carrier together), have no 1.0 form and raise
|
|
217
217
|
`MigrationError`; so does a support naming a condition no one has. The result is validated.
|
|
218
|
-
- **Stored layouts
|
|
219
|
-
declaration in the pre-1.0 encoding, so a
|
|
220
|
-
it; its name and inheritance do.
|
|
218
|
+
- **Stored layouts read entries through declarations.** The stored-layout digest (`layout-store.md`) reads each entry
|
|
219
|
+
through its declaration in the pre-1.0 encoding, so a declaration's id never enters it; its name and inheritance do.
|
|
221
220
|
|
|
222
221
|
A condition-centred view (each condition with the people who have it, as a case-record `Assertion` with `applies_to`) is
|
|
223
222
|
a mechanical projection of this form, so an export can produce it without storing it.
|
|
@@ -95,20 +95,22 @@ their individuals or matings produce byte-identical records.
|
|
|
95
95
|
A stored layout is valid for a pedigree and a geometry only if a fresh layout would produce it. The key captures every
|
|
96
96
|
input to the layout:
|
|
97
97
|
|
|
98
|
-
- **a content digest of
|
|
99
|
-
matings sorted by their own serialized bytes,
|
|
100
|
-
the IR gives meaning (birth order), is kept.
|
|
101
|
-
reads
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
`
|
|
110
|
-
|
|
111
|
-
`
|
|
98
|
+
- **a content digest of what layout reads** — SHA-256 over a canonical serialization of the pedigree with every field
|
|
99
|
+
layout does not read cleared first: individuals sorted by `Position`, matings sorted by their own serialized bytes,
|
|
100
|
+
the rest serialized deterministically. Offspring order, which the IR gives meaning (birth order), is kept. Drawing
|
|
101
|
+
re-reads the pedigree whether or not the layout was stored, so a field only drawing reads — a title, the proband
|
|
102
|
+
arrow, the symbol's shape, an external id — cannot make a stored layout wrong and does not enter. What layout reads is
|
|
103
|
+
the structure (positions, matings, offspring and twins, which the stored cells record) and what sets a label's or a
|
|
104
|
+
count's reach, and so the spacing: annotation text, a count, and the marks that push a count beside its symbol (the
|
|
105
|
+
deceased slash and the conditions' statuses, names and inheritance). Every field of every message the digest reaches
|
|
106
|
+
is classified in `grus.render._store` as read (hashed) or ignored (cleared), and a test fails on a field in neither,
|
|
107
|
+
so a new IR field cannot silently mark stored layouts stale nor silently be ignored when layout reads it. The
|
|
108
|
+
set-level citation list is outside the pedigree and so outside the digest. The set-level condition declarations are
|
|
109
|
+
not (`ir.md`, "Conditions are declared once, by id"): a declaration's name and inheritance are read through each
|
|
110
|
+
entry, so each entry enters in the pre-1.0 encoding, its `condition_id` replaced by its declaration's `name` and
|
|
111
|
+
`inheritance`, and the classification runs on that encoding. A declaration's own fields are classified too: its `id`
|
|
112
|
+
is not read, so renaming it leaves the digest. `store_layout`, `load_layout` and drawing from a stored layout take the
|
|
113
|
+
declarations alongside the pedigree (`conditions=`).
|
|
112
114
|
- **the layout-affecting geometry**, stored as values so a mismatch can say which: `couple_gap` and `sib_gap` (the row
|
|
113
115
|
separations), `label_size`, `label_box_width`, `label_gap` and `x_unit` (label clearance is computed in pixels and
|
|
114
116
|
converted to layout units, and a label beside a centre drop reserves `label_gap`), `symbol_size` and `carrier_style`
|
|
@@ -189,9 +191,18 @@ and a record that sets it is refused. Version 2 also defers a mating whose partn
|
|
|
189
191
|
- **Store the front end's synthetic `Position`s verbatim** (phantoms and pass-throughs have stable negative indices).
|
|
190
192
|
Rejected: negative indices fail the IR's field rules, and the encoding is an implementation detail a version bump
|
|
191
193
|
would have to track; semantic keys state what the cell is.
|
|
192
|
-
- **Hash
|
|
193
|
-
|
|
194
|
-
|
|
194
|
+
- **Hash the whole pedigree.** No classification to maintain. Rejected: every edit to provenance, an id or meaning with
|
|
195
|
+
no drawn form marks stored layouts stale, and a harness edits exactly those after the fact. The risk the projection
|
|
196
|
+
carries instead — a field layout reads left out, so a silently stale drawing — is accepted and guarded by tests: a
|
|
197
|
+
field in neither class fails, an edit to a cleared field must leave the stored layout byte-identical and draw from it
|
|
198
|
+
exactly as a fresh render does, and an edit to a hashed scalar must move the digest. One edit per field on one sample
|
|
199
|
+
catches a regression only along the paths that sample exercises; the sample is chosen to reach the legend's order,
|
|
200
|
+
sixths and a count beside its symbol, the paths the cleared drawn fields come nearest to.
|
|
201
|
+
- **Hash what layout or drawing reads.** One question per field — is it drawn at all — answered at a glance, where
|
|
202
|
+
whether layout reads a field has to be traced through the label and count helpers, and a wrong answer is a silently
|
|
203
|
+
wrong drawing rather than a needless relayout. Rejected: drawing re-reads the pedigree, so a drawing-only field cannot
|
|
204
|
+
make a stored layout wrong, and hashing it buys only stale layouts when a title, the proband or an external id is
|
|
205
|
+
edited.
|
|
195
206
|
- **Recompute on a stale key.** Friendlier for a caller who does not care. Rejected: it turns a cache bug into a slow
|
|
196
207
|
path nobody notices; a caller can catch the error and recompute.
|
|
197
208
|
|
|
@@ -112,8 +112,8 @@ def _legacy_classes() -> tuple[type[Message], type[Message]]:
|
|
|
112
112
|
def legacy_pedigree(p: pb.Pedigree, conditions: Iterable[pb.ConditionDef]) -> Message:
|
|
113
113
|
"""``p`` in the 0.x schema: each entry carries its declaration's name and inheritance, as before 1.0.
|
|
114
114
|
|
|
115
|
-
A support's ``condition_id`` does not carry over. The stored-layout digest serializes this form, so a
|
|
116
|
-
|
|
115
|
+
A support's ``condition_id`` does not carry over. The stored-layout digest serializes this form, so a declaration's
|
|
116
|
+
id never enters it.
|
|
117
117
|
|
|
118
118
|
Raises:
|
|
119
119
|
UndeclaredConditionError: an entry names a ``condition_id`` no declaration has.
|
|
@@ -15,6 +15,7 @@ from collections.abc import Sequence
|
|
|
15
15
|
from typing import Any
|
|
16
16
|
|
|
17
17
|
import protovalidate
|
|
18
|
+
from google.protobuf import message
|
|
18
19
|
|
|
19
20
|
from grus import ir
|
|
20
21
|
from grus.ir import _migrate
|
|
@@ -47,22 +48,79 @@ class StaleLayoutError(Exception):
|
|
|
47
48
|
"""
|
|
48
49
|
|
|
49
50
|
|
|
51
|
+
# Every field of every message the digest reaches: LAYOUT_READS is hashed, LAYOUT_IGNORES cleared first. Keys are the
|
|
52
|
+
# pre-1.0 messages the digest serializes (a Condition carries its declaration's name and inheritance), plus
|
|
53
|
+
# ConditionDef, whose fields reach the digest only through those entries.
|
|
54
|
+
LAYOUT_READS: dict[str, frozenset[str]] = {
|
|
55
|
+
"Pedigree": frozenset({"individuals", "matings"}),
|
|
56
|
+
"Individual": frozenset(
|
|
57
|
+
{
|
|
58
|
+
"generation",
|
|
59
|
+
"index",
|
|
60
|
+
"conditions", # a centre mark moves a count beside its symbol; sections count distinct names
|
|
61
|
+
"deceased", # the slash is a centre mark
|
|
62
|
+
"count",
|
|
63
|
+
"count_unspecified",
|
|
64
|
+
"annotations", # label width
|
|
65
|
+
}
|
|
66
|
+
),
|
|
67
|
+
"Condition": frozenset({"name", "status", "inheritance"}), # inheritance: the X-linked carrier dot
|
|
68
|
+
"ConditionDef": frozenset({"name", "inheritance"}),
|
|
69
|
+
"Annotation": frozenset({"text"}),
|
|
70
|
+
"Mating": frozenset({"partner_a", "partner_b", "consanguineous", "childlessness", "offspring"}),
|
|
71
|
+
"Offspring": frozenset({"child", "twin_group", "twin_type"}),
|
|
72
|
+
"Position": frozenset({"generation", "index"}),
|
|
73
|
+
}
|
|
74
|
+
LAYOUT_IGNORES: dict[str, frozenset[str]] = {
|
|
75
|
+
# labels: the legend's order, never its length
|
|
76
|
+
"Pedigree": frozenset({"id", "provenance", "evidence", "supports", "labels"}),
|
|
77
|
+
"Individual": frozenset(
|
|
78
|
+
{
|
|
79
|
+
"gender", # sizes a count inside its symbol, never its reach
|
|
80
|
+
"proband", # the legend's order, never its length
|
|
81
|
+
"consultand",
|
|
82
|
+
"external_id",
|
|
83
|
+
"sex_assigned_at_birth",
|
|
84
|
+
"reproductive_outcome",
|
|
85
|
+
"reproductive_role",
|
|
86
|
+
"documented_evaluation",
|
|
87
|
+
}
|
|
88
|
+
),
|
|
89
|
+
"Condition": frozenset({"onset_age"}),
|
|
90
|
+
"ConditionDef": frozenset({"id"}),
|
|
91
|
+
"Annotation": frozenset({"type"}),
|
|
92
|
+
"Mating": frozenset({"status", "annotations"}),
|
|
93
|
+
"Offspring": frozenset({"parentage", "adoption"}),
|
|
94
|
+
"Position": frozenset(),
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
def _layout_reads_only(msg: message.Message) -> None:
|
|
99
|
+
"""Clear, in place and recursively, every field of ``msg`` that layout does not read."""
|
|
100
|
+
name = msg.DESCRIPTOR.name
|
|
101
|
+
for field, value in msg.ListFields():
|
|
102
|
+
if field.name not in LAYOUT_READS[name]:
|
|
103
|
+
msg.ClearField(field.name)
|
|
104
|
+
elif field.message_type is not None:
|
|
105
|
+
for item in [value] if isinstance(value, message.Message) else value:
|
|
106
|
+
_layout_reads_only(item)
|
|
107
|
+
|
|
108
|
+
|
|
50
109
|
def pedigree_digest(p: pb.Pedigree, conditions: Sequence[pb.ConditionDef] = ()) -> bytes:
|
|
51
|
-
"""SHA-256 of ``p
|
|
110
|
+
"""SHA-256 of what layout reads of ``p``, canonically: independent of individual and mating order.
|
|
52
111
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
112
|
+
Only the ``LAYOUT_READS`` fields are hashed; the rest (``LAYOUT_IGNORES``) are cleared first, so editing them leaves
|
|
113
|
+
a stored layout valid. Drawing re-reads the pedigree, so a field only drawing reads need not enter. Individuals sort
|
|
114
|
+
by ``Position``, matings by their own serialized bytes; offspring (birth) order is kept. A condition entry enters
|
|
115
|
+
resolved through ``conditions``, the set's declarations, in the 0.x encoding (its declaration's name and
|
|
116
|
+
inheritance in place of its ``condition_id``): renaming a declaration or changing its inheritance changes the
|
|
117
|
+
digest; renaming its id does not.
|
|
59
118
|
|
|
60
119
|
Raises:
|
|
61
120
|
grus.ir.UndeclaredConditionError: an entry names a ``condition_id`` no declaration has.
|
|
62
121
|
"""
|
|
63
122
|
canon: Any = _migrate.legacy_pedigree(p, conditions)
|
|
64
|
-
canon
|
|
65
|
-
canon.ClearField("supports")
|
|
123
|
+
_layout_reads_only(canon)
|
|
66
124
|
# Copies, so clearing the repeated fields below cannot touch them.
|
|
67
125
|
individuals = [copy.deepcopy(ind) for ind in sorted(canon.individuals, key=lambda i: (i.generation, i.index))]
|
|
68
126
|
matings = [copy.deepcopy(m) for m in sorted(canon.matings, key=lambda m: m.SerializeToString(deterministic=True))]
|
|
@@ -31,7 +31,7 @@ message PedigreeSetLayout {
|
|
|
31
31
|
message LayoutKey {
|
|
32
32
|
// grus's layout-algorithm version; bumped by any grus change that alters a layout.
|
|
33
33
|
uint32 algorithm_version = 1 [(buf.validate.field).uint32.gt = 0];
|
|
34
|
-
// SHA-256 of the pedigree's canonical serialization (input-order independent; covers
|
|
34
|
+
// SHA-256 of the pedigree's canonical serialization (input-order independent; covers only what layout reads).
|
|
35
35
|
bytes pedigree_digest = 2 [(buf.validate.field).bytes.len = 32];
|
|
36
36
|
LayoutGeometry geometry = 3 [(buf.validate.field).required = true];
|
|
37
37
|
}
|
|
@@ -1160,245 +1160,245 @@
|
|
|
1160
1160
|
"6": {
|
|
1161
1161
|
"highs": {
|
|
1162
1162
|
"carrier_inheritance": {
|
|
1163
|
-
"pedigree": "
|
|
1163
|
+
"pedigree": "e8a5dd503885e4ac684ea12fee12837e86c3113f3434db631a70f26428899ce5",
|
|
1164
1164
|
"placement": "5a196b3c41b147ec5023997b51c2e9ec85ae734806d1d08eb0cdbbefded9145b"
|
|
1165
1165
|
},
|
|
1166
1166
|
"childless": {
|
|
1167
|
-
"pedigree": "
|
|
1167
|
+
"pedigree": "f7430de54742f274137e493b87407ab26d86b8a80d8dc14d6138bdaa8af0d923",
|
|
1168
1168
|
"placement": "2df63610481a7e9898861e5b736eb955615f6bdc4279399ba35d1d0b2c4536be"
|
|
1169
1169
|
},
|
|
1170
1170
|
"compound_carrier": {
|
|
1171
|
-
"pedigree": "
|
|
1171
|
+
"pedigree": "aa3a15c68d3a348f52405d2f1906e84b172b19797a291aef48400aea1baa7331",
|
|
1172
1172
|
"placement": "15f42e8adaafdb938a7b489cef53cea2bb05090f2ef0987ddf86368b16d2a42f"
|
|
1173
1173
|
},
|
|
1174
1174
|
"condition_fills": {
|
|
1175
|
-
"pedigree": "
|
|
1175
|
+
"pedigree": "e1c9589cd1b994046e5341327bcbde777917d75b300721692b6799555e27787b",
|
|
1176
1176
|
"placement": "204fa83a0182feab7e992077afaf25a5f21623f4d728c9565f89a68f57fcd4c9"
|
|
1177
1177
|
},
|
|
1178
1178
|
"consanguineous": {
|
|
1179
|
-
"pedigree": "
|
|
1179
|
+
"pedigree": "eed38dca873e24a1922f30aa3c2d2c6664f09fb6483d8d6279966f874b7ef74b",
|
|
1180
1180
|
"placement": "0f30a45070c21d8d782970ee5cca87f8252ecc30e41b151a0bee990dfa6d5bee"
|
|
1181
1181
|
},
|
|
1182
1182
|
"count_collapsed_parents": {
|
|
1183
|
-
"pedigree": "
|
|
1183
|
+
"pedigree": "bb3cd4fe1dc45e0f98286e228d03e9ce2677739e32e0bc1e106cec5e1f315e5b",
|
|
1184
1184
|
"placement": "21a84412d40991a13fc85ecbd3e5369042f09590d2d1ca15a36e0aa6590dbf6c"
|
|
1185
1185
|
},
|
|
1186
1186
|
"count_marks": {
|
|
1187
|
-
"pedigree": "
|
|
1187
|
+
"pedigree": "c67237bccc7f4f8b20a97eec72a277928d7e9fb24778a4e50827fa8cf045dcfa",
|
|
1188
1188
|
"placement": "2cfb5f4b21dcc10d3f1eeb3ce555ef8bf110964082dfaf6d2e0b9d10a34dba15"
|
|
1189
1189
|
},
|
|
1190
1190
|
"counts": {
|
|
1191
|
-
"pedigree": "
|
|
1191
|
+
"pedigree": "db5ccfaa44b55c27d745e85deb01373155192aebc267b10b7a7e8d5dc6cd5284",
|
|
1192
1192
|
"placement": "5b6f131eadf2b1ffdc20d534435d4e0c599e3bb817efe914356d1fa8be20703e"
|
|
1193
1193
|
},
|
|
1194
1194
|
"cousins_across_family": {
|
|
1195
|
-
"pedigree": "
|
|
1195
|
+
"pedigree": "b1dc94afcaf7c016b31cfcb4159b039ec2b44e82e229eadc3d53e0613e6064d1",
|
|
1196
1196
|
"placement": "d54dbea6c0166d942f80bc879386ddc87be91e9562185194d099d65eac6947a6"
|
|
1197
1197
|
},
|
|
1198
1198
|
"cousins_across_middle_sibling": {
|
|
1199
|
-
"pedigree": "
|
|
1199
|
+
"pedigree": "290d52033c08445e8accb9d92c46a2f6e813e57682fa3da3ed0113ddb657a43d",
|
|
1200
1200
|
"placement": "405413654227502cd240048b4ef722a5441e7330ba5093e5b2baeb96ff48ba5d"
|
|
1201
1201
|
},
|
|
1202
1202
|
"crossing_descents": {
|
|
1203
|
-
"pedigree": "
|
|
1203
|
+
"pedigree": "1ac390d8344a2aefa93f39fbc3a3b08f9ff4726d63b6c10f4b6562584c85ac95",
|
|
1204
1204
|
"placement": "86d1d7cd4d036ae641c62d5da0e6fc31286d146c1dbe61bd375f6eb7fa5f91dd"
|
|
1205
1205
|
},
|
|
1206
1206
|
"descent_across_rows": {
|
|
1207
|
-
"pedigree": "
|
|
1207
|
+
"pedigree": "ddf1a56f2117f12adb310c5e11dc1abb1d5966d61caca47c7b1714def5153d8d",
|
|
1208
1208
|
"placement": "56f81f46e577a5235e7bdeeb32e0cf27afca2344a39a091b65f86222cee720fe"
|
|
1209
1209
|
},
|
|
1210
1210
|
"detached_branch": {
|
|
1211
|
-
"pedigree": "
|
|
1211
|
+
"pedigree": "1689ed0a7bfe3f251791f27d5676b17f57235ff5bab41220e3da67005b7ab797",
|
|
1212
1212
|
"placement": "2368efaca4726120106259544ffae63d0c99169bd1af629f732b1dfbbdd8e560"
|
|
1213
1213
|
},
|
|
1214
1214
|
"founder_sibship": {
|
|
1215
|
-
"pedigree": "
|
|
1215
|
+
"pedigree": "34c33204ee6b9e847339251dc007a2d806a088f316f80d585ae456434664c1bf",
|
|
1216
1216
|
"placement": "3a75c28c5328029d262187a5fa540a3cac02261b64c12fbfc42a779ac19d7438"
|
|
1217
1217
|
},
|
|
1218
1218
|
"founder_sibship_marry_in": {
|
|
1219
|
-
"pedigree": "
|
|
1219
|
+
"pedigree": "317713b19b08ab245584faa8d428d92f78fdbc3120a80e840ad1d0f3b05d0f89",
|
|
1220
1220
|
"placement": "55ba9e369d15af650573f80b3bfff2f19d7d5b143a8600b881c9e2b37ccf42ba"
|
|
1221
1221
|
},
|
|
1222
1222
|
"half_sibs": {
|
|
1223
|
-
"pedigree": "
|
|
1223
|
+
"pedigree": "12532e23081e16b6925be6258dfd368d0ee1000d58c597fe11a4f14dc77d826d",
|
|
1224
1224
|
"placement": "3e4b0da09c72cab42bc0ec87319ee097e374a81dd2fd283ad4922a3fb4548cc9"
|
|
1225
1225
|
},
|
|
1226
1226
|
"hinge_family": {
|
|
1227
|
-
"pedigree": "
|
|
1227
|
+
"pedigree": "08732df07931d320618b013a30811ce694e6af167d16d3e44b1ac155185480fa",
|
|
1228
1228
|
"placement": "f7a7226a8083cbac07b41072a2abfadaf94afa479313871f4c0c7cbc9edfad36"
|
|
1229
1229
|
},
|
|
1230
1230
|
"hinge_offcentre": {
|
|
1231
|
-
"pedigree": "
|
|
1231
|
+
"pedigree": "6a5e7c6da669fedfb94243f2dade8b8fa7787b90da765453245e739bea89cef3",
|
|
1232
1232
|
"placement": "1087c27de3f6f0c57e6a7609012949ef9556450eeba8349164ae07993caa5481"
|
|
1233
1233
|
},
|
|
1234
1234
|
"lone_parent_sibships": {
|
|
1235
|
-
"pedigree": "
|
|
1235
|
+
"pedigree": "47ca29d6ba222def010dfd49d733de8d5aae46be9a128af237aaf0bf27a16283",
|
|
1236
1236
|
"placement": "9bd104943bcb9fec152d8e1ce15da8a0c83758e18f88d7a5f4aa61e32f340352"
|
|
1237
1237
|
},
|
|
1238
1238
|
"mz_twins_with_three_partners": {
|
|
1239
|
-
"pedigree": "
|
|
1239
|
+
"pedigree": "ee15fcc70a12a1f12b91154e71d5d622e75aeb7280d1d4d786373488ef8f465b",
|
|
1240
1240
|
"placement": "07f8caae73f68ccdcf0383fb6c79475eff2d8e1f47bd0c4d7a1e473590c50588"
|
|
1241
1241
|
},
|
|
1242
1242
|
"sibship": {
|
|
1243
|
-
"pedigree": "
|
|
1243
|
+
"pedigree": "2f559258d501426b98b1b5f0016dd5e41f72c587e91053b63155e7f7c76ef94e",
|
|
1244
1244
|
"placement": "5b6f131eadf2b1ffdc20d534435d4e0c599e3bb817efe914356d1fa8be20703e"
|
|
1245
1245
|
},
|
|
1246
1246
|
"six_conditions": {
|
|
1247
|
-
"pedigree": "
|
|
1247
|
+
"pedigree": "79235238a3c6f6cd7b76838ba1c6319bf8f8c167c2d37ca14c9f800d5e869490",
|
|
1248
1248
|
"placement": "061ff0f9e545cac0fa08940c2ad0e8042408cf7eba69c6937bbae6e17addc255"
|
|
1249
1249
|
},
|
|
1250
1250
|
"three_generation": {
|
|
1251
|
-
"pedigree": "
|
|
1251
|
+
"pedigree": "0b3a5638f54755b5ca4dd4677f01e264ca272332942be68c67944113749d0b83",
|
|
1252
1252
|
"placement": "9d27b04e9315fdbf43e0144f6e351cfd324d0637c81ea0d4db0023c82f38413e"
|
|
1253
1253
|
},
|
|
1254
1254
|
"trio": {
|
|
1255
|
-
"pedigree": "
|
|
1255
|
+
"pedigree": "309935eb5b239ac59c22a0ea058c0b5c555b46741a64dd502cb24141f1b020df",
|
|
1256
1256
|
"placement": "effcf8028a9ae0280c41dfa5e7b28761aa7217165ca5e9d6b66122090d240b07"
|
|
1257
1257
|
},
|
|
1258
1258
|
"twin_married": {
|
|
1259
|
-
"pedigree": "
|
|
1259
|
+
"pedigree": "648c9987efc9685f5ec8607dcb9d4bd48937d0bbef1d0b53c2360c4874f786bd",
|
|
1260
1260
|
"placement": "20260afc06003302ec288b5c9ef71a53a518666eecc947e3c6ae9161cad86d3d"
|
|
1261
1261
|
},
|
|
1262
1262
|
"twin_with_two_partners": {
|
|
1263
|
-
"pedigree": "
|
|
1263
|
+
"pedigree": "9c0d7aa240d96bc15a662a44227cd0783d1351a692c0c8e426e61c1abfe4dd90",
|
|
1264
1264
|
"placement": "7a27258ec115719a6199fd598f8e4ffd8457c72b7fda51f1a2275af4c218d45a"
|
|
1265
1265
|
},
|
|
1266
1266
|
"twins": {
|
|
1267
|
-
"pedigree": "
|
|
1267
|
+
"pedigree": "04976f8c591992e191ba5ffbf8024ceb26bd364edd461700d8bfa73de3c57203",
|
|
1268
1268
|
"placement": "412d63ce91f7453e2f416cee6058357f24ea698d55ef26daa92ff0f78da8765d"
|
|
1269
1269
|
},
|
|
1270
1270
|
"twins_marry_chain_stretches": {
|
|
1271
|
-
"pedigree": "
|
|
1271
|
+
"pedigree": "6bfbc006184b1abbaa9bdd66bba6a5772c398431faf0b30c5eafef9e2ca07bf7",
|
|
1272
1272
|
"placement": "cd3e625abb425a810fb3650d8df16b0735c29dedfeb2a0f58311b121267b98b3"
|
|
1273
1273
|
},
|
|
1274
1274
|
"twins_marry_cousins_apart": {
|
|
1275
|
-
"pedigree": "
|
|
1275
|
+
"pedigree": "77c7f0465f640c3fab99213d5f77e31210fb82b3de66da7572d5e3be3fbaf826",
|
|
1276
1276
|
"placement": "a5832615b4e48c6d4ca78bacdc7eb6476bc4cba025f7c1b967e8402bc7fbd2e3"
|
|
1277
1277
|
},
|
|
1278
1278
|
"unknown_twin_with_two_partners": {
|
|
1279
|
-
"pedigree": "
|
|
1279
|
+
"pedigree": "acf3cc1900dd7575b4920a285df0fc0ee8c4360f0105180998516a858967a73f",
|
|
1280
1280
|
"placement": "c10ca99c6620904a2efa6d87d237ae5e28a9101a9e5c68f2c38119ee7e99f519"
|
|
1281
1281
|
}
|
|
1282
1282
|
},
|
|
1283
1283
|
"z3": {
|
|
1284
1284
|
"carrier_inheritance": {
|
|
1285
|
-
"pedigree": "
|
|
1285
|
+
"pedigree": "e8a5dd503885e4ac684ea12fee12837e86c3113f3434db631a70f26428899ce5",
|
|
1286
1286
|
"placement": "5a196b3c41b147ec5023997b51c2e9ec85ae734806d1d08eb0cdbbefded9145b"
|
|
1287
1287
|
},
|
|
1288
1288
|
"childless": {
|
|
1289
|
-
"pedigree": "
|
|
1289
|
+
"pedigree": "f7430de54742f274137e493b87407ab26d86b8a80d8dc14d6138bdaa8af0d923",
|
|
1290
1290
|
"placement": "2df63610481a7e9898861e5b736eb955615f6bdc4279399ba35d1d0b2c4536be"
|
|
1291
1291
|
},
|
|
1292
1292
|
"compound_carrier": {
|
|
1293
|
-
"pedigree": "
|
|
1293
|
+
"pedigree": "aa3a15c68d3a348f52405d2f1906e84b172b19797a291aef48400aea1baa7331",
|
|
1294
1294
|
"placement": "15f42e8adaafdb938a7b489cef53cea2bb05090f2ef0987ddf86368b16d2a42f"
|
|
1295
1295
|
},
|
|
1296
1296
|
"condition_fills": {
|
|
1297
|
-
"pedigree": "
|
|
1297
|
+
"pedigree": "e1c9589cd1b994046e5341327bcbde777917d75b300721692b6799555e27787b",
|
|
1298
1298
|
"placement": "204fa83a0182feab7e992077afaf25a5f21623f4d728c9565f89a68f57fcd4c9"
|
|
1299
1299
|
},
|
|
1300
1300
|
"consanguineous": {
|
|
1301
|
-
"pedigree": "
|
|
1301
|
+
"pedigree": "eed38dca873e24a1922f30aa3c2d2c6664f09fb6483d8d6279966f874b7ef74b",
|
|
1302
1302
|
"placement": "0f30a45070c21d8d782970ee5cca87f8252ecc30e41b151a0bee990dfa6d5bee"
|
|
1303
1303
|
},
|
|
1304
1304
|
"count_collapsed_parents": {
|
|
1305
|
-
"pedigree": "
|
|
1305
|
+
"pedigree": "bb3cd4fe1dc45e0f98286e228d03e9ce2677739e32e0bc1e106cec5e1f315e5b",
|
|
1306
1306
|
"placement": "21a84412d40991a13fc85ecbd3e5369042f09590d2d1ca15a36e0aa6590dbf6c"
|
|
1307
1307
|
},
|
|
1308
1308
|
"count_marks": {
|
|
1309
|
-
"pedigree": "
|
|
1309
|
+
"pedigree": "c67237bccc7f4f8b20a97eec72a277928d7e9fb24778a4e50827fa8cf045dcfa",
|
|
1310
1310
|
"placement": "2cfb5f4b21dcc10d3f1eeb3ce555ef8bf110964082dfaf6d2e0b9d10a34dba15"
|
|
1311
1311
|
},
|
|
1312
1312
|
"counts": {
|
|
1313
|
-
"pedigree": "
|
|
1313
|
+
"pedigree": "db5ccfaa44b55c27d745e85deb01373155192aebc267b10b7a7e8d5dc6cd5284",
|
|
1314
1314
|
"placement": "5b6f131eadf2b1ffdc20d534435d4e0c599e3bb817efe914356d1fa8be20703e"
|
|
1315
1315
|
},
|
|
1316
1316
|
"cousins_across_family": {
|
|
1317
|
-
"pedigree": "
|
|
1317
|
+
"pedigree": "b1dc94afcaf7c016b31cfcb4159b039ec2b44e82e229eadc3d53e0613e6064d1",
|
|
1318
1318
|
"placement": "d54dbea6c0166d942f80bc879386ddc87be91e9562185194d099d65eac6947a6"
|
|
1319
1319
|
},
|
|
1320
1320
|
"cousins_across_middle_sibling": {
|
|
1321
|
-
"pedigree": "
|
|
1321
|
+
"pedigree": "290d52033c08445e8accb9d92c46a2f6e813e57682fa3da3ed0113ddb657a43d",
|
|
1322
1322
|
"placement": "405413654227502cd240048b4ef722a5441e7330ba5093e5b2baeb96ff48ba5d"
|
|
1323
1323
|
},
|
|
1324
1324
|
"crossing_descents": {
|
|
1325
|
-
"pedigree": "
|
|
1325
|
+
"pedigree": "1ac390d8344a2aefa93f39fbc3a3b08f9ff4726d63b6c10f4b6562584c85ac95",
|
|
1326
1326
|
"placement": "86d1d7cd4d036ae641c62d5da0e6fc31286d146c1dbe61bd375f6eb7fa5f91dd"
|
|
1327
1327
|
},
|
|
1328
1328
|
"descent_across_rows": {
|
|
1329
|
-
"pedigree": "
|
|
1329
|
+
"pedigree": "ddf1a56f2117f12adb310c5e11dc1abb1d5966d61caca47c7b1714def5153d8d",
|
|
1330
1330
|
"placement": "56f81f46e577a5235e7bdeeb32e0cf27afca2344a39a091b65f86222cee720fe"
|
|
1331
1331
|
},
|
|
1332
1332
|
"detached_branch": {
|
|
1333
|
-
"pedigree": "
|
|
1333
|
+
"pedigree": "1689ed0a7bfe3f251791f27d5676b17f57235ff5bab41220e3da67005b7ab797",
|
|
1334
1334
|
"placement": "2368efaca4726120106259544ffae63d0c99169bd1af629f732b1dfbbdd8e560"
|
|
1335
1335
|
},
|
|
1336
1336
|
"founder_sibship": {
|
|
1337
|
-
"pedigree": "
|
|
1337
|
+
"pedigree": "34c33204ee6b9e847339251dc007a2d806a088f316f80d585ae456434664c1bf",
|
|
1338
1338
|
"placement": "3a75c28c5328029d262187a5fa540a3cac02261b64c12fbfc42a779ac19d7438"
|
|
1339
1339
|
},
|
|
1340
1340
|
"founder_sibship_marry_in": {
|
|
1341
|
-
"pedigree": "
|
|
1341
|
+
"pedigree": "317713b19b08ab245584faa8d428d92f78fdbc3120a80e840ad1d0f3b05d0f89",
|
|
1342
1342
|
"placement": "55ba9e369d15af650573f80b3bfff2f19d7d5b143a8600b881c9e2b37ccf42ba"
|
|
1343
1343
|
},
|
|
1344
1344
|
"half_sibs": {
|
|
1345
|
-
"pedigree": "
|
|
1345
|
+
"pedigree": "12532e23081e16b6925be6258dfd368d0ee1000d58c597fe11a4f14dc77d826d",
|
|
1346
1346
|
"placement": "3e4b0da09c72cab42bc0ec87319ee097e374a81dd2fd283ad4922a3fb4548cc9"
|
|
1347
1347
|
},
|
|
1348
1348
|
"hinge_family": {
|
|
1349
|
-
"pedigree": "
|
|
1349
|
+
"pedigree": "08732df07931d320618b013a30811ce694e6af167d16d3e44b1ac155185480fa",
|
|
1350
1350
|
"placement": "f7a7226a8083cbac07b41072a2abfadaf94afa479313871f4c0c7cbc9edfad36"
|
|
1351
1351
|
},
|
|
1352
1352
|
"hinge_offcentre": {
|
|
1353
|
-
"pedigree": "
|
|
1353
|
+
"pedigree": "6a5e7c6da669fedfb94243f2dade8b8fa7787b90da765453245e739bea89cef3",
|
|
1354
1354
|
"placement": "1087c27de3f6f0c57e6a7609012949ef9556450eeba8349164ae07993caa5481"
|
|
1355
1355
|
},
|
|
1356
1356
|
"lone_parent_sibships": {
|
|
1357
|
-
"pedigree": "
|
|
1357
|
+
"pedigree": "47ca29d6ba222def010dfd49d733de8d5aae46be9a128af237aaf0bf27a16283",
|
|
1358
1358
|
"placement": "9bd104943bcb9fec152d8e1ce15da8a0c83758e18f88d7a5f4aa61e32f340352"
|
|
1359
1359
|
},
|
|
1360
1360
|
"mz_twins_with_three_partners": {
|
|
1361
|
-
"pedigree": "
|
|
1361
|
+
"pedigree": "ee15fcc70a12a1f12b91154e71d5d622e75aeb7280d1d4d786373488ef8f465b",
|
|
1362
1362
|
"placement": "07f8caae73f68ccdcf0383fb6c79475eff2d8e1f47bd0c4d7a1e473590c50588"
|
|
1363
1363
|
},
|
|
1364
1364
|
"sibship": {
|
|
1365
|
-
"pedigree": "
|
|
1365
|
+
"pedigree": "2f559258d501426b98b1b5f0016dd5e41f72c587e91053b63155e7f7c76ef94e",
|
|
1366
1366
|
"placement": "5b6f131eadf2b1ffdc20d534435d4e0c599e3bb817efe914356d1fa8be20703e"
|
|
1367
1367
|
},
|
|
1368
1368
|
"six_conditions": {
|
|
1369
|
-
"pedigree": "
|
|
1369
|
+
"pedigree": "79235238a3c6f6cd7b76838ba1c6319bf8f8c167c2d37ca14c9f800d5e869490",
|
|
1370
1370
|
"placement": "061ff0f9e545cac0fa08940c2ad0e8042408cf7eba69c6937bbae6e17addc255"
|
|
1371
1371
|
},
|
|
1372
1372
|
"three_generation": {
|
|
1373
|
-
"pedigree": "
|
|
1373
|
+
"pedigree": "0b3a5638f54755b5ca4dd4677f01e264ca272332942be68c67944113749d0b83",
|
|
1374
1374
|
"placement": "9d27b04e9315fdbf43e0144f6e351cfd324d0637c81ea0d4db0023c82f38413e"
|
|
1375
1375
|
},
|
|
1376
1376
|
"trio": {
|
|
1377
|
-
"pedigree": "
|
|
1377
|
+
"pedigree": "309935eb5b239ac59c22a0ea058c0b5c555b46741a64dd502cb24141f1b020df",
|
|
1378
1378
|
"placement": "effcf8028a9ae0280c41dfa5e7b28761aa7217165ca5e9d6b66122090d240b07"
|
|
1379
1379
|
},
|
|
1380
1380
|
"twin_married": {
|
|
1381
|
-
"pedigree": "
|
|
1381
|
+
"pedigree": "648c9987efc9685f5ec8607dcb9d4bd48937d0bbef1d0b53c2360c4874f786bd",
|
|
1382
1382
|
"placement": "20260afc06003302ec288b5c9ef71a53a518666eecc947e3c6ae9161cad86d3d"
|
|
1383
1383
|
},
|
|
1384
1384
|
"twin_with_two_partners": {
|
|
1385
|
-
"pedigree": "
|
|
1385
|
+
"pedigree": "9c0d7aa240d96bc15a662a44227cd0783d1351a692c0c8e426e61c1abfe4dd90",
|
|
1386
1386
|
"placement": "7a27258ec115719a6199fd598f8e4ffd8457c72b7fda51f1a2275af4c218d45a"
|
|
1387
1387
|
},
|
|
1388
1388
|
"twins": {
|
|
1389
|
-
"pedigree": "
|
|
1389
|
+
"pedigree": "04976f8c591992e191ba5ffbf8024ceb26bd364edd461700d8bfa73de3c57203",
|
|
1390
1390
|
"placement": "412d63ce91f7453e2f416cee6058357f24ea698d55ef26daa92ff0f78da8765d"
|
|
1391
1391
|
},
|
|
1392
1392
|
"twins_marry_chain_stretches": {
|
|
1393
|
-
"pedigree": "
|
|
1393
|
+
"pedigree": "6bfbc006184b1abbaa9bdd66bba6a5772c398431faf0b30c5eafef9e2ca07bf7",
|
|
1394
1394
|
"placement": "cd3e625abb425a810fb3650d8df16b0735c29dedfeb2a0f58311b121267b98b3"
|
|
1395
1395
|
},
|
|
1396
1396
|
"twins_marry_cousins_apart": {
|
|
1397
|
-
"pedigree": "
|
|
1397
|
+
"pedigree": "77c7f0465f640c3fab99213d5f77e31210fb82b3de66da7572d5e3be3fbaf826",
|
|
1398
1398
|
"placement": "a5832615b4e48c6d4ca78bacdc7eb6476bc4cba025f7c1b967e8402bc7fbd2e3"
|
|
1399
1399
|
},
|
|
1400
1400
|
"unknown_twin_with_two_partners": {
|
|
1401
|
-
"pedigree": "
|
|
1401
|
+
"pedigree": "acf3cc1900dd7575b4920a285df0fc0ee8c4360f0105180998516a858967a73f",
|
|
1402
1402
|
"placement": "c10ca99c6620904a2efa6d87d237ae5e28a9101a9e5c68f2c38119ee7e99f519"
|
|
1403
1403
|
}
|
|
1404
1404
|
}
|
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
described now describes the declaration, so it scopes the whole pedigree.
|
|
7
7
|
* **Loud** — entries of one name that state different inheritance, two entries of one name on one person, and a
|
|
8
8
|
support naming a condition no one has all fail.
|
|
9
|
-
* **
|
|
10
|
-
|
|
9
|
+
* **Ids are the record's own** — the stored-layout digest reads entries through their declarations in the pre-1.0
|
|
10
|
+
encoding, so a declaration's id never enters it; its name and inheritance do.
|
|
11
11
|
"""
|
|
12
12
|
|
|
13
13
|
from __future__ import annotations
|
|
@@ -107,9 +107,8 @@ def test_what_has_no_1_0_form_fails_loud(old: str, new: str, match: str) -> None
|
|
|
107
107
|
ir.migrate_pbtxt(_OLD_SET.replace(old, new, 1))
|
|
108
108
|
|
|
109
109
|
|
|
110
|
-
def
|
|
111
|
-
# The
|
|
112
|
-
# Here: the digest reads each entry through its declaration, so ids are the record's own business.
|
|
110
|
+
def test_a_declaration_id_never_enters_the_layout_digest() -> None:
|
|
111
|
+
# The digest reads each entry through its declaration, so ids are the record's own business.
|
|
113
112
|
p, defs = test_render._golden("compound_carrier")
|
|
114
113
|
renamed = pb.Pedigree()
|
|
115
114
|
renamed.CopyFrom(p)
|
|
@@ -123,16 +122,3 @@ def test_a_migrated_record_keeps_its_layout_digest() -> None:
|
|
|
123
122
|
assert _store.pedigree_digest(p, edited) != _store.pedigree_digest(p, defs), "a declared name is content"
|
|
124
123
|
stated = [pb.ConditionDef(id=d.id, name=d.name, inheritance=pb.INHERITANCE_AUTOSOMAL_RECESSIVE) for d in defs]
|
|
125
124
|
assert _store.pedigree_digest(p, stated) != _store.pedigree_digest(p, defs), "so is a declared inheritance"
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
# Pedigree digests pinned before 1.0 (layout_pins.json, LAYOUT_VERSION 6): the migrated goldens still have them.
|
|
129
|
-
_PRE_1_0_DIGESTS = {
|
|
130
|
-
"trio": "c9ff32d81e2c4fb568c8acfcf43bff2bbf3319cccb5faaeb73fc5eb8408a24fe",
|
|
131
|
-
"six_conditions": "7e5309774d590a3809fd9b6ec7829b5294a09d1a908b7f96b31157a599c0d83f",
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
@pytest.mark.parametrize("name", sorted(_PRE_1_0_DIGESTS))
|
|
136
|
-
def test_the_digest_is_the_pre_1_0_one(name: str) -> None:
|
|
137
|
-
p, defs = test_render._golden(name)
|
|
138
|
-
assert _store.pedigree_digest(p, defs).hex() == _PRE_1_0_DIGESTS[name]
|