示例#1
0
 def test_large_window_len(self):
     with pytest.raises(ValueError) as e_info:
         _ = tstoolbox.filter("flat",
                              "lowpass",
                              input_ts="tests/data_sine.csv",
                              window_len=1000)
     assert r"Input vector (length=" in str(e_info.value)
示例#2
0
 def test_filter_fft_lowpass(self):
     out = tstoolbox.filter('fft_lowpass',
                            input_ts='tests/data_sine.csv',
                            print_input=True,
                            cutoff_period=50)
     self.maxDiff = None
     assert_frame_equal(out, self.fft_lowpass, check_column_type=False)
示例#3
0
 def test_filter_fft_lowpass(self):
     out = tstoolbox.filter('fft_lowpass',
                            input_ts='tests/data_sine.csv',
                            print_input=True,
                            cutoff_period=50)
     self.maxDiff = None
     assert_frame_equal(out, self.fft_lowpass, check_column_type=False)
示例#4
0
 def test_small_window_len(self):
     out = tstoolbox.filter("flat",
                            input_ts="tests/data_sine.csv",
                            window_len=2)
     out1 = tstoolbox.read("tests/data_sine.csv")
     out1.columns = ["Value::filter"]
     # NOp
     assert_frame_equal(out, out1)
示例#5
0
 def test_small_window_len(self):
     out = tstoolbox.filter('flat',
                            input_ts='tests/data_sine.csv',
                            window_len=2)
     out1 = tstoolbox.read('tests/data_sine.csv')
     out1.columns = ['Value_filter']
     # NOp
     assert_frame_equal(out, out1)
示例#6
0
 def test_small_window_len(self):
     out = tstoolbox.filter('flat',
                            input_ts='tests/data_sine.csv',
                            window_len=2)
     out1 = tstoolbox.read('tests/data_sine.csv')
     out1.columns = ['Value::filter']
     # NOp
     assert_frame_equal(out, out1)
示例#7
0
 def test_filter_hanning(self):
     out = tstoolbox.filter(
         "hanning",
         "lowpass",
         input_ts="tests/data_sine.csv",
         print_input=True,
         window_len=5,
     )
     self.maxDiff = None
     assert_frame_equal(out, self.hanning, check_column_type=False)
示例#8
0
 def test_filter_fft_lowpass(self):
     out = tstoolbox.filter(
         "fft",
         "lowpass",
         input_ts="tests/data_sine.csv",
         print_input=True,
         lowpass_cutoff=50,
         window_len=5,
     )
     self.maxDiff = None
     assert_frame_equal(out, self.fft_lowpass, check_column_type=False)
示例#9
0
 def test_filter_hanning(self):
     out = tstoolbox.filter('hanning',
                            input_ts='tests/data_sine.csv',
                            print_input=True)
     self.maxDiff = None
     assert_frame_equal(out, self.hanning, check_column_type=False)
示例#10
0
 def test_filter_type(self):
     with pytest.raises(ValueError) as e_info:
         _ = tstoolbox.filter('flatter',
                              input_ts='tests/data_sine.csv')
     assert r'Filter type ' in str(e_info.value)
示例#11
0
 def test_filter_flat(self):
     out = tstoolbox.filter("flat",
                            input_ts="tests/data_sine.csv",
                            print_input=True)
     self.maxDiff = None
     assert_frame_equal(out, self.flat_3, check_column_type=False)
示例#12
0
 def test_filter_type(self):
     with pytest.raises(ValueError) as e_info:
         _ = tstoolbox.filter("flatter", input_ts="tests/data_sine.csv")
     assert r"Filter type " in str(e_info.value)
示例#13
0
 def test_filter_type(self):
     with assert_raises_regexp(AssertionError, r"Filter type "):
         out = tstoolbox.filter('flatter', input_ts='tests/data_sine.csv')
示例#14
0
 def test_filter_type(self):
     with pytest.raises(ValueError) as e_info:
         _ = tstoolbox.filter("flatter",
                              "lowpass",
                              input_ts="tests/data_sine.csv")
     assert r'The argument "filter_type" should be' in str(e_info.value)
示例#15
0
 def test_filter_hanning(self):
     out = tstoolbox.filter('hanning',
                            input_ts='tests/data_sine.csv',
                            print_input=True)
     self.maxDiff = None
     assert_frame_equal(out, self.hanning, check_column_type=False)
示例#16
0
 def test_large_window_len(self):
     with pytest.raises(ValueError) as e_info:
         _ = tstoolbox.filter('flat',
                              input_ts='tests/data_sine.csv',
                              window_len=1000)
     assert r'Input vector (length=' in str(e_info.value)
示例#17
0
 def test_large_window_len(self):
     with assert_raises_regexp(AssertionError, "Input vector \(length="):
         out = tstoolbox.filter('flat',
                                input_ts='tests/data_sine.csv',
                                window_len=1000)