[PEP-8: line too long](https://www.python.org/dev/peps/pep-0008/#maximum-line-length).  I think it would be better to move the comment up to where `g2` is computed, and put the comment in its own line(s), before line 516.