示例#1
0
文件: io.py 项目: xyt556/hydrobox
 def test_distribution_args(self):
     assert_series_equal(
         timeseries_from_distribution(
             distribution='normal',
             distribution_args=[3, 0.5],
             seed=42,
             start='200001011130'),
         DISTRIBUTION_ARGS, check_less_precise=6
     )
示例#2
0
文件: io.py 项目: xyt556/hydrobox
 def test_end_now(self):
     assert_index_equal(
         timeseries_from_distribution(start=None, end='now').index,
         pd.date_range(end=dt.now().strftime('%Y%m%d%H%M%S'),
                       periods=10, freq='D')
     )
示例#3
0
文件: io.py 项目: xyt556/hydrobox
 def test_end_datetime(self):
     assert_index_equal(
         timeseries_from_distribution(start=None, end=dt(2013, 9, 24)).index,
         pd.date_range(end='20130924', periods=10, freq='D')
     )
示例#4
0
文件: io.py 项目: xyt556/hydrobox
 def test_start(self):
     assert_index_equal(
         timeseries_from_distribution(start='20130924').index,
         pd.date_range(start='20130924', periods=10, freq='D')
     )
示例#5
0
文件: io.py 项目: xyt556/hydrobox
 def test_seed(self):
     assert_series_equal(timeseries_from_distribution(seed=2409, start='200001011130'),
                         SEED_2409, check_less_precise=6)
示例#6
0
文件: io.py 项目: xyt556/hydrobox
 def test_size(self):
     assert_series_equal(
         timeseries_from_distribution(seed=42, start='200001011130', size=5),
         DEFAULT_ARGS[:5], check_less_precise=6
     )
示例#7
0
文件: io.py 项目: xyt556/hydrobox
 def test_normal_distribution(self):
     assert_series_equal(
         timeseries_from_distribution(distribution='normal',
                                      seed=42, start='200001011130'),
         NORMAL_DISTRIBUTION, check_less_precise=6
     )
示例#8
0
文件: io.py 项目: xyt556/hydrobox
 def test_default_args(self):
     assert_series_equal(
         timeseries_from_distribution(seed=42, start='200001011130'),
         DEFAULT_ARGS, check_less_precise=6
     )
示例#9
0
文件: io.py 项目: xyt556/hydrobox
 def test_import_unkown_func(self):
     with self.assertRaises(ValueError):
         timeseries_from_distribution(distribution='not_importable_func')