(self, index)
| 188 | return |
| 189 | |
| 190 | def __getitem__(self, index): |
| 191 | self._getitem = True |
| 192 | |
| 193 | try: |
| 194 | out = N.ndarray.__getitem__(self, index) |
| 195 | finally: |
| 196 | self._getitem = False |
| 197 | |
| 198 | if not isinstance(out, N.ndarray): |
| 199 | return out |
| 200 | |
| 201 | if out.ndim == 0: |
| 202 | return out[()] |
| 203 | if out.ndim == 1: |
| 204 | sh = out.shape[0] |
| 205 | # Determine when we should have a column array |
| 206 | try: |
| 207 | n = len(index) |
| 208 | except Exception: |
| 209 | n = 0 |
| 210 | if n > 1 and isscalar(index[1]): |
| 211 | out.shape = (sh, 1) |
| 212 | else: |
| 213 | out.shape = (1, sh) |
| 214 | return out |
| 215 | |
| 216 | def __mul__(self, other): |
| 217 | if isinstance(other, (N.ndarray, list, tuple)) : |
nothing calls this directly
no test coverage detected