(self)
| 2165 | assert_equal(fval.item(), (-999999999,)) |
| 2166 | |
| 2167 | def test_fillvalue_conversion(self): |
| 2168 | # Tests the behavior of fill_value during conversion |
| 2169 | # We had a tailored comment to make sure special attributes are |
| 2170 | # properly dealt with |
| 2171 | a = array([b'3', b'4', b'5']) |
| 2172 | a._optinfo.update({'comment':"updated!"}) |
| 2173 | |
| 2174 | b = array(a, dtype=int) |
| 2175 | assert_equal(b._data, [3, 4, 5]) |
| 2176 | assert_equal(b.fill_value, default_fill_value(0)) |
| 2177 | |
| 2178 | b = array(a, dtype=float) |
| 2179 | assert_equal(b._data, [3, 4, 5]) |
| 2180 | assert_equal(b.fill_value, default_fill_value(0.)) |
| 2181 | |
| 2182 | b = a.astype(int) |
| 2183 | assert_equal(b._data, [3, 4, 5]) |
| 2184 | assert_equal(b.fill_value, default_fill_value(0)) |
| 2185 | assert_equal(b._optinfo['comment'], "updated!") |
| 2186 | |
| 2187 | b = a.astype([('a', '|S3')]) |
| 2188 | assert_equal(b['a']._data, a._data) |
| 2189 | assert_equal(b['a'].fill_value, a.fill_value) |
| 2190 | |
| 2191 | def test_default_fill_value(self): |
| 2192 | # check all calling conventions |
nothing calls this directly
no test coverage detected