ExtensionResolutionResult

class hugr.ext.ExtensionResolutionResult(used_extensions: ExtensionRegistry = <factory>, unresolved_extensions: set[ExtensionId] = <factory>, unresolved_ops: dict[tuple[tys.ExtensionId, str], ops.Custom] = <factory>, unresolved_types: dict[tuple[tys.ExtensionId, str], tys.Opaque] = <factory>)[source]

Bases: object

Result of resolving extensions in a HUGR.

Parameters:
  • used_extensions – The extensions used by the HUGR.

  • unresolved_extensions – A set of extension IDs referenced in the HUGR but not found in the given registry.

  • unresolved_ops – The Custom operations that could not be resolved to an ExtOp because the operation was not found in the registry. Indexed by (extension ID, operation name).

  • unresolved_types – The Opaque types that could not be resolved to an ExtType because the type was not found in the registry. Indexed by (extension ID, type name).

Methods

extend

Add the extensions from another result to this result.

ids

Get the set of used extension IDs.

Attributes

used_extensions

unresolved_extensions

unresolved_ops

unresolved_types

extend(other: ExtensionResolutionResult) None[source]

Add the extensions from another result to this result.

Parameters:

other – The result of resolving extensions to add.

ids() set[ExtensionId][source]

Get the set of used extension IDs.

This includes both resolved and unresolved extensions referenced in the HUGR.