qat.experimental.system_data.derived.interface module

class DerivedViewInterface

Bases: ABC, Generic[_TParent]

A view derived from an upstream data source.

The type parameter _TParent declares what this view is derived from. That may be CanonicalSystemData for views that sit directly on the canonical data, or another DerivedViewInterface subclass for views that sit further down the derivation chain.

Subclasses declare their parent type in the class header:

class QubitView(DerivedViewInterface[CanonicalSystemData]): ...
class TopologyView(DerivedViewInterface[QubitView]): ...
class ScipyTopologyView(DerivedViewInterface[TopologyView]): ...

and must implement derive().

abstract classmethod derive(parent, **kwargs)

Construct this view from its upstream parent.

Parameters:

parent (TypeVar(_TParent, bound= Union[CanonicalSystemData, DerivedViewInterface])) – The upstream data source to derive from.

Return type:

TypeVar(_TDerivedView, bound= DerivedViewInterface)

Returns:

A new derived view built from parent.