예제 #1
0
 def test_parser_disp_3d(self):
     p = parser.Parser(dc, indices, [], time_step, step_skip, min_dt=20)
     assert_equal(len(p.disp_3d), 80)
     for i, d in enumerate(p.disp_3d):
         assert_equal(d.shape[0], 100)
         assert_equal(d.shape[1], 80-i)
         assert_equal(d.shape[2], 3)
예제 #2
0
 def test_get_disps(self):
     p = parser.Parser(dc, indices, [], time_step, step_skip, min_dt=20)
     dt, disp_3d = p.get_disps(np.arange(20, 100, 1), dc)
     assert_equal(dt, np.arange(20, 100, 1))
     assert_equal(len(disp_3d), 80)
     for i, d in enumerate(disp_3d):
         assert_equal(d.shape[0], 100)
         assert_equal(d.shape[1], 80-i)
         assert_equal(d.shape[2], 3)
예제 #3
0
 def test_smoothed_timesteps_min_dt_zero(self):
     p = parser.Parser(dc, indices, [], time_step, step_skip, min_dt=0)
     timesteps = p.smoothed_timesteps(100, 30, indices)
     assert_equal(timesteps, np.arange(1, 100, 1))
예제 #4
0
 def test_smoothed_timesteps_not_enough(self):
     with self.assertRaises(ValueError):
         p = parser.Parser(dc, indices, [], time_step, step_skip, min_dt=120)
         p.smoothed_timesteps(100, 20, indices)
예제 #5
0
 def test_parser_delta_t(self):
     p = parser.Parser(dc, indices, [], time_step, step_skip, min_dt=20)
     assert_equal(p.delta_t.size, 80)
예제 #6
0
 def test_parser_init_min_dt(self):
     p = parser.Parser(dc, indices, [], time_step, step_skip, min_dt=20)
     assert_equal(p.min_dt, 20)