Ejemplo n.º 1
0
 def test_createts_from_dates(self):
     """Create a ts file from start/end dates and freq."""
     sdate = self.data.index[0]
     edate = self.data.index[-1]
     freq = tsutils.asbestfreq(self.data)
     freq = freq.index.freqstr
     out = tstoolbox.createts(start_date=sdate, end_date=edate, freq=freq).index
     out.name = 'Datetime'
     assert_index_equal(out, self.data.index)
Ejemplo n.º 2
0
 def test_createts_from_dates(self):
     """Create a ts file from start/end dates and freq."""
     sdate = self.data.index[0]
     edate = self.data.index[-1]
     freq = tsutils.asbestfreq(self.data)
     freq = freq.index.freqstr
     out = tstoolbox.createts(start_date=sdate, end_date=edate,
                              freq=freq).index
     out.name = "Datetime"
     assert_index_equal(out, self.data.index)
Ejemplo n.º 3
0
 def test_exception(self):
     with pytest.raises(ValueError) as e_info:
         _ = tstoolbox.createts()
     assert r"If input_ts is None, then start_date, end_date" in str(
         e_info.value)
Ejemplo n.º 4
0
 def test_createts_from_input(self):
     """Create a ts of data_flat.csv."""
     out = tstoolbox.createts(input_ts=self.data).index
     out1 = tstoolbox.read("tests/data_flat.csv").index
     assert_index_equal(out, out1)
Ejemplo n.º 5
0
 def test_exception(self):
     with assert_raises_regexp(
             AssertionError,
             r"If input_ts is None, then start_date, end_date"):
         out = tstoolbox.createts()
Ejemplo n.º 6
0
 def test_createts_from_input(self):
     ''' Create a ts of data_flat.csv
     '''
     out = tstoolbox.createts(input_ts=self.data).index
     out1 = tstoolbox.read('tests/data_flat.csv').index
     assert_index_equal(out, out1)
Ejemplo n.º 7
0
 def test_exception(self):
     with pytest.raises(ValueError) as e_info:
         _ = tstoolbox.createts()
     assert r'If input_ts is None, then start_date, end_date' in str(e_info.value)
Ejemplo n.º 8
0
 def test_createts_from_input(self):
     """Create a ts of data_flat.csv."""
     out = tstoolbox.createts(input_ts=self.data).index
     out1 = tstoolbox.read('tests/data_flat.csv').index
     assert_index_equal(out, out1)