Exemple #1
0
 def test_ensemble_date(self):
     data = EnsembleForecastIO(basin='klamath',
                               start_date='2014-01-01',
                               end_date='2014-02-14',
                               station="KLAO3")
     self.assertEqual(len(data), 1)
     item = data[0]
     self.assertEqual(item.site, "KLAO3")
     self.assertGreater(len(item.data), 0)
     for row in item.data:
         self.assertLess(row.date.date(), date(2014, 2, 15))
Exemple #2
0
    def test_ensemble_single(self):
        data = EnsembleForecastIO(basin='klamath',
                                  start_date='2014-01-01',
                                  station="KLAO3")
        self.assertEqual(len(data), 1)
        item = data[0]
        self.assertEqual(item.site, "KLAO3")
        self.assertGreater(len(item.data), 0)

        row = item.data[0]
        self.assertHasFields(row, ("date", "year", "value"))
        self.assertIsInstance(row.date, date)
        self.assertIsInstance(row.year, int)
        self.assertIsInstance(row.value, float)
Exemple #3
0
    def test_ensemble_forecast(self):
        data = EnsembleForecastIO(
            basin='klamath',
            start_date='2014-01-01',
        )
        self.assertGreater(len(data), 0)
        item = data[0]
        self.assertHasFields(item, ("site", "parameter", "data"))
        self.assertGreater(len(item.data), 0)

        row = item.data[0]
        self.assertHasFields(row, ("date", "year", "value"))
        self.assertIsInstance(row.date, date)
        self.assertIsInstance(row.year, int)
        self.assertIsInstance(row.value, float)