Compute Relations API¶
compute_structural_relations(input_parquet, relation_ids)
¶
Compute canonical structural relations for every unordered pair of distinct codes.
Rows follow the canonical pair orientation (shallower code first, code order on ties); the
relation name describes code_j relative to code_i and is not a bidirectional label.
Codes in different sector trees receive the explicit cross_sector relation. No exclusion
processing happens here and nothing is written.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
input_parquet
|
str
|
Descriptions parquet with |
required |
relation_ids
|
Mapping[str, int]
|
Mapping of structural relation names to IDs. Every relation name produced
by the hierarchy must be mapped; |
required |
Returns:
| Type | Description |
|---|---|
DataFrame
|
DataFrame with |
DataFrame
|
|
Raises:
| Type | Description |
|---|---|
ValueError
|
If the hierarchy produces a relation name absent from |