class_docstr: Test the scene class.
class_docstr_tok: ["Test","the","scene","class","."]
docstr: Test __getitem__ with names and modifiers.
docstr_tok: ["Test","__getitem__","with","names","and","modifiers","."]
code: def test_getitem_modifiers(self):
      """Test __getitem__ with names and modifiers."""
      # Return least modified item
      scene = Scene()
      scene["1"] = ds1_m0 = xr.DataArray(np.arange(5))
      scene[make_dataid(name="1", modifiers=("mod1",))] = xr.DataArray(
          np.arange(5)
      )
      assert scene["1"] is ds1_m0
      assert len(list(scene.keys())) == 2
  
      scene = Scene()
      scene["1"] = ds1_m0 = xr.DataArray(np.arange(5))
      scene[make_dataid(name="1", modifiers=("mod1",))] = xr.DataArray(
          np.arange(5)
      )
      scene[
          make_dataid(name="1", modifiers=("mod1", "mod2"))
      ] = xr.DataArray(np.arange(5))
      assert scene["1"] is ds1_m0
      assert len(list(scene.keys())) == 3
  
      scene = Scene()
      scene[
          make_dataid(name="1", modifiers=("mod1", "mod2"))
      ] = ds1_m2 = xr.DataArray(np.arange(5))
      scene[
          make_dataid(name="1", modifiers=("mod1",))
      ] = ds1_m1 = xr.DataArray(np.arange(5))
      assert scene["1"] is ds1_m1
      assert (
          scene[make_dataid(name="1", modifiers=("mod1", "mod2"))]
          is ds1_m2
      )
      pytest.raises(
          KeyError,
          scene.__getitem__,
          make_dataid(name="1", modifiers=tuple()),
      )
      assert len(list(scene.keys())) == 2
  
imports: import math
  import numpy
  import pytest
  import xarray
  from dask import array
  from satpy import Scene
  from satpy.dataset.dataid import default_id_keys_config
  from satpy.tests.utils import FAKE_FILEHANDLER_END, FAKE_FILEHANDLER_START, make_cid, make_dataid
label_desc: Use image node_id 8 for calling the TestDataAccessMethods obj's underlying member method code with example usage: obj.test_getitem_modifiers() without return types