From 45cef38cda80868355a920b5e94211dcf662ea07 Mon Sep 17 00:00:00 2001 From: Roman Yurchak Date: Thu, 6 Dec 2018 20:05:08 +0100 Subject: MAINT: Review F401,F841,F842 flake8 errors (unused variables and imports) (#12448) * Review F401,F841,F842 flake8 errors (unused variables, imports) * Review comments * More tests in test_installed_npymath_ini * Review comments --- numpy/linalg/linalg.py | 1 + numpy/linalg/tests/test_linalg.py | 5 +---- 2 files changed, 2 insertions(+), 4 deletions(-) (limited to 'numpy/linalg') diff --git a/numpy/linalg/linalg.py b/numpy/linalg/linalg.py index dc2710dc0..8363d7377 100644 --- a/numpy/linalg/linalg.py +++ b/numpy/linalg/linalg.py @@ -2205,6 +2205,7 @@ def lstsq(a, b, rcond="warn"): raise LinAlgError('Incompatible dimensions') t, result_t = _commonType(a, b) + # FIXME: real_t is unused real_t = _linalgRealType(t) result_real_t = _realType(result_t) diff --git a/numpy/linalg/tests/test_linalg.py b/numpy/linalg/tests/test_linalg.py index 905f3a549..235488c6e 100644 --- a/numpy/linalg/tests/test_linalg.py +++ b/numpy/linalg/tests/test_linalg.py @@ -13,7 +13,7 @@ import pytest import numpy as np from numpy import array, single, double, csingle, cdouble, dot, identity, matmul -from numpy import multiply, atleast_2d, inf, asarray, matrix +from numpy import multiply, atleast_2d, inf, asarray from numpy import linalg from numpy.linalg import matrix_power, norm, matrix_rank, multi_dot, LinAlgError from numpy.linalg.linalg import _multi_dot_matrix_chain_order @@ -955,7 +955,6 @@ class TestMatrixPower(object): dtnoinv = [object, np.dtype('e'), np.dtype('g'), np.dtype('G')] def test_large_power(self, dt): - power = matrix_power rshft = self.rshft_1.astype(dt) assert_equal( matrix_power(rshft, 2**100 + 2**10 + 2**5 + 0), self.rshft_0) @@ -1619,8 +1618,6 @@ class TestQR(object): def test_qr_empty(self, m, n): k = min(m, n) a = np.empty((m, n)) - a_type = type(a) - a_dtype = a.dtype self.check_qr(a) -- cgit v1.2.1