# Path: lib/cartopy/tests/crs/helpers.py
# def check_proj_params(name, crs, other_args):
#     expected = other_args | {f'proj={name}', 'no_defs'}
#     proj_params = set(crs.proj4_init.lstrip('+').split(' +'))
#     assert expected == proj_params


import numpy as np
import cartopy.crs as ccrs
from numpy.testing import assert_almost_equal
from .helpers import check_proj_params
        # equivalence between true_scale and scale_factor.
        # In these conditions a scale factor of 0.75 corresponds exactly to
        # a standard parallel of 30N.
        globe = ccrs.Globe(ellipse='sphere')
        stereo = ccrs.Stereographic(central_latitude=90., scale_factor=0.75,
                                    globe=globe)
        other_args = {'ellps=sphere', 'lat_0=90.0', 'lon_0=0.0', 'k_0=0.75',
                      'x_0=0.0', 'y_0=0.0'}
        check_proj_params('stere', stereo, other_args)

        # Now test projections
        lon, lat = 10, 10
        projected_scale_factor = stereo.transform_point(lon, lat,
                                                        ccrs.Geodetic())

        # should be equivalent to North Polar Stereo with
        # true_scale_latitude = 30
        nstereo = ccrs.NorthPolarStereo(globe=globe, true_scale_latitude=30)
        projected_true_scale = nstereo.transform_point(lon, lat,
                                                       ccrs.Geodetic())

        assert projected_true_scale == projected_scale_factor

    def test_eastings(self):
        stereo = ccrs.Stereographic()
        stereo_offset = ccrs.Stereographic(false_easting=1234,
                                           false_northing=-4321)

        other_args = {'ellps=WGS84', 'lat_0=0.0', 'lon_0=0.0', 'x_0=1234',
                      'y_0=-4321'}

# Path: lib/cartopy/tests/crs/helpers.py
# def check_proj_params(name, crs, other_args):
#     expected = other_args | {f'proj={name}', 'no_defs'}
#     proj_params = set(crs.proj4_init.lstrip('+').split(' +'))
#     assert expected == proj_params


# Path: lib/cartopy/tests/crs/test_stereographic.py
import numpy as np
import cartopy.crs as ccrs
from numpy.testing import assert_almost_equal
from .helpers import check_proj_params

        # equivalence between true_scale and scale_factor.
        # In these conditions a scale factor of 0.75 corresponds exactly to
        # a standard parallel of 30N.
        globe = ccrs.Globe(ellipse='sphere')
        stereo = ccrs.Stereographic(central_latitude=90., scale_factor=0.75,
                                    globe=globe)
        other_args = {'ellps=sphere', 'lat_0=90.0', 'lon_0=0.0', 'k_0=0.75',
                      'x_0=0.0', 'y_0=0.0'}
        check_proj_params('stere', stereo, other_args)

        # Now test projections
        lon, lat = 10, 10
        projected_scale_factor = stereo.transform_point(lon, lat,
                                                        ccrs.Geodetic())

        # should be equivalent to North Polar Stereo with
        # true_scale_latitude = 30
        nstereo = ccrs.NorthPolarStereo(globe=globe, true_scale_latitude=30)
        projected_true_scale = nstereo.transform_point(lon, lat,
                                                       ccrs.Geodetic())

        assert projected_true_scale == projected_scale_factor

    def test_eastings(self):
        stereo = ccrs.Stereographic()
        stereo_offset = ccrs.Stereographic(false_easting=1234,
                                           false_northing=-4321)

        other_args = {'ellps=WGS84', 'lat_0=0.0', 'lon_0=0.0', 'x_0=1234',
                      'y_0=-4321'}

        check_proj_params('stere', stereo_offset, other_args)