# Path: pyresample/future/geometry/area.py

# 
# Path: pyresample/future/geometry/swath.py

# 
# Path: pyresample/test/utils.py
# def create_test_latitude(start, stop, shape, twist_factor=0.0, dtype=np.float32):
#     """Get basic sample of latitude data."""
#     num_cols = 1 if len(shape) < 2 else shape[1]
#     lat_col = np.linspace(start, stop, num=shape[0]).astype(dtype).reshape((shape[0], 1))
#     twist_array = np.arange(num_cols) * twist_factor
#     lat_array = np.repeat(lat_col, num_cols, axis=1)
#     lat_array += twist_array
#     return lat_array
# 
# def create_test_longitude(start, stop, shape, twist_factor=0.0, dtype=np.float32):
#     """Get basic sample of longitude data."""
#     if start > 0 > stop:
#         # cross anti-meridian
#         stop += 360.0
# 
#     num_cols = 1 if len(shape) < 2 else shape[1]
#     lon_row = np.linspace(start, stop, num=num_cols).astype(dtype)
#     twist_array = np.arange(shape[0]).reshape((shape[0], 1)) * twist_factor
#     lon_array = np.repeat([lon_row], shape[0], axis=0)
#     lon_array += twist_array
# 
#     if stop > 360.0:
#         lon_array[lon_array > 360.0] -= 360
#     return lon_array


import dask.array as da
import numpy as np
import pytest
import xarray as xr
from pyproj import CRS
from pyresample.future.geometry import (
    AreaDefinition,
    CoordinateDefinition,
    SwathDefinition,
)
from pyresample.test.utils import create_test_latitude, create_test_longitude
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more
# details.
#
# You should have received a copy of the GNU Lesser General Public License along
# with this program.  If not, see <http://www.gnu.org/licenses/>.
"""Shared test configuration and fixtures."""



SRC_SWATH_2D_SHAPE = (50, 10)
SRC_SWATH_1D_SHAPE = (3,)
SRC_AREA_SHAPE = (50, 10)
DST_AREA_SHAPE = (80, 85)


def _euro_lonlats():
    lons = create_test_longitude(3.0, 12.0, SRC_SWATH_2D_SHAPE)
    lats = create_test_latitude(75.0, 26.0, SRC_SWATH_2D_SHAPE)
    return lons, lats


def _euro_lonlats_dask():
    lons, lats = _euro_lonlats()
    lons = da.from_array(lons)
    lats = da.from_array(lats)
    return lons, lats


def _antimeridian_lonlats():

# Path: pyresample/future/geometry/area.py

# 
# Path: pyresample/future/geometry/swath.py

# 
# Path: pyresample/test/utils.py
# def create_test_latitude(start, stop, shape, twist_factor=0.0, dtype=np.float32):
#     """Get basic sample of latitude data."""
#     num_cols = 1 if len(shape) < 2 else shape[1]
#     lat_col = np.linspace(start, stop, num=shape[0]).astype(dtype).reshape((shape[0], 1))
#     twist_array = np.arange(num_cols) * twist_factor
#     lat_array = np.repeat(lat_col, num_cols, axis=1)
#     lat_array += twist_array
#     return lat_array
# 
# def create_test_longitude(start, stop, shape, twist_factor=0.0, dtype=np.float32):
#     """Get basic sample of longitude data."""
#     if start > 0 > stop:
#         # cross anti-meridian
#         stop += 360.0
# 
#     num_cols = 1 if len(shape) < 2 else shape[1]
#     lon_row = np.linspace(start, stop, num=num_cols).astype(dtype)
#     twist_array = np.arange(shape[0]).reshape((shape[0], 1)) * twist_factor
#     lon_array = np.repeat([lon_row], shape[0], axis=0)
#     lon_array += twist_array
# 
#     if stop > 360.0:
#         lon_array[lon_array > 360.0] -= 360
#     return lon_array


# Path: pyresample/test/conftest.py
import dask.array as da
import numpy as np
import pytest
import xarray as xr
from pyproj import CRS
from pyresample.future.geometry import (
    AreaDefinition,
    CoordinateDefinition,
    SwathDefinition,
)
from pyresample.test.utils import create_test_latitude, create_test_longitude

# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more
# details.
#
# You should have received a copy of the GNU Lesser General Public License along
# with this program.  If not, see <http://www.gnu.org/licenses/>.
"""Shared test configuration and fixtures."""



SRC_SWATH_2D_SHAPE = (50, 10)
SRC_SWATH_1D_SHAPE = (3,)
SRC_AREA_SHAPE = (50, 10)
DST_AREA_SHAPE = (80, 85)


def _euro_lonlats():
    lons = create_test_longitude(3.0, 12.0, SRC_SWATH_2D_SHAPE)
    lats = create_test_latitude(75.0, 26.0, SRC_SWATH_2D_SHAPE)
    return lons, lats


def _euro_lonlats_dask():
    lons, lats = _euro_lonlats()
    lons = da.from_array(lons)
    lats = da.from_array(lats)
    return lons, lats


def _antimeridian_lonlats():

    lons = create_test_longitude(172.0, 190.0, SRC_SWATH_2D_SHAPE)