(self)
| 146 | class TestGeomspace: |
| 147 | |
| 148 | def test_basic(self): |
| 149 | y = geomspace(1, 1e6) |
| 150 | assert_(len(y) == 50) |
| 151 | y = geomspace(1, 1e6, num=100) |
| 152 | assert_(y[-1] == 10 ** 6) |
| 153 | y = geomspace(1, 1e6, endpoint=False) |
| 154 | assert_(y[-1] < 10 ** 6) |
| 155 | y = geomspace(1, 1e6, num=7) |
| 156 | assert_array_equal(y, [1, 10, 100, 1e3, 1e4, 1e5, 1e6]) |
| 157 | |
| 158 | y = geomspace(8, 2, num=3) |
| 159 | assert_allclose(y, [8, 4, 2]) |
| 160 | assert_array_equal(y.imag, 0) |
| 161 | |
| 162 | y = geomspace(-1, -100, num=3) |
| 163 | assert_array_equal(y, [-1, -10, -100]) |
| 164 | assert_array_equal(y.imag, 0) |
| 165 | |
| 166 | y = geomspace(-100, -1, num=3) |
| 167 | assert_array_equal(y, [-100, -10, -1]) |
| 168 | assert_array_equal(y.imag, 0) |
| 169 | |
| 170 | def test_boundaries_match_start_and_stop_exactly(self): |
| 171 | # make sure that the boundaries of the returned array exactly |
nothing calls this directly
no test coverage detected