Ejemplo n.º 1
0
 def test_missing(self):
     ds = sample_dataset_factory()
     self.assertRaises(ValueError, BASIC({"OPERATIONS": "NOMISSING"}, ds))
     self.assertRaises(ValueError, BASIC({"OPERATIONS": "MISSING,NOMISSING"}, ds))
     self.assertRaises(ValueError, BASIC({"OPERATIONS": "MISSING", "MISSING": "MA02,MA01"}, ds))
     self.assertEqual(
         BASIC({"OPERATIONS": "MISSING", "MISSING": "MA0."}, ds)().missing, ["MA00", "MA01", "MA02", "MA03", "MA04"]
     )
Ejemplo n.º 2
0
 def test_mkmatrix(self):
     ds = sample_dataset_factory()
     self.assertRaises(ValueError, BASIC({"SHAPE": "2,2"}, ds))  # E:PROC:EXTRACT:001
     b = BASIC({"SHAPE": "2,2", "OUTPUT": "X,Y"}, ds)()
     self.assertTrue(np.isnan(ds["X"][0]))
     b = BASIC({"SHAPE": "2,2", "OUTPUT": "X,Y", "FILL": "1.0"}, ds)()
     self.assertEqual(ds["X"][1], 1.0)
     self.assertRaises(SyntaxWarning, BASIC({"SHAPE": "2,2", "OUTPUT": "X,Y", "ORIENTATION": "FOO"}, ds))
     b = BASIC({"SHAPE": "2,2", "OUTPUT": "X,Y", "ROW_0": "A01", "ROW_1": "NAN,A02"}, ds)()
     self.assertEqual(ds["X"][0], ds["Y"][1])
Ejemplo n.º 3
0
 def test_drop(self):
     ds = sample_dataset_factory()
     BASIC({"DROP": "TYPE(TIMESERIES)"}, ds)()