I got a weird feeling from the article in which the author seems to know quite a bit about numpy (citing a few parts of the source even!) but then it uses python loops all around!
Just like you, I'm not really following the domain calculations, so maybe there's a reason that code can't be properly vectorized. But as others have commented, I'm a bit at a loss why the author didn't try numba or Cython.