Skip to content

The data link (experimental)

Record which scale and frame a table's code columns are on.

scale_id

scale_id(x: NestedScale) -> str

The identity of a scale: "<name>@<hash>".

The hash covers the leaf column, the frames and the leaf-to-frame memberships; weights, attributes, aliases, labels and the order of rows or members do not enter, so adding a weight keeps the identity while a subset or a re-grouping is a different scale. Two objects with the same structure under different names share the hash.

The hash is the first eight hexadecimal digits of the MD5 of a canonical UTF-8 text: the line key=<leaf column name>, the line frames= with the frame names tab-separated, then one tab-separated line per leaf (its code in the leaf column first, then its code at each frame, empty where unassigned), leaves sorted by the bytes of the leaf code, lines joined by a line feed. Both bindings give the same identity for the same scale.