def test_GIVEN_divide_by_zeros_WHEN_rel_mean_THEN_rel_mean_correct(self): # Zeros in the first array cause undefined values in the relative calculations. data_with_zeros = self.data1 data_with_zeros.data[0][1] = 0 stats = StatsAnalyzer(data_with_zeros, self.missing2) res = stats.rel_mean() assert_that(res[0].rel_mean, close_to(-2.3518849206, 1e-5))
def test_GIVEN_divide_by_zeros_WHEN_rel_mean_THEN_rel_mean_correct(self): # Zeros in the first array cause undefined values in the relative calculations. data_with_zeros = self.data1 data_with_zeros.data[0][1] = 0 stats = StatsAnalyzer(data_with_zeros, self.missing2) res = stats.rel_mean() assert_that(res[0].rel_mean, close_to(-2.3518849206, 1e-5))
def test_GIVEN_one_masked_one_nparray_WHEN_rel_mean_THEN_rel_mean_correct( self): stats = StatsAnalyzer(self.data1, self.missing2) res = stats.rel_mean() assert_that(res[0].rel_mean, close_to(-2.0087585034, 1e-5))
def test_GIVEN_missing_vals_WHEN_rel_mean_THEN_rel_mean_correct(self): stats = StatsAnalyzer(self.missing1, self.missing2) res = stats.rel_mean() assert_that(res[0].rel_mean, close_to(0.0715277778, 1e-5))
def test_GIVEN_no_missing_vals_WHEN_rel_mean_THEN_rel_mean_correct(self): stats = StatsAnalyzer(self.data1, self.data2) res = stats.rel_mean() assert_that(res[0].rel_mean, close_to(-0.0153531746, 1e-5))
def test_GIVEN_one_masked_one_nparray_WHEN_rel_mean_THEN_rel_mean_correct(self): stats = StatsAnalyzer(self.data1, self.missing2) res = stats.rel_mean() assert_that(res[0].rel_mean, close_to(-2.0087585034, 1e-5))
def test_GIVEN_missing_vals_WHEN_rel_mean_THEN_rel_mean_correct(self): stats = StatsAnalyzer(self.missing1, self.missing2) res = stats.rel_mean() assert_that(res[0].rel_mean, close_to(0.0715277778, 1e-5))
def test_GIVEN_no_missing_vals_WHEN_rel_mean_THEN_rel_mean_correct(self): stats = StatsAnalyzer(self.data1, self.data2) res = stats.rel_mean() assert_that(res[0].rel_mean, close_to(-0.0153531746, 1e-5))