add tests for nanops
minor nanops pep8 fixes