added a workaround for numpy bug #3926
Automatic style corrections courtesy of autopep8