code: def test_transform(self):
      # Test some simple vectors to make sure they are transformed
      # correctly.
      rlons = np.array([-90.0, 0, 90.0, 180.0])
      rlats = np.array([0.0, 0.0, 0.0, 0.0])
      src_proj = ccrs.PlateCarree()
      target_proj = ccrs.Stereographic(
          central_latitude=90, central_longitude=0
      )
      # transform grid eastward vectors
      ut, vt = target_proj.transform_vectors(
          src_proj, rlons, rlats, np.ones([4]), np.zeros([4])
      )
      assert_array_almost_equal(ut, np.array([0, 1, 0, -1]), decimal=2)
      assert_array_almost_equal(vt, np.array([-1, 0, 1, 0]), decimal=2)
      # transform grid northward vectors
      ut, vt = target_proj.transform_vectors(
          src_proj, rlons, rlats, np.zeros([4]), np.ones([4])
      )
      assert_array_almost_equal(ut, np.array([1, 0, -1, 0]), decimal=2)
      assert_array_almost_equal(vt, np.array([0, 1, 0, -1]), decimal=2)
      # transform grid north-eastward vectors
      ut, vt = target_proj.transform_vectors(
          src_proj, rlons, rlats, np.ones([4]), np.ones([4])
      )
      assert_array_almost_equal(ut, np.array([1, 1, -1, -1]), decimal=2)
      assert_array_almost_equal(vt, np.array([-1, 1, 1, -1]), decimal=2)
  
file_path: cartopy/lib/cartopy/tests/test_crs_transform_vectors.py
imports: import warnings
  import numpy
  from numpy.testing import assert_array_almost_equal
  import pytest
  import cartopy.crs
label_desc: Use image node_id 1 for calling the TestTransformVectors obj's underlying member method code with example usage: obj.test_transform() without return types