def total_weight(self):
        """Read a weight from the sensor in grams.

        Returns
        -------
        weight : float
            The sensor weight in grams.
        """
        weights = self._raw_weights()
        if weights.shape[1] == 0:
            return 0.0
        elif weights.shape[1] < self._ntaps:
            return np.sum(np.mean(weights, axis=1))
        else:
            return self._filter_coeffs.dot(np.sum(weights, axis=0))
def total_weight ( self ) : weights = self . _raw_weights ( ) if weights . shape [ 1 ] == 0 : return 0.0 elif weights . shape [ 1 ] < self . _ntaps : return np . sum ( np . mean ( weights , axis = 1 ) ) else : return self . _filter_coeffs . dot ( np . sum ( weights , axis = 0 ) )
Read a weight from the sensor in grams.

        Returns
        -------
        weight : float
            The sensor weight in grams.