(self)
| 120 | class TestGeomspace: |
| 121 | |
| 122 | def test_basic(self): |
| 123 | y = geomspace(1, 1e6) |
| 124 | assert_(len(y) == 50) |
| 125 | y = geomspace(1, 1e6, num=100) |
| 126 | assert_(y[-1] == 10 ** 6) |
| 127 | y = geomspace(1, 1e6, endpoint=False) |
| 128 | assert_(y[-1] < 10 ** 6) |
| 129 | y = geomspace(1, 1e6, num=7) |
| 130 | assert_array_equal(y, [1, 10, 100, 1e3, 1e4, 1e5, 1e6]) |
| 131 | |
| 132 | y = geomspace(8, 2, num=3) |
| 133 | assert_allclose(y, [8, 4, 2]) |
| 134 | assert_array_equal(y.imag, 0) |
| 135 | |
| 136 | y = geomspace(-1, -100, num=3) |
| 137 | assert_array_equal(y, [-1, -10, -100]) |
| 138 | assert_array_equal(y.imag, 0) |
| 139 | |
| 140 | y = geomspace(-100, -1, num=3) |
| 141 | assert_array_equal(y, [-100, -10, -1]) |
| 142 | assert_array_equal(y.imag, 0) |
| 143 | |
| 144 | def test_boundaries_match_start_and_stop_exactly(self): |
| 145 | # make sure that the boundaries of the returned array exactly |
nothing calls this directly
no test coverage detected