def test_colormap_endian():
 cmap = cm.get_cmap(u'jet')
 a = [(-0.5), 0, 0.5, 1, 1.5, np.nan]
 for dt in [u'f2', u'f4', u'f8']:
  anative = np.ma.masked_invalid(np.array(a, dtype=dt))
  aforeign = anative.byteswap().newbyteorder()
  assert_array_equal(cmap(anative), cmap(aforeign))

def test_colormap_endian ( ) : cmap = cm . get_cmap ( u'jet' ) a = [ ( - 0.5 ) , 0 , 0.5 , 1 , 1.5 , np . nan ] for dt in [ u'f2' , u'f4' , u'f8' ] : anative = np . ma . masked_invalid ( np . array ( a , dtype = dt ) ) aforeign = anative . byteswap ( ) . newbyteorder ( ) assert_array_equal ( cmap ( anative ) , cmap ( aforeign ) )
github issue #1005: a bug in putmask caused erroneous mapping of 1 .