Thanks for the tests!

The tests are a bit difficult to follow, however. Could you simplify the creation of these test arrays? You can probably eliminate the loops  (here and below) with `np.tri`?