add logIdx to the downsample function
logIdx which is index of line in the SOH messages is in data structure of sohview's reftek. Now we need to add it to trim_downsample function so the data output for plotting contains logIdx because this will be needed to highlight the corresponding SOH messages' line in the display.
Merge request reports
Activity
requested review from @kienle
- Resolved by Kien Le
- Resolved by Kien Le
- Resolved by Kien Le
- Resolved by Kien Le
Can you write tests for the functions you created or modified?
added 1 commit
- 10bc064f - merge chunk_minmax and chunk_minmax_logIdx into one function chunk_minmax
301 302 303 class TestTrimDownsampleSohChan_with_logidx(TestCase): 304 def setUp(self) -> None: 305 self.channel_info = {} 306 self.org_trace = { 307 'times': np.arange(1000), 308 'data': np.arange(1000), 309 'logIdx': np.arange(1000) 310 } 311 self.channel_info['orgTrace'] = self.org_trace 312 self.start_time = 250 313 self.end_time = 750 314 self.first_time = False 315 316 def test_mseed_time_range_does_not_overlap_times_data(self): Yes, so this is additional to other tests. The tests you wrote already include the case there is no 'logIdx'. trim_downsample_SOHChan() doesn't care about what type of data, it only care if 'org_Trace' contains 'logIdx' or not.
Edited by Lan Damchanged this line in version 6 of the diff
310 } 311 self.channel_info['orgTrace'] = self.org_trace 312 self.start_time = 250 313 self.end_time = 750 314 self.first_time = False 315 316 def test_mseed_time_range_does_not_overlap_times_data(self): 317 self.start_time = 2000 318 self.end_time = 3000 319 trim_downsample_SOHChan(self.channel_info, self.start_time, 320 self.end_time, self.first_time) 321 self.assertEqual(self.channel_info['times'].size, 0) 322 self.assertEqual(self.channel_info['data'].size, 0) 323 self.assertEqual(self.channel_info['logIdx'].size, 0) 324 325 def test_mseed_processed_data_is_stored_in_appropriate_location(self): changed this line in version 6 of the diff
- Resolved by Kien Le
- Resolved by Kien Le
- Resolved by Kien Le
added 2 commits
- 3381ce0b - modify return args from downsample in trim_downsample_SOHChan
- 0cf30baa - add test argument passed to function, add tests that Kien wrote in \!27 (closed) as his...
added 1 commit
- 08c3d0f5 - fix bug in test_handling_data to test arguments sent to downsample()
added 9 commits
-
70cda911...81f0e430 - 8 commits from branch
master
- 23aa883e - Merge branch 'master' into add-logIdx
-
70cda911...81f0e430 - 8 commits from branch
mentioned in commit a368be56