class_docstr: Tests for the 'native' resampling method.
class_docstr_tok: ["Tests","for","the","'native","'","resampling","method","."]
docstr: Test that an incompatible factor for the chunk size is rechunked.
  
  This can happen when a user chunks their data that makes sense for
  the overall shape of the array and for their local machine's
  performance, but the resulting resampling factor does not divide evenly
  into that chunk size.
code: def test_expand_reduce_agg_rechunk(self):
      """Test that an incompatible factor for the chunk size is rechunked.
  
      This can happen when a user chunks their data that makes sense for
      the overall shape of the array and for their local machine's
      performance, but the resulting resampling factor does not divide evenly
      into that chunk size.
  
      """
      from satpy.utils import PerformanceWarning
  
      d_arr = da.zeros((6, 20), chunks=3)
      text = "Array chunk size is not divisible by aggregation factor. Re-chunking to continue native resampling."
      with pytest.warns(PerformanceWarning, match=text):
          new_data = NativeResampler._expand_reduce(
              d_arr, {0: 0.5, 1: 0.5}
          )
      assert new_data.shape == (3, 10)
  
imports: import os
  import shutil
  import tempfile
  import unittest
  from unittest import mock
  import dask.array
  import numpy
  import pytest
  import xarray
  from pyproj import CRS
  from satpy.resample import NativeResampler
label_desc: Use image node_id 6 for calling the TestNativeResampler obj's underlying member method code with example usage: obj.test_expand_reduce_agg_rechunk() without return types