qcodes/dataset/descriptions/dependencies.py
def extend(
            self,
            dependencies: Optional[ParamSpecTree] = None,
            inferences: Optional[ParamSpecTree] = None,
            standalones: Tuple[ParamSpecBase, ...] = ()) -> 'InterDependencies_':
        """
        Create a new InterDependencies_ object that is an extension of this
        instance with the provided input
        """

        dependencies = {} if dependencies is None else dependencies
        inferences = {} if inferences is None else inferences

        # first step: remove parameters from standalones if they no longer
        # stand alone

        depended_on = (ps for tup in dependencies.values() for ps in tup)
        inferred_from = (ps for tup in inferences.values() for ps in tup)

        standalones_mut = set(deepcopy(self.standalones))
        standalones_mut = (standalones_mut.difference(set(dependencies))
                                          .difference(set(inferences))
                                          .difference(set(depended_on))
                                          .difference(set(inferred_from)))

        # then update deps and inffs
        new_deps = deepcopy(self.dependencies)
        for ps in set(dependencies).intersection(set(new_deps)):
            new_deps[ps] = tuple(set(list(new_deps[ps]) +
                                     list(dependencies[ps])))
        for ps in set(dependencies).difference(set(new_deps)):
            new_deps.update({deepcopy(ps): dependencies[ps]})

        new_inffs = deepcopy(self.inferences.copy())
        for ps in set(inferences).intersection(set(new_inffs)):
            new_inffs[ps] = tuple(set(list(new_inffs[ps]) +
                                      list(inferences[ps])))
        for ps in set(inferences).difference(set(new_inffs)):
            new_inffs.update({deepcopy(ps): inferences[ps]})

        # add new standalones
        new_standalones = tuple(standalones_mut.union(set(standalones)))

        new_idps = InterDependencies_(dependencies=new_deps,
                                      inferences=new_inffs,
                                      standalones=new_standalones)

        return new_idps

        Create a new InterDependencies_ object that is an extension of this
        instance with the provided input
        
Create a new InterDependencies_ object that is an extension of this
instance with the provided input
Create a new InterDependencies_ object that is an extension of this instance with the provided input
def extend(
            self,
            dependencies: Optional[ParamSpecTree] = None,
            inferences: Optional[ParamSpecTree] = None,
            standalones: Tuple[ParamSpecBase, ...] = ()) -> 'InterDependencies_':
        dependencies = {} if dependencies is None else dependencies
        inferences = {} if inferences is None else inferences
        depended_on = (ps for tup in dependencies.values() for ps in tup)
        inferred_from = (ps for tup in inferences.values() for ps in tup)
        standalones_mut = set(deepcopy(self.standalones))
        standalones_mut = (standalones_mut.difference(set(dependencies))
                                          .difference(set(inferences))
                                          .difference(set(depended_on))
                                          .difference(set(inferred_from)))
        new_deps = deepcopy(self.dependencies)
        for ps in set(dependencies).intersection(set(new_deps)):
            new_deps[ps] = tuple(set(list(new_deps[ps]) +
                                     list(dependencies[ps])))
        for ps in set(dependencies).difference(set(new_deps)):
            new_deps.update({deepcopy(ps): dependencies[ps]})
        new_inffs = deepcopy(self.inferences.copy())
        for ps in set(inferences).intersection(set(new_inffs)):
            new_inffs[ps] = tuple(set(list(new_inffs[ps]) +
                                      list(inferences[ps])))
        for ps in set(inferences).difference(set(new_inffs)):
            new_inffs.update({deepcopy(ps): inferences[ps]})
        new_standalones = tuple(standalones_mut.union(set(standalones)))
        new_idps = InterDependencies_(dependencies=new_deps,
                                      inferences=new_inffs,
                                      standalones=new_standalones)
        return new_idps
def extend ( self , dependencies : Optional [ ParamSpecTree ] = None , inferences : Optional [ ParamSpecTree ] = None , standalones : Tuple [ ParamSpecBase , ... ] = ( ) ) -> 'InterDependencies_' : dependencies = { } if dependencies is None else dependencies inferences = { } if inferences is None else inferences depended_on = ( ps for tup in dependencies . values ( ) for ps in tup ) inferred_from = ( ps for tup in inferences . values ( ) for ps in tup ) standalones_mut = set ( deepcopy ( self . standalones ) ) standalones_mut = ( standalones_mut . difference ( set ( dependencies ) ) . difference ( set ( inferences ) ) . difference ( set ( depended_on ) ) . difference ( set ( inferred_from ) ) ) new_deps = deepcopy ( self . dependencies ) for ps in set ( dependencies ) . intersection ( set ( new_deps ) ) : new_deps [ ps ] = tuple ( set ( list ( new_deps [ ps ] ) + list ( dependencies [ ps ] ) ) ) for ps in set ( dependencies ) . difference ( set ( new_deps ) ) : new_deps . update ( { deepcopy ( ps ) : dependencies [ ps ] } ) new_inffs = deepcopy ( self . inferences . copy ( ) ) for ps in set ( inferences ) . intersection ( set ( new_inffs ) ) : new_inffs [ ps ] = tuple ( set ( list ( new_inffs [ ps ] ) + list ( inferences [ ps ] ) ) ) for ps in set ( inferences ) . difference ( set ( new_inffs ) ) : new_inffs . update ( { deepcopy ( ps ) : inferences [ ps ] } ) new_standalones = tuple ( standalones_mut . union ( set ( standalones ) ) ) new_idps = InterDependencies_ ( dependencies = new_deps , inferences = new_inffs , standalones = new_standalones ) return new_idps
Create a new InterDependencies_ object that is an extension of this
instance with the provided input
Create a new InterDependencies_ object that is an extension of this instance with the provided input
"""
        Create a new InterDependencies_ object that is an extension of this
        instance with the provided input
        """ # first step: remove parameters from standalones if they no longer # stand alone # then update deps and inffs # add new standalones
self
dependencies
Optional[ParamSpecTree]
inferences
Optional[ParamSpecTree]
standalones
Tuple[ParamSpecBase, ...]