Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test__core_function_suffix(self):
with self.assertRaises(TypeError):
pyinterp.interface._core_function_suffix(1)
lon = pyinterp.Axis(np.arange(0, 360, 1), is_circle=True)
lat = pyinterp.Axis(np.arange(-80, 80, 1), is_circle=False)
matrix, _ = np.meshgrid(lon[:], lat[:])
self.assertEqual(
pyinterp.interface._core_function_suffix(
pyinterp.core.Grid2DFloat64(lon, lat, matrix.T)), "float64")
self.assertEqual(
pyinterp.interface._core_function_suffix(
pyinterp.core.Grid2DFloat32(lon, lat, matrix.T)), "float32")
def test__core_function_suffix(self):
with self.assertRaises(TypeError):
pyinterp.interface._core_function_suffix(1)
lon = pyinterp.Axis(np.arange(0, 360, 1), is_circle=True)
lat = pyinterp.Axis(np.arange(-80, 80, 1), is_circle=False)
matrix, _ = np.meshgrid(lon[:], lat[:])
self.assertEqual(
pyinterp.interface._core_function_suffix(
pyinterp.core.Grid2DFloat64(lon, lat, matrix.T)), "float64")
self.assertEqual(
pyinterp.interface._core_function_suffix(
pyinterp.core.Grid2DFloat32(lon, lat, matrix.T)), "float32")
def test__core_function_suffix(self):
with self.assertRaises(TypeError):
pyinterp.interface._core_function_suffix(1)
lon = pyinterp.Axis(np.arange(0, 360, 1), is_circle=True)
lat = pyinterp.Axis(np.arange(-80, 80, 1), is_circle=False)
matrix, _ = np.meshgrid(lon[:], lat[:])
self.assertEqual(
pyinterp.interface._core_function_suffix(
pyinterp.core.Grid2DFloat64(lon, lat, matrix.T)), "float64")
self.assertEqual(
pyinterp.interface._core_function_suffix(
pyinterp.core.Grid2DFloat32(lon, lat, matrix.T)), "float32")