Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
grid.bicubic(collections.OrderedDict(lon=x.flatten(),
lat=y.flatten()),
bounds_error=True,
boundary="sym")
x_axis = pyinterp.Axis(np.linspace(-180, 179, 360), is_circle=True)
y_axis = pyinterp.Axis(np.linspace(-90, 90, 181), is_circle=False)
z_axis = pyinterp.Axis(np.linspace(0, 10, 10), is_circle=False)
matrix, _ = np.meshgrid(x_axis[:], y_axis[:])
grid = pyinterp.Grid2D(x_axis, y_axis, matrix.T)
self.assertIsInstance(grid, pyinterp.Grid2D)
with self.assertRaises(ValueError):
pyinterp.bicubic(grid, x.flatten(), y.flatten(), fitting_model='_')
with self.assertRaises(ValueError):
pyinterp.bicubic(grid, x.flatten(), y.flatten(), boundary='_')
grid = pyinterp.Grid2D(x_axis.flip(inplace=False), y_axis, matrix.T)
with self.assertRaises(ValueError):
pyinterp.bicubic(grid, x.flatten(), y.flatten())
grid = pyinterp.Grid2D(x_axis, y_axis.flip(), matrix.T)
with self.assertRaises(ValueError):
pyinterp.bicubic(grid, x.flatten(), y.flatten())
matrix, _, _ = np.meshgrid(x_axis[:], y_axis[:], z_axis[:])
grid = pyinterp.Grid3D(x_axis, y_axis, z_axis,
matrix.transpose(1, 0, 2))
with self.assertRaises(ValueError):
pyinterp.bicubic(grid, x.flatten(), y.flatten())
z_axis = pyinterp.Axis(np.linspace(0, 10, 10), is_circle=False)
matrix, _ = np.meshgrid(x_axis[:], y_axis[:])
grid = pyinterp.Grid2D(x_axis, y_axis, matrix.T)
self.assertIsInstance(grid, pyinterp.Grid2D)
with self.assertRaises(ValueError):
pyinterp.bicubic(grid, x.flatten(), y.flatten(), fitting_model='_')
with self.assertRaises(ValueError):
pyinterp.bicubic(grid, x.flatten(), y.flatten(), boundary='_')
grid = pyinterp.Grid2D(x_axis.flip(inplace=False), y_axis, matrix.T)
with self.assertRaises(ValueError):
pyinterp.bicubic(grid, x.flatten(), y.flatten())
grid = pyinterp.Grid2D(x_axis, y_axis.flip(), matrix.T)
with self.assertRaises(ValueError):
pyinterp.bicubic(grid, x.flatten(), y.flatten())
matrix, _, _ = np.meshgrid(x_axis[:], y_axis[:], z_axis[:])
grid = pyinterp.Grid3D(x_axis, y_axis, z_axis,
matrix.transpose(1, 0, 2))
with self.assertRaises(ValueError):
pyinterp.bicubic(grid, x.flatten(), y.flatten())
pyinterp.bicubic(grid, x.flatten(), y.flatten(), fitting_model='_')
with self.assertRaises(ValueError):
pyinterp.bicubic(grid, x.flatten(), y.flatten(), boundary='_')
grid = pyinterp.Grid2D(x_axis.flip(inplace=False), y_axis, matrix.T)
with self.assertRaises(ValueError):
pyinterp.bicubic(grid, x.flatten(), y.flatten())
grid = pyinterp.Grid2D(x_axis, y_axis.flip(), matrix.T)
with self.assertRaises(ValueError):
pyinterp.bicubic(grid, x.flatten(), y.flatten())
matrix, _, _ = np.meshgrid(x_axis[:], y_axis[:], z_axis[:])
grid = pyinterp.Grid3D(x_axis, y_axis, z_axis,
matrix.transpose(1, 0, 2))
with self.assertRaises(ValueError):
pyinterp.bicubic(grid, x.flatten(), y.flatten())
with self.assertRaises(ValueError):
grid.bicubic(collections.OrderedDict(lon=x.flatten(),
lat=y.flatten()),
bounds_error=True,
boundary="sym")
x_axis = pyinterp.Axis(np.linspace(-180, 179, 360), is_circle=True)
y_axis = pyinterp.Axis(np.linspace(-90, 90, 181), is_circle=False)
z_axis = pyinterp.Axis(np.linspace(0, 10, 10), is_circle=False)
matrix, _ = np.meshgrid(x_axis[:], y_axis[:])
grid = pyinterp.Grid2D(x_axis, y_axis, matrix.T)
self.assertIsInstance(grid, pyinterp.Grid2D)
with self.assertRaises(ValueError):
pyinterp.bicubic(grid, x.flatten(), y.flatten(), fitting_model='_')
with self.assertRaises(ValueError):
pyinterp.bicubic(grid, x.flatten(), y.flatten(), boundary='_')
grid = pyinterp.Grid2D(x_axis.flip(inplace=False), y_axis, matrix.T)
with self.assertRaises(ValueError):
pyinterp.bicubic(grid, x.flatten(), y.flatten())
grid = pyinterp.Grid2D(x_axis, y_axis.flip(), matrix.T)
with self.assertRaises(ValueError):
pyinterp.bicubic(grid, x.flatten(), y.flatten())
matrix, _, _ = np.meshgrid(x_axis[:], y_axis[:], z_axis[:])
grid = pyinterp.Grid3D(x_axis, y_axis, z_axis,
matrix.transpose(1, 0, 2))
with self.assertRaises(ValueError):
pyinterp.bicubic(grid, x.flatten(), y.flatten())