diff options
| author | default-303 <ajayds2001@gmail.com> | 2021-05-26 07:29:49 +0530 |
|---|---|---|
| committer | default-303 <ajayds2001@gmail.com> | 2021-05-26 07:29:49 +0530 |
| commit | 115ed1d8d5432ff4307d1e07819fec33bb72755c (patch) | |
| tree | 96819ebf197f11f6f1c2237daf2b6544a1923498 /numpy | |
| parent | b3e54cc7ea0808642829b9aa71fa8e51dcc6050e (diff) | |
| download | numpy-115ed1d8d5432ff4307d1e07819fec33bb72755c.tar.gz | |
MAINT: Removed suitable unused variables shown in LGTM
Diffstat (limited to 'numpy')
| -rw-r--r-- | numpy/core/code_generators/generate_numpy_api.py | 3 | ||||
| -rw-r--r-- | numpy/distutils/system_info.py | 4 | ||||
| -rwxr-xr-x | numpy/f2py/crackfortran.py | 5 | ||||
| -rw-r--r-- | numpy/lib/format.py | 1 | ||||
| -rw-r--r-- | numpy/lib/index_tricks.py | 1 | ||||
| -rw-r--r-- | numpy/linalg/lapack_lite/fortran.py | 2 | ||||
| -rw-r--r-- | numpy/linalg/linalg.py | 2 | ||||
| -rw-r--r-- | numpy/ma/core.py | 2 | ||||
| -rw-r--r-- | numpy/ma/extras.py | 1 | ||||
| -rw-r--r-- | numpy/ma/mrecords.py | 2 |
10 files changed, 2 insertions, 21 deletions
diff --git a/numpy/core/code_generators/generate_numpy_api.py b/numpy/core/code_generators/generate_numpy_api.py index 7997135bb..37975966f 100644 --- a/numpy/core/code_generators/generate_numpy_api.py +++ b/numpy/core/code_generators/generate_numpy_api.py @@ -177,9 +177,6 @@ def do_generate_api(targets, sources): numpyapi_list = genapi.get_api_functions('NUMPY_API', multiarray_funcs) - # FIXME: ordered_funcs_api is unused - ordered_funcs_api = genapi.order_dict(multiarray_funcs) - # Create dict name -> *Api instance api_name = 'PyArray_API' multiarray_api_dict = {} diff --git a/numpy/distutils/system_info.py b/numpy/distutils/system_info.py index 82e864a5c..741959aa4 100644 --- a/numpy/distutils/system_info.py +++ b/numpy/distutils/system_info.py @@ -1342,8 +1342,6 @@ class atlas_info(system_info): lapack = None atlas_1 = None for d in lib_dirs: - # FIXME: lapack_atlas is unused - lapack_atlas = self.check_libs2(d, ['lapack_atlas'], []) atlas = self.check_libs2(d, atlas_libs, []) if atlas is not None: lib_dirs2 = [d] + self.combine_paths(d, ['atlas*', 'ATLAS*']) @@ -3107,8 +3105,6 @@ def show_all(argv=None): del show_only[show_only.index(name)] conf = c() conf.verbosity = 2 - # FIXME: r not used - r = conf.get_info() if show_only: log.info('Info classes not defined: %s', ','.join(show_only)) diff --git a/numpy/f2py/crackfortran.py b/numpy/f2py/crackfortran.py index 984bd642b..eb9ce3174 100755 --- a/numpy/f2py/crackfortran.py +++ b/numpy/f2py/crackfortran.py @@ -1127,7 +1127,6 @@ def analyzeline(m, case, line): (m.group('this'), ll[:i])) ll = ll + ','.join(groupcache[groupcounter]['args']) if i < 0: - i = 0 pl = '' else: pl = ll[:i].strip() @@ -2553,8 +2552,7 @@ def get_parameters(vars, global_params={}): elif iscomplex(vars[n]): # FIXME complex numbers may also have exponents if v[0] == '(' and v[-1] == ')': - # FIXME, unused l looks like potential bug - l = markoutercomma(v[1:-1]).split('@,@') + pass try: params[n] = eval(v, g_params, params) @@ -2985,7 +2983,6 @@ def expr2name(a, block, args=[]): def analyzeargs(block): setmesstext(block) - implicitrules, attrrules = buildimplicitrules(block) if 'args' not in block: block['args'] = [] args = [] diff --git a/numpy/lib/format.py b/numpy/lib/format.py index ead6a0420..926fc2328 100644 --- a/numpy/lib/format.py +++ b/numpy/lib/format.py @@ -604,7 +604,6 @@ def _read_array_header(fp, version): raise ValueError(msg.format(d)) if EXPECTED_KEYS != d.keys(): - keys = sorted(d.keys()) msg = "Header does not contain the correct keys: {!r}" raise ValueError(msg.format(d.keys())) diff --git a/numpy/lib/index_tricks.py b/numpy/lib/index_tricks.py index 72d8e9de4..166d8677c 100644 --- a/numpy/lib/index_tricks.py +++ b/numpy/lib/index_tricks.py @@ -201,7 +201,6 @@ class nd_grid: length = int(step) if step != 1: step = (key.stop-start)/float(step-1) - stop = key.stop + step return _nx.arange(0, length, 1, float)*step + start else: return _nx.arange(start, stop, step) diff --git a/numpy/linalg/lapack_lite/fortran.py b/numpy/linalg/lapack_lite/fortran.py index 3aaefb92f..fc09f0808 100644 --- a/numpy/linalg/lapack_lite/fortran.py +++ b/numpy/linalg/lapack_lite/fortran.py @@ -110,7 +110,7 @@ def getDependencies(filename): for lineno, line in fortranSourceLines(fo): m = external_pat.match(line) if m: - names = line = line[m.end():].strip().split(',') + names = line[m.end():].strip().split(',') names = [n.strip().lower() for n in names] names = [n for n in names if n] routines.extend(names) diff --git a/numpy/linalg/linalg.py b/numpy/linalg/linalg.py index 46fb2502e..37237ab19 100644 --- a/numpy/linalg/linalg.py +++ b/numpy/linalg/linalg.py @@ -2275,8 +2275,6 @@ 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) # Determine default rcond value diff --git a/numpy/ma/core.py b/numpy/ma/core.py index 4c204cac2..fdc7f9e83 100644 --- a/numpy/ma/core.py +++ b/numpy/ma/core.py @@ -2842,8 +2842,6 @@ class MaskedArray(ndarray): # Backwards compatibility w/ numpy.core.ma. if hasattr(data, '_mask') and not isinstance(data, ndarray): _data._mask = data._mask - # FIXME _sharedmask is never used. - _sharedmask = True # Process mask. # Type of the mask mdtype = make_mask_descr(_data.dtype) diff --git a/numpy/ma/extras.py b/numpy/ma/extras.py index c139f4640..73abfc296 100644 --- a/numpy/ma/extras.py +++ b/numpy/ma/extras.py @@ -743,7 +743,6 @@ def _median(a, axis=None, out=None, overwrite_input=False): return np.ma.mean(asorted[indexer], axis=axis, out=out) if asorted.ndim == 1: - counts = count(asorted) idx, odd = divmod(count(asorted), 2) mid = asorted[idx + odd - 1:idx + 1] if np.issubdtype(asorted.dtype, np.inexact) and asorted.size > 0: diff --git a/numpy/ma/mrecords.py b/numpy/ma/mrecords.py index 9ea4e4e36..6814931b0 100644 --- a/numpy/ma/mrecords.py +++ b/numpy/ma/mrecords.py @@ -129,7 +129,6 @@ class MaskedRecords(MaskedArray): msg = "Mask and data not compatible: data size is %i, " + \ "mask size is %i." raise MAError(msg % (nd, nm)) - copy = True if not keep_mask: self.__setmask__(mask) self._sharedmask = True @@ -376,7 +375,6 @@ class MaskedRecords(MaskedArray): try: if issubclass(dtype, ndarray): output = ndarray.view(self, dtype) - dtype = None else: output = ndarray.view(self, dtype) # OK, there's the change |
