Set the current series resistance value for the specified channel.

        Parameters
        ----------
        channel : int
            Analog channel index.
        value : float
            Series resistance value.
        resistor_index : int, optional
            Series resistor channel index.

            If :data:`resistor_index` is not specified, the resistor-index from
            the current context _(i.e., the result of
            :attr:`series_resistor_index`)_ is used.

            Otherwise, the series-resistor is temporarily set to the value of
            :data:`resistor_index` to set the resistance before restoring back
            to the original value.

            See definition of :meth:`safe_series_resistor_index_read`
            decorator.

        Returns
        -------
        int
            Return code from embedded call.

def set_series_resistance(self, channel, value, resistor_index=None):
        '''
        Set the current series resistance value for the specified channel.

        Parameters
        ----------
        channel : int
            Analog channel index.
        value : float
            Series resistance value.
        resistor_index : int, optional
            Series resistor channel index.

            If :data:`resistor_index` is not specified, the resistor-index from
            the current context _(i.e., the result of
            :attr:`series_resistor_index`)_ is used.

            Otherwise, the series-resistor is temporarily set to the value of
            :data:`resistor_index` to set the resistance before restoring back
            to the original value.

            See definition of :meth:`safe_series_resistor_index_read`
            decorator.

        Returns
        -------
        int
            Return code from embedded call.
        '''
        if resistor_index is None:
            resistor_index = self.series_resistor_index(channel)
        try:
            if channel == 0:
                self.calibration.R_hv[resistor_index] = value
            else:
                self.calibration.R_fb[resistor_index] = value
        except:
            pass
        return self._set_series_resistance(channel, value)