def test_summary_min(pyspark, summarizers, tests_utils, forecast): expected_pdf = make_pdf([( 0, -9.6, )], ["time", "forecast_min"]) result = forecast.summarize(summarizers.min("forecast")).toPandas() pdt.assert_frame_equal(result, expected_pdf)
def test_summary_min(self): from ts.flint import summarizers forecast = self.forecast() expected_pdf = test_utils.make_pdf([( 0, -9.6, )], ["time", "forecast_min"]) result = forecast.summarize(summarizers.min("forecast")).toPandas() pdt.assert_frame_equal(result, expected_pdf)
def test_summary_min(self): from ts.flint import summarizers forecast = self.forecast() expected_pdf = make_pdf([ (0, -9.6,) ], ["time", "forecast_min"]) result = forecast.summarize(summarizers.min("forecast")).toPandas() pdt.assert_frame_equal(result, expected_pdf)
def test_summary_compose(self): from ts.flint import summarizers price = self.price() expected_pdf = make_pdf([ (0, 6.0, 0.5, 3.25, 1.802775638,) ], ["time", "price_max", "price_min", "price_mean", "price_stddev"]) result = price.summarize([summarizers.max("price"), summarizers.min("price"), summarizers.mean("price"), summarizers.stddev("price")]).toPandas() pdt.assert_frame_equal(result, expected_pdf)
def test_summary_compose(pyspark, summarizers, tests_utils, price): expected_pdf = make_pdf([( 0, 6.0, 0.5, 3.25, 1.802775638, )], ["time", "price_max", "price_min", "price_mean", "price_stddev"]) result = price.summarize([ summarizers.max("price"), summarizers.min("price"), summarizers.mean("price"), summarizers.stddev("price") ]).toPandas() pdt.assert_frame_equal(result, expected_pdf)
def test_summary_compose(self): from ts.flint import summarizers price = self.price() expected_pdf = test_utils.make_pdf([( 0, 6.0, 0.5, 3.25, 1.802775638, )], ["time", "price_max", "price_min", "price_mean", "price_stddev"]) result = price.summarize([ summarizers.max("price"), summarizers.min("price"), summarizers.mean("price"), summarizers.stddev("price") ]).toPandas() pdt.assert_frame_equal(result, expected_pdf)