Example #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)
Example #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)
Example #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)
Example #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)
Example #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)
Example #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)
Example #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)
Example #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)
Example #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)
Example #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)
Example #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)
Example #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)
Example #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')
Example #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)
Example #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)
Example #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)
Example #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)