10000 Merge pull request #19102 from default-303/LGTM_unused_variables · numpy/numpy@1f95d79 · GitHub
[go: up one dir, main page]

Skip to content

Commit 1f95d79

Browse files
authored
Merge pull request #19102 from default-303/LGTM_unused_variables
MAINT: Removed suitable unused variables shown in LGTM
2 parents 1d7939e + 6ce7835 commit 1f95d79

File tree

7 files changed

+7
-25
lines changed

7 files changed

+7
-25
lines changed

numpy/core/code_generators/generate_numpy_api.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -177,9 +177,6 @@ def do_generate_api(targets, sources):
177177
numpyapi_list = genapi.get_api_functions('NUMPY_API',
178178
multiarray_funcs)
179179

180-
# FIXME: ordered_funcs_api is unused
181-
ordered_funcs_api = genapi.order_dict(multiarray_funcs)
182-
183180
# Create dict name -> *Api instance
184181
api_name = 'PyArray_API'
185182
multiarray_api_dict = {}

numpy/distutils/system_info.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1342,8 +1342,6 @@ def calc_info(self):
13421342
lapack = None
13431343
atlas_1 = None
13441344
for d in lib_dirs:
1345-
# FIXME: lapack_atlas is unused
1346-
lapack_atlas = self.check_libs2(d, ['lapack_atlas'], [])
13471345
atlas = self.check_libs2(d, atlas_libs, [])
13481346
if atlas is not None:
13491347
lib_dirs2 = [d] + self.combine_paths(d, ['atlas*', 'ATLAS*'])
@@ -3107,8 +3105,9 @@ def show_all(argv=None):
31073105
del show_only[show_only.index(name)]
31083106
conf = c()
31093107
conf.verbosity = 2
3110-
# FIXME: r not used
3111-
r = conf.get_info()
3108+
# we don't need the result, but we want
3109+
# the side effect of printing diagnostics
3110+
conf.get_info()
31123111
if show_only:
31133112
log.info('Info classes not defined: %s', ','.join(show_only))
31143113

numpy/f2py/crackfortran.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2564,10 +2564,8 @@ def get_parameters(vars, global_params={}):
25642564
v = ''.join(tt)
25652565

25662566
elif iscomplex(vars[n]):
2567-
# FIXME complex numbers may also have exponents
2568-
if v[0] == '(' and v[-1] == ')':
2569-
# FIXME, unused l looks like potential bug
2570-
l = markoutercomma(v[1:-1]).split('@,@')
2567+
outmess(f'get_parameters[TODO]: '
2568+
f'implement evaluation of complex expression {v}')
25712569

25722570
try:
25732571
params[n] = eval(v, g_params, params)
@@ -2998,7 +2996,7 @@ def expr2name(a, block, args=[]):
29982996

29992997
def analyzeargs(block):
30002998
setmesstext(block)
3001-
implicitrules, attrrules = buildimplicitrules(block)
2999+
implicitrules, _ = buildimplicitrules(block)
30023000
if 'args' not in block:
30033001
block['args'] = []
30043002
args = []

numpy/linalg/lapack_lite/fortran.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ def getDependencies(filename):
110110
for lineno, line in fortranSourceLines(fo):
111111
m = external_pat.match(line)
112112
if m:
113-
names = line = line[m.end():].strip().split(',')
113+
names = line[m.end():].strip().split(',')
114114
names = [n.strip().lower() for n in names]
115115
names = [n for n in names if n]
116116
routines.extend(names)

numpy/linalg/linalg.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -128,10 +128,6 @@ def _realType(t, default=double):
128128
def _complexType(t, default=cdouble):
129129
return _complex_types_map.get(t, default)
130130

131-
def _linalgRealType(t):
132-
"""Cast the type t to either double or cdouble."""
133-
return double
134-
135131
def _commonType(*arrays):
136132
# in lite version, use higher precision (always double or cdouble)
137133
result_type = single
@@ -2275,8 +2271,6 @@ def lstsq(a, b, rcond="warn"):
22752271
raise LinAlgError('Incom 9E7A patible dimensions')
22762272

22772273
t, result_t = _commonType(a, b)
2278-
# FIXME: real_t is unused
2279-
real_t = _linalgRealType(t)
22802274
result_real_t = _realType(result_t)
22812275

22822276
# Determine default rcond value

numpy/ma/core.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2839,11 +2839,6 @@ def __new__(cls, data=None, mask=nomask, dtype=None, copy=False,
28392839
_data = ndarray.view(_data, type(data))
28402840
else:
28412841
_data = ndarray.view(_data, cls)
2842-
# Backwards compatibility w/ numpy.core.ma.
2843-
if hasattr(data, '_mask') and not isinstance(data, ndarray):
2844-
_data._mask = data._mask
2845-
# FIXME _sharedmask is never used.
2846-
_sharedmask = True
28472842
# Process mask.
28482843
# Type of the mask
28492844
mdtype = make_mask_descr(_data.dtype)

numpy/ma/mrecords.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,6 @@ def view(self, dtype=None, type=None):
375375
try:
376376
if issubclass(dtype, ndarray):
377377
output = ndarray.view(self, dtype)
378-
dtype = None
379378
else:
380379
output = ndarray.view(self, dtype)
381380
# OK, there's the change

0 commit comments

Comments
 (0)
0