MCPcopy Index your code
hub / github.com/numpy/numpy / test_round_with_scalar

Method test_round_with_scalar

numpy/ma/tests/test_core.py:4627–4650  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

4625 assert_(result is output)
4626
4627 def test_round_with_scalar(self):
4628 # Testing round with scalar/zero dimension input
4629 # GH issue 2244
4630 a = array(1.1, mask=[False])
4631 assert_equal(a.round(), 1)
4632
4633 a = array(1.1, mask=[True])
4634 assert_(a.round() is masked)
4635
4636 a = array(1.1, mask=[False])
4637 output = np.empty(1, dtype=float)
4638 output.fill(-9999)
4639 a.round(out=output)
4640 assert_equal(output, 1)
4641
4642 a = array(1.1, mask=[False])
4643 output = array(-9999., mask=[True])
4644 a.round(out=output)
4645 assert_equal(output[()], 1)
4646
4647 a = array(1.1, mask=[True])
4648 output = array(-9999., mask=[False])
4649 a.round(out=output)
4650 assert_(output[()] is masked)
4651
4652 def test_identity(self):
4653 a = identity(5)

Callers

nothing calls this directly

Calls 4

arrayFunction · 0.90
assert_equalFunction · 0.90
assert_Function · 0.85
roundMethod · 0.80

Tested by

no test coverage detected