docstr: test that getter and setter go via baseclass
docstr_tok: ["test","that","getter","and","setter","go","via","baseclass"]
code: def test_subclass_items(self):
      """test that getter and setter go via baseclass"""
      x = np.arange(5)
      xcsub = ComplicatedSubArray(x)
      mxcsub = masked_array(
          xcsub, mask=[True, False, True, False, False]
      )
      # getter should  return a ComplicatedSubArray, even for single item
      # first check we wrote ComplicatedSubArray correctly
      assert_(isinstance(xcsub[1], ComplicatedSubArray))
      assert_(isinstance(xcsub[1, ...], ComplicatedSubArray))
      assert_(isinstance(xcsub[1:4], ComplicatedSubArray))
  
      # now that it propagates inside the MaskedArray
      assert_(isinstance(mxcsub[1], ComplicatedSubArray))
      assert_(isinstance(mxcsub[1, ...].data, ComplicatedSubArray))
      assert_(mxcsub[0] is masked)
      assert_(isinstance(mxcsub[0, ...].data, ComplicatedSubArray))
      assert_(isinstance(mxcsub[1:4].data, ComplicatedSubArray))
  
      # also for flattened version (which goes via MaskedIterator)
      assert_(isinstance(mxcsub.flat[1].data, ComplicatedSubArray))
      assert_(mxcsub.flat[0] is masked)
      assert_(isinstance(mxcsub.flat[1:4].base, ComplicatedSubArray))
  
      # setter should only work with ComplicatedSubArray input
      # first check we wrote ComplicatedSubArray correctly
      assert_raises(ValueError, xcsub.__setitem__, 1, x[4])
      # now that it propagates inside the MaskedArray
      assert_raises(ValueError, mxcsub.__setitem__, 1, x[4])
      assert_raises(ValueError, mxcsub.__setitem__, slice(1, 4), x[1:4])
      mxcsub[1] = xcsub[4]
      mxcsub[1:4] = xcsub[1:4]
      # also for flattened version (which goes via MaskedIterator)
      assert_raises(ValueError, mxcsub.flat.__setitem__, 1, x[4])
      assert_raises(
          ValueError, mxcsub.flat.__setitem__, slice(1, 4), x[1:4]
      )
      mxcsub.flat[1] = xcsub[4]
      mxcsub.flat[1:4] = xcsub[1:4]
  
imports: import numpy
  from numpy.lib.mixins import NDArrayOperatorsMixin
  from numpy.testing import assert_, assert_raises
  from numpy.ma.testutils import assert_equal
  from numpy.ma.core import array, arange, masked, MaskedArray, masked_array, log, add, hypot, divide, asarray, asanyarray, nomask
label_desc: Use image node_id 9 for calling the TestSubclassing obj's underlying member method code with example usage: obj.test_subclass_items() without return types