Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes15kdownloads
test_numeric.py19 linesDownload Raw Back to tests
1import numpy as np
2from numpy.testing import assert_equal
3
4
5class TestDot:
6    def test_matscalar(self):
7        b1 = np.matrix(np.ones((3, 3), dtype=complex))
8        assert_equal(b1 * 1.0, b1)
9
10
11def test_diagonal():
12    b1 = np.matrix([[1, 2], [3, 4]])
13    diag_b1 = np.matrix([[1, 4]])
14    array_b1 = np.array([1, 4])
15
16    assert_equal(b1.diagonal(), diag_b1)
17    assert_equal(np.diagonal(b1), array_b1)
18    assert_equal(np.diag(b1), array_b1)
19 
codekingpro/portable-devtools · Team Ai