avid.linkers.InnerLinkerBase
- class avid.linkers.InnerLinkerBase(allowOnlyFullLinkage=True, performInternalLinkage=False)
Bases:
LinkerBaseLinker that also supports inner linkage of elements (details see __init__).
- __init__(allowOnlyFullLinkage=True, performInternalLinkage=False)
@param performInternalLinkage If internal linkage is activated, the linker will not only search for linked secondary selections. The linker will then also link each primary selection artefact to a fitting artefact in the secondary selection and(!) adds the found linked secondary artefact to the respective position of the linked selection. This behavior has to effects: 1) a linked selection has always the same size than the primary selection; 2) the artefacts in the linked selection correspond to the artefacts in the primary selection at the respective position (e.g. the first artefact in the linked selection is linked to the first artefact in the primary selection); 3) This my alter the order of the linked secondary artefacts and their content (because if multiple secondary artefacts would fit, the first will always be picked.); 4) Linked secondary selections may be skipped if the very same selection is already present in the result. If performInternalLinkage is True and no link artefact can be found for a primary artefact, None will be added in the linked selections. If performInternalLinkage is False, it is only relevant that at least one primary artefact has a link. @param allowOnlyFullLinkage If True, one will only get linked selection where 1) every primary artefact has a corresponding linked secondary artefact and 2) the linked selection as the same number of artefacts then the primary selection. REMARK: This must not mean that every artefact in the linked secondary selection has also a semantic link. It is enough if at least one artefact in the secondary selection is semantically linked. If set to False, the result depends on the setting of performInternalLinkage. If performInternalLinkage is True, the returned linked selections may contain None if a primary artefact could not be linked to any secondary artefact in the selection. If performInternalLinkage is False, every secondary selection is valid if at least one primary artefact finds a link.
Methods
__init__([allowOnlyFullLinkage, ...])@param performInternalLinkage If internal linkage is activated, the linker will not only search for linked secondary selections.
getLinkedSelection(primaryIndex, ...)Get the subset (splits) of secondary selections that has a meaningful semantic link to the primary selection/index.
- getLinkedSelection(primaryIndex, primarySelections, secondarySelections)
Get the subset (splits) of secondary selections that has a meaningful semantic link to the primary selection/index. To change the behavior reimplement self._getLinkedSelection(). The default implementation just passes through the secondarySelections (so everything gets linked). Linker might alter a secondary selections before they are passed back as linked selections (e.g. change the order of the artefact in the selection or its content) @result List of all valid selections (list) of linked artefacts. Therefore all selections of artefacts from secondarySelections that fullfill the link criterion in respect to the primary selection. @param primaryIndex index of the entry in the primarySelections that is defining for the link. @param primarySelections the list of all selections that contain sets of primary artefacts @param secondarySelections the list that is used to generate/pick the linked selections from.