def test_should_work_for_3d_data(self): # When num_points = 1000 bounds = (0.0, 1.0, 0.5, 1.5, -1.0, 0.0) dims = get_nx_ny_nz(num_points, bounds) # Then self.assertListEqual(list(dims), [10, 10, 10]) # When num_points = 1000 bounds = (0.0, 1.0, 0.5, 1.5, -1.0, 2.0) dims = get_nx_ny_nz(num_points, bounds) # Then self.assertListEqual(list(dims), [7, 7, 21])
def _num_points_changed(self, value): interp = self.interpolator if interp is not None: bounds = self.interpolator.bounds shape = get_nx_ny_nz(value, bounds) interp.set_domain(bounds, shape) self._update_plot()
def test_should_work_for_1d_data(self): # When num_points = 100 bounds = (0.0, 1.5, 0.0, 0.0, 0.0, 0.0) dims = get_nx_ny_nz(num_points, bounds) # Then self.assertListEqual(list(dims), [100, 1, 1]) # When num_points = 100 bounds = (0.0, 0.0, 0.0, 1.123, 0.0, 0.0) dims = get_nx_ny_nz(num_points, bounds) # Then self.assertListEqual(list(dims), [1, 100, 1]) # When num_points = 100 bounds = (0.0, 0.0, 0.0, 0.0, 0.0, 3.0) dims = get_nx_ny_nz(num_points, bounds) # Then self.assertListEqual(list(dims), [1, 1, 100])