class_docstr: Test the fraction bucket resampler.
class_docstr_tok: ["Test","the","fraction","bucket","resampler","."]
docstr: Test fraction bucket resampler computation.
code: def test_compute(self):
      """Test fraction bucket resampler computation."""
      self.bucket.resampler = mock.MagicMock()
      data = da.ones((3, 3))
  
      # No kwargs given
      _ = self.bucket.compute(data)
      self.bucket.resampler.get_fractions.assert_called_with(
          data, categories=None, fill_value=np.nan
      )
      # Custom kwargs
      _ = self.bucket.compute(data, categories=[1, 2], fill_value=0)
      self.bucket.resampler.get_fractions.assert_called_with(
          data, categories=[1, 2], fill_value=0
      )
  
      # Too many dimensions
      data = da.ones((3, 5, 5))
      with pytest.raises(
          ValueError,
          match="BucketFraction not implemented for 3D datasets",
      ):
          _ = self.bucket.compute(data)
  
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 2 for calling the TestBucketFraction obj's underlying member method code with example usage: obj.test_compute() without return types