(x)
| 11 | |
| 12 | |
| 13 | def midpoints(x): |
| 14 | sl = () |
| 15 | for _ in range(x.ndim): |
| 16 | x = (x[sl + np.index_exp[:-1]] + x[sl + np.index_exp[1:]]) / 2.0 |
| 17 | sl += np.index_exp[:] |
| 18 | return x |
| 19 | |
| 20 | # prepare some coordinates, and attach rgb values to each |
| 21 | r, g, b = np.indices((17, 17, 17)) / 16.0 |
no outgoing calls
searching dependent graphs…