Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bucket resamplers trying to print non-existent name #1648

Merged
merged 2 commits into from May 18, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
16 changes: 10 additions & 6 deletions satpy/resample.py
Expand Up @@ -1117,6 +1117,7 @@ def resample(self, data, **kwargs):
dims = ('y', 'x')
else:
dims = data.dims
LOG.debug("Resampling %s", str(data.name))
djhoese marked this conversation as resolved.
Show resolved Hide resolved
result = self.compute(data_arr, **kwargs)
coords = {}
if 'bands' in data.coords:
Expand Down Expand Up @@ -1169,9 +1170,16 @@ class BucketAvg(BucketResamplerBase):
"""

def compute(self, data, fill_value=np.nan, skipna=True, **kwargs):
"""Call the resampling."""
LOG.debug("Resampling %s", str(data.name))
"""Call the resampling.

Args:
data (numpy.Array, dask.Array): Data to be resampled
fill_value (numpy.nan, int): fill_value. Defaults to numpy.nan
skipna (boolean): Skip NA's. Default `True`

Returns:
dask.Array
"""
kwargs = _get_arg_to_pass_for_skipna_handling(skipna=skipna, **kwargs)

results = []
Expand Down Expand Up @@ -1210,8 +1218,6 @@ class BucketSum(BucketResamplerBase):

def compute(self, data, skipna=True, **kwargs):
"""Call the resampling."""
LOG.debug("Resampling %s", str(data.name))

kwargs = _get_arg_to_pass_for_skipna_handling(skipna=skipna, **kwargs)

results = []
Expand All @@ -1237,7 +1243,6 @@ class BucketCount(BucketResamplerBase):

def compute(self, data, **kwargs):
"""Call the resampling."""
LOG.debug("Resampling %s", str(data.name))
results = []
if data.ndim == 3:
for _i in range(data.shape[0]):
Expand All @@ -1260,7 +1265,6 @@ class BucketFraction(BucketResamplerBase):

def compute(self, data, fill_value=np.nan, categories=None, **kwargs):
"""Call the resampling."""
LOG.debug("Resampling %s", str(data.name))
if data.ndim > 2:
raise ValueError("BucketFraction not implemented for 3D datasets")

Expand Down