Skip to content

Commit

Permalink
fix imports and docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
ameraner committed Jul 3, 2024
1 parent c8cd927 commit f3acfb4
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions pyresample/test/test_bucket.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@
import dask
import dask.array as da
import numpy as np
import xarray as xr
import pytest
import xarray as xr

from pyresample import bucket, create_area_def
from pyresample.bucket import get_invalid_mask
from pyresample.geometry import AreaDefinition
Expand All @@ -36,6 +37,7 @@

@pytest.fixture(scope="module")
def adef():
"""Get AreaDefinition for tests."""
return AreaDefinition('eurol',
'description',
'',
Expand All @@ -51,23 +53,26 @@ def adef():

@pytest.fixture(scope="module")
def lons():
"""Get longitudes for tests."""
return da.from_array(np.array([[25., 25.], [25., 25.]]), chunks=CHUNKS)


@pytest.fixture(scope="module")
def lats():
"""Get latitudes for tests."""
return da.from_array(np.array([[60., 60.00001], [60.2, 60.3]]), chunks=CHUNKS)


@pytest.fixture(scope="module")
def resampler(adef, lons, lats):
"""Get initialised resampler for tests."""
return bucket.BucketResampler(adef, lons, lats)


@patch('pyresample.bucket.Proj')
@patch('pyresample.bucket.BucketResampler._get_indices')
def test_init(get_indices, prj, adef, lons, lats):
"""Test the init method of the BucketResampler"""
"""Test the init method of the BucketResampler."""
resampler = bucket.BucketResampler(adef, lons, lats)

get_indices.assert_called_once()
Expand Down

0 comments on commit f3acfb4

Please sign in to comment.