infer_chains

infer_chains(mappings: list[Mapping], *, backwards: bool = True, progress: bool = True, cutoff: int = 5, minimum_component_size: int = 2, maximum_component_size: int = 100) list[Mapping][source]

Apply graph-based reasoning over mapping chains to infer new mappings.

Parameters:
  • mappings – A list of input mappings

  • backwards – Should inference be done in reverse?

  • progress – Should a progress bar be shown? Defaults to true.

  • cutoff – What’s the maximum length path to infer over?

  • minimum_component_size – The smallest size of a component to consider, defaults to 2

  • maximum_component_size – The smallest size of a component to consider, defaults to 100. Components that are very large (i.e., much larger than the number of target prefixes) likely are the result of many broad/narrow mappings

Returns:

The list of input mappings _plus_ inferred mappings