qcodes/dataset/descriptions/dependencies.py
def remove(self, parameter: ParamSpecBase) -> 'InterDependencies_':
        """
        Create a new InterDependencies_ object that is similar to this
        instance, but has the given parameter removed.
        """
        if parameter not in self:
            raise ValueError(f'Unknown parameter: {parameter}.')

        if parameter in self._dependencies_inv:
            raise ValueError(f'Cannot remove {parameter.name}, other '
                             'parameters depend on it.')
        if parameter in self._inferences_inv:
            raise ValueError(f'Cannot remove {parameter.name}, other '
                             'parameters are inferred from it.')

        if parameter in self.standalones:
            new_standalones = tuple(deepcopy(self.standalones).
                                    difference({parameter}))
            new_deps = deepcopy(self.dependencies)
            new_inffs = deepcopy(self.inferences)
        elif parameter in self.dependencies or parameter in self.inferences:
            new_deps = deepcopy(self.dependencies)
            new_inffs = deepcopy(self.inferences)
            # figure out whether removing this parameter will make any other
            # parameters standalone
            new_standalones_l = []
            old_standalones = deepcopy(self.standalones)
            for indep in self.dependencies.get(parameter, []):
                if not(indep in self._inferences_inv or
                       indep in self.inferences):
                    new_standalones_l.append(indep)
            for basis in self.inferences.get(parameter, []):
                if not(basis in self._dependencies_inv or
                       basis in self.dependencies):
                    new_standalones_l.append(basis)
            new_deps.pop(parameter, None)
            new_inffs.pop(parameter, None)
            new_standalones = tuple(set(new_standalones_l)
                                    .union(old_standalones))
        else:
            raise ValueError(f'Inconsistent InterDependencies_ object '
                             f'parameter: {parameter} is in list of'
                             f'parameters but is neither a "standalone", '
                             f'"dependency" or "inference"')

        idps = InterDependencies_(dependencies=new_deps, inferences=new_inffs,
                                  standalones=new_standalones)
        return idps

        Create a new InterDependencies_ object that is similar to this
        instance, but has the given parameter removed.
        
Create a new InterDependencies_ object that is similar to this
instance, but has the given parameter removed.
Create a new InterDependencies_ object that is similar to this instance but has the given parameter removed .
def remove(self, parameter: ParamSpecBase) -> 'InterDependencies_':
        if parameter not in self:
            raise ValueError(f'Unknown parameter: {parameter}.')
        if parameter in self._dependencies_inv:
            raise ValueError(f'Cannot remove {parameter.name}, other '
                             'parameters depend on it.')
        if parameter in self._inferences_inv:
            raise ValueError(f'Cannot remove {parameter.name}, other '
                             'parameters are inferred from it.')
        if parameter in self.standalones:
            new_standalones = tuple(deepcopy(self.standalones).
                                    difference({parameter}))
            new_deps = deepcopy(self.dependencies)
            new_inffs = deepcopy(self.inferences)
        elif parameter in self.dependencies or parameter in self.inferences:
            new_deps = deepcopy(self.dependencies)
            new_inffs = deepcopy(self.inferences)
            new_standalones_l = []
            old_standalones = deepcopy(self.standalones)
            for indep in self.dependencies.get(parameter, []):
                if not(indep in self._inferences_inv or
                       indep in self.inferences):
                    new_standalones_l.append(indep)
            for basis in self.inferences.get(parameter, []):
                if not(basis in self._dependencies_inv or
                       basis in self.dependencies):
                    new_standalones_l.append(basis)
            new_deps.pop(parameter, None)
            new_inffs.pop(parameter, None)
            new_standalones = tuple(set(new_standalones_l)
                                    .union(old_standalones))
        else:
            raise ValueError(f'Inconsistent InterDependencies_ object '
                             f'parameter: {parameter} is in list of'
                             f'parameters but is neither a "standalone", '
                             f'"dependency" or "inference"')
        idps = InterDependencies_(dependencies=new_deps, inferences=new_inffs,
                                  standalones=new_standalones)
        return idps
def remove ( self , parameter : ParamSpecBase ) -> 'InterDependencies_' : if parameter not in self : raise ValueError ( f'Unknown parameter: {parameter}.' ) if parameter in self . _dependencies_inv : raise ValueError ( f'Cannot remove {parameter.name}, other ' 'parameters depend on it.' ) if parameter in self . _inferences_inv : raise ValueError ( f'Cannot remove {parameter.name}, other ' 'parameters are inferred from it.' ) if parameter in self . standalones : new_standalones = tuple ( deepcopy ( self . standalones ) . difference ( { parameter } ) ) new_deps = deepcopy ( self . dependencies ) new_inffs = deepcopy ( self . inferences ) elif parameter in self . dependencies or parameter in self . inferences : new_deps = deepcopy ( self . dependencies ) new_inffs = deepcopy ( self . inferences ) new_standalones_l = [ ] old_standalones = deepcopy ( self . standalones ) for indep in self . dependencies . get ( parameter , [ ] ) : if not ( indep in self . _inferences_inv or indep in self . inferences ) : new_standalones_l . append ( indep ) for basis in self . inferences . get ( parameter , [ ] ) : if not ( basis in self . _dependencies_inv or basis in self . dependencies ) : new_standalones_l . append ( basis ) new_deps . pop ( parameter , None ) new_inffs . pop ( parameter , None ) new_standalones = tuple ( set ( new_standalones_l ) . union ( old_standalones ) ) else : raise ValueError ( f'Inconsistent InterDependencies_ object ' f'parameter: {parameter} is in list of' f'parameters but is neither a "standalone", ' f'"dependency" or "inference"' ) idps = InterDependencies_ ( dependencies = new_deps , inferences = new_inffs , standalones = new_standalones ) return idps
Create a new InterDependencies_ object that is similar to this
instance, but has the given parameter removed.
Create a new InterDependencies_ object that is similar to this instance but has the given parameter removed .
"""
        Create a new InterDependencies_ object that is similar to this
        instance, but has the given parameter removed.
        """ # figure out whether removing this parameter will make any other # parameters standalone
self
parameter
ParamSpecBase