code: def test_read_nan_nodata(self):
      with rasterio.open("tests/data/float_nan.tif") as s:
          a = s.read(masked=True)
          self.assertEqual(a.ndim, 3)
          self.assertEqual(a.shape, (1, 2, 3))
          self.assertTrue(hasattr(a, "mask"))
          self.assertNotEqual(a.fill_value, np.nan)
          self.assertEqual(str(list(set(s.nodatavals))), str([np.nan]))
          self.assertEqual(a.dtype, rasterio.float32)
          self.assertFalse(np.isnan(a).any())
          a = s.read(masked=False)
          self.assertFalse(hasattr(a, "mask"))
          self.assertTrue(np.isnan(a).any())
          # Window does not contain a nodatavalue, result is still masked
          a = s.read(window=((0, 2), (0, 2)), masked=True)
          self.assertEqual(a.ndim, 3)
          self.assertEqual(a.shape, (1, 2, 2))
          self.assertTrue(hasattr(a, "mask"))
  
imports: from hashlib import md5
  import unittest
  import numpy
  import pytest
  import rasterio
  from rasterio.errors import DatasetIOShapeError
label_desc: Use image node_id 13 for calling the ReaderContextTest obj's underlying member method code with example usage: obj.test_read_nan_nodata() without return types