The following issues were found

numpy/fft/helper.py
12 issues
Unused argument 'axes'
Error

Line: 15 Column: 29

              integer_types = (int, integer)


def _fftshift_dispatcher(x, axes=None):
    return (x,)


@array_function_dispatch(_fftshift_dispatcher, module='numpy.fft')
def fftshift(x, axes=None):

            

Reported by Pylint.

Argument name "x" doesn't conform to snake_case naming style
Error

Line: 15 Column: 1

              integer_types = (int, integer)


def _fftshift_dispatcher(x, axes=None):
    return (x,)


@array_function_dispatch(_fftshift_dispatcher, module='numpy.fft')
def fftshift(x, axes=None):

            

Reported by Pylint.

Argument name "x" doesn't conform to snake_case naming style
Error

Line: 20 Column: 1

              

@array_function_dispatch(_fftshift_dispatcher, module='numpy.fft')
def fftshift(x, axes=None):
    """
    Shift the zero-frequency component to the center of the spectrum.

    This function swaps half-spaces for all axes listed (defaults to all).
    Note that ``y[0]`` is the Nyquist component only if ``len(x)`` is even.

            

Reported by Pylint.

Argument name "x" doesn't conform to snake_case naming style
Error

Line: 77 Column: 1

              

@array_function_dispatch(_fftshift_dispatcher, module='numpy.fft')
def ifftshift(x, axes=None):
    """
    The inverse of `fftshift`. Although identical for even-length `x`, the
    functions differ by one sample for odd-length `x`.

    Parameters

            

Reported by Pylint.

Argument name "d" doesn't conform to snake_case naming style
Error

Line: 124 Column: 1

              

@set_module('numpy.fft')
def fftfreq(n, d=1.0):
    """
    Return the Discrete Fourier Transform sample frequencies.

    The returned float array `f` contains the frequency bin centers in cycles
    per unit of the sample spacing (with zero at the start).  For instance, if

            

Reported by Pylint.

Argument name "n" doesn't conform to snake_case naming style
Error

Line: 124 Column: 1

              

@set_module('numpy.fft')
def fftfreq(n, d=1.0):
    """
    Return the Discrete Fourier Transform sample frequencies.

    The returned float array `f` contains the frequency bin centers in cycles
    per unit of the sample spacing (with zero at the start).  For instance, if

            

Reported by Pylint.

Variable name "N" doesn't conform to snake_case naming style
Error

Line: 164 Column: 5

                      raise ValueError("n should be an integer")
    val = 1.0 / (n * d)
    results = empty(n, int)
    N = (n-1)//2 + 1
    p1 = arange(0, N, dtype=int)
    results[:N] = p1
    p2 = arange(-(n//2), 0, dtype=int)
    results[N:] = p2
    return results * val

            

Reported by Pylint.

Variable name "p1" doesn't conform to snake_case naming style
Error

Line: 165 Column: 5

                  val = 1.0 / (n * d)
    results = empty(n, int)
    N = (n-1)//2 + 1
    p1 = arange(0, N, dtype=int)
    results[:N] = p1
    p2 = arange(-(n//2), 0, dtype=int)
    results[N:] = p2
    return results * val


            

Reported by Pylint.

Variable name "p2" doesn't conform to snake_case naming style
Error

Line: 167 Column: 5

                  N = (n-1)//2 + 1
    p1 = arange(0, N, dtype=int)
    results[:N] = p1
    p2 = arange(-(n//2), 0, dtype=int)
    results[N:] = p2
    return results * val


@set_module('numpy.fft')

            

Reported by Pylint.

Argument name "d" doesn't conform to snake_case naming style
Error

Line: 173 Column: 1

              

@set_module('numpy.fft')
def rfftfreq(n, d=1.0):
    """
    Return the Discrete Fourier Transform sample frequencies
    (for usage with rfft, irfft).

    The returned float array `f` contains the frequency bin centers in cycles

            

Reported by Pylint.

doc/example.py
12 issues
Unable to import 'my_module'
Error

Line: 34 Column: 1

              # be able to paste and execute docstrings after importing only the
# numpy module itself, unabbreviated.

from my_module import my_func, other_func

def foo(var1, var2, long_var_name='hi'):
    r"""A one-line summary that does not use variable names or the
    function name.


            

Reported by Pylint.

Unused import os
Error

Line: 11 Column: 1

              a line by itself, preferably preceded by a blank line.

"""
import os # standard library imports first

# Do NOT import using *, e.g. from numpy import *
#
# Import the module using
#

            

Reported by Pylint.

Unused numpy imported as np
Error

Line: 26 Column: 1

              # If you prefer the use of abbreviated module names, we suggest the
# convention used by NumPy itself::

import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt

# These abbreviated names are not to be used in docstrings; users must
# be able to paste and execute docstrings after importing only the

            

Reported by Pylint.

Unused matplotlib imported as mpl
Error

Line: 27 Column: 1

              # convention used by NumPy itself::

import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt

# These abbreviated names are not to be used in docstrings; users must
# be able to paste and execute docstrings after importing only the
# numpy module itself, unabbreviated.

            

Reported by Pylint.

Unused matplotlib.pyplot imported as plt
Error

Line: 28 Column: 1

              
import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt

# These abbreviated names are not to be used in docstrings; users must
# be able to paste and execute docstrings after importing only the
# numpy module itself, unabbreviated.


            

Reported by Pylint.

Unused my_func imported from my_module
Error

Line: 34 Column: 1

              # be able to paste and execute docstrings after importing only the
# numpy module itself, unabbreviated.

from my_module import my_func, other_func

def foo(var1, var2, long_var_name='hi'):
    r"""A one-line summary that does not use variable names or the
    function name.


            

Reported by Pylint.

Unused other_func imported from my_module
Error

Line: 34 Column: 1

              # be able to paste and execute docstrings after importing only the
# numpy module itself, unabbreviated.

from my_module import my_func, other_func

def foo(var1, var2, long_var_name='hi'):
    r"""A one-line summary that does not use variable names or the
    function name.


            

Reported by Pylint.

Unused argument 'long_var_name'
Error

Line: 36 Column: 21

              
from my_module import my_func, other_func

def foo(var1, var2, long_var_name='hi'):
    r"""A one-line summary that does not use variable names or the
    function name.

    Several sentences providing an extended description. Refer to
    variables using back-ticks, e.g. `var`.

            

Reported by Pylint.

Unused argument 'var2'
Error

Line: 36 Column: 15

              
from my_module import my_func, other_func

def foo(var1, var2, long_var_name='hi'):
    r"""A one-line summary that does not use variable names or the
    function name.

    Several sentences providing an extended description. Refer to
    variables using back-ticks, e.g. `var`.

            

Reported by Pylint.

Unused argument 'var1'
Error

Line: 36 Column: 9

              
from my_module import my_func, other_func

def foo(var1, var2, long_var_name='hi'):
    r"""A one-line summary that does not use variable names or the
    function name.

    Several sentences providing an extended description. Refer to
    variables using back-ticks, e.g. `var`.

            

Reported by Pylint.

numpy/typing/tests/data/fail/modules.py
12 issues
Module 'numpy.testing' has no 'bob' member
Error

Line: 3 Column: 1

              import numpy as np

np.testing.bob  # E: Module has no attribute
np.bob  # E: Module has no attribute

# Stdlib modules in the namespace by accident
np.warnings  # E: Module has no attribute
np.sys  # E: Module has no attribute
np.os  # E: Module has no attribute

            

Reported by Pylint.

Statement seems to have no effect
Error

Line: 3 Column: 1

              import numpy as np

np.testing.bob  # E: Module has no attribute
np.bob  # E: Module has no attribute

# Stdlib modules in the namespace by accident
np.warnings  # E: Module has no attribute
np.sys  # E: Module has no attribute
np.os  # E: Module has no attribute

            

Reported by Pylint.

Statement seems to have no effect
Error

Line: 4 Column: 1

              import numpy as np

np.testing.bob  # E: Module has no attribute
np.bob  # E: Module has no attribute

# Stdlib modules in the namespace by accident
np.warnings  # E: Module has no attribute
np.sys  # E: Module has no attribute
np.os  # E: Module has no attribute

            

Reported by Pylint.

Statement seems to have no effect
Error

Line: 7 Column: 1

              np.bob  # E: Module has no attribute

# Stdlib modules in the namespace by accident
np.warnings  # E: Module has no attribute
np.sys  # E: Module has no attribute
np.os  # E: Module has no attribute
np.math  # E: Module has no attribute

# Public sub-modules that are not imported to their parent module by default;

            

Reported by Pylint.

Statement seems to have no effect
Error

Line: 8 Column: 1

              
# Stdlib modules in the namespace by accident
np.warnings  # E: Module has no attribute
np.sys  # E: Module has no attribute
np.os  # E: Module has no attribute
np.math  # E: Module has no attribute

# Public sub-modules that are not imported to their parent module by default;
# e.g. one must first execute `import numpy.lib.recfunctions`

            

Reported by Pylint.

Statement seems to have no effect
Error

Line: 9 Column: 1

              # Stdlib modules in the namespace by accident
np.warnings  # E: Module has no attribute
np.sys  # E: Module has no attribute
np.os  # E: Module has no attribute
np.math  # E: Module has no attribute

# Public sub-modules that are not imported to their parent module by default;
# e.g. one must first execute `import numpy.lib.recfunctions`
np.lib.recfunctions  # E: Module has no attribute

            

Reported by Pylint.

Statement seems to have no effect
Error

Line: 10 Column: 1

              np.warnings  # E: Module has no attribute
np.sys  # E: Module has no attribute
np.os  # E: Module has no attribute
np.math  # E: Module has no attribute

# Public sub-modules that are not imported to their parent module by default;
# e.g. one must first execute `import numpy.lib.recfunctions`
np.lib.recfunctions  # E: Module has no attribute


            

Reported by Pylint.

Statement seems to have no effect
Error

Line: 14 Column: 1

              
# Public sub-modules that are not imported to their parent module by default;
# e.g. one must first execute `import numpy.lib.recfunctions`
np.lib.recfunctions  # E: Module has no attribute

np.__NUMPY_SETUP__  # E: Module has no attribute
np.__deprecated_attrs__  # E: Module has no attribute
np.__expired_functions__  # E: Module has no attribute

            

Reported by Pylint.

Statement seems to have no effect
Error

Line: 16 Column: 1

              # e.g. one must first execute `import numpy.lib.recfunctions`
np.lib.recfunctions  # E: Module has no attribute

np.__NUMPY_SETUP__  # E: Module has no attribute
np.__deprecated_attrs__  # E: Module has no attribute
np.__expired_functions__  # E: Module has no attribute

            

Reported by Pylint.

Statement seems to have no effect
Error

Line: 17 Column: 1

              np.lib.recfunctions  # E: Module has no attribute

np.__NUMPY_SETUP__  # E: Module has no attribute
np.__deprecated_attrs__  # E: Module has no attribute
np.__expired_functions__  # E: Module has no attribute

            

Reported by Pylint.

numpy/typing/tests/data/reveal/arrayprint.py
11 issues
Value 'np.ndarray' is unsubscriptable
Error

Line: 4 Column: 5

              from typing import Any, Callable
import numpy as np

AR: np.ndarray[Any, Any]
func_float: Callable[[np.floating[Any]], str]
func_int: Callable[[np.integer[Any]], str]

reveal_type(np.get_printoptions())  # E: TypedDict
reveal_type(np.array2string(  # E: str

            

Reported by Pylint.

Value 'np.floating' is unsubscriptable
Error

Line: 5 Column: 23

              import numpy as np

AR: np.ndarray[Any, Any]
func_float: Callable[[np.floating[Any]], str]
func_int: Callable[[np.integer[Any]], str]

reveal_type(np.get_printoptions())  # E: TypedDict
reveal_type(np.array2string(  # E: str
    AR, formatter={'float_kind': func_float, 'int_kind': func_int}

            

Reported by Pylint.

Undefined variable 'reveal_type'
Error

Line: 8 Column: 1

              func_float: Callable[[np.floating[Any]], str]
func_int: Callable[[np.integer[Any]], str]

reveal_type(np.get_printoptions())  # E: TypedDict
reveal_type(np.array2string(  # E: str
    AR, formatter={'float_kind': func_float, 'int_kind': func_int}
))
reveal_type(np.format_float_scientific(1.0))  # E: str
reveal_type(np.format_float_positional(1))  # E: str

            

Reported by Pylint.

Undefined variable 'reveal_type'
Error

Line: 9 Column: 1

              func_int: Callable[[np.integer[Any]], str]

reveal_type(np.get_printoptions())  # E: TypedDict
reveal_type(np.array2string(  # E: str
    AR, formatter={'float_kind': func_float, 'int_kind': func_int}
))
reveal_type(np.format_float_scientific(1.0))  # E: str
reveal_type(np.format_float_positional(1))  # E: str
reveal_type(np.array_repr(AR))  # E: str

            

Reported by Pylint.

Undefined variable 'reveal_type'
Error

Line: 12 Column: 1

              reveal_type(np.array2string(  # E: str
    AR, formatter={'float_kind': func_float, 'int_kind': func_int}
))
reveal_type(np.format_float_scientific(1.0))  # E: str
reveal_type(np.format_float_positional(1))  # E: str
reveal_type(np.array_repr(AR))  # E: str
reveal_type(np.array_str(AR))  # E: str

reveal_type(np.printoptions())  # E: contextlib._GeneratorContextManager

            

Reported by Pylint.

Undefined variable 'reveal_type'
Error

Line: 13 Column: 1

                  AR, formatter={'float_kind': func_float, 'int_kind': func_int}
))
reveal_type(np.format_float_scientific(1.0))  # E: str
reveal_type(np.format_float_positional(1))  # E: str
reveal_type(np.array_repr(AR))  # E: str
reveal_type(np.array_str(AR))  # E: str

reveal_type(np.printoptions())  # E: contextlib._GeneratorContextManager
with np.printoptions() as dct:

            

Reported by Pylint.

Undefined variable 'reveal_type'
Error

Line: 14 Column: 1

              ))
reveal_type(np.format_float_scientific(1.0))  # E: str
reveal_type(np.format_float_positional(1))  # E: str
reveal_type(np.array_repr(AR))  # E: str
reveal_type(np.array_str(AR))  # E: str

reveal_type(np.printoptions())  # E: contextlib._GeneratorContextManager
with np.printoptions() as dct:
    reveal_type(dct)  # E: TypedDict

            

Reported by Pylint.

Undefined variable 'reveal_type'
Error

Line: 15 Column: 1

              reveal_type(np.format_float_scientific(1.0))  # E: str
reveal_type(np.format_float_positional(1))  # E: str
reveal_type(np.array_repr(AR))  # E: str
reveal_type(np.array_str(AR))  # E: str

reveal_type(np.printoptions())  # E: contextlib._GeneratorContextManager
with np.printoptions() as dct:
    reveal_type(dct)  # E: TypedDict

            

Reported by Pylint.

Undefined variable 'reveal_type'
Error

Line: 17 Column: 1

              reveal_type(np.array_repr(AR))  # E: str
reveal_type(np.array_str(AR))  # E: str

reveal_type(np.printoptions())  # E: contextlib._GeneratorContextManager
with np.printoptions() as dct:
    reveal_type(dct)  # E: TypedDict

            

Reported by Pylint.

Undefined variable 'reveal_type'
Error

Line: 19 Column: 5

              
reveal_type(np.printoptions())  # E: contextlib._GeneratorContextManager
with np.printoptions() as dct:
    reveal_type(dct)  # E: TypedDict

            

Reported by Pylint.

numpy/distutils/fcompiler/vast.py
11 issues
Method 'find_library_file' is abstract in class 'CCompiler' but is not overridden
Error

Line: 7 Column: 1

              
compilers = ['VastFCompiler']

class VastFCompiler(GnuFCompiler):
    compiler_type = 'vast'
    compiler_aliases = ()
    description = 'Pacific-Sierra Research Fortran 90 Compiler'
    version_pattern = (r'\s*Pacific-Sierra Research vf90 '
                       r'(Personal|Professional)\s+(?P<version>[^\s]*)')

            

Reported by Pylint.

Method 'wrap_unlinkable_objects' is abstract in class 'FCompiler' but is not overridden
Error

Line: 7 Column: 1

              
compilers = ['VastFCompiler']

class VastFCompiler(GnuFCompiler):
    compiler_type = 'vast'
    compiler_aliases = ()
    description = 'Pacific-Sierra Research Fortran 90 Compiler'
    version_pattern = (r'\s*Pacific-Sierra Research vf90 '
                       r'(Personal|Professional)\s+(?P<version>[^\s]*)')

            

Reported by Pylint.

XXX Fix me
Error

Line: 27 Column: 2

                      'archiver'     : ["ar", "-cr"],
        'ranlib'       : ["ranlib"]
        }
    module_dir_switch = None  #XXX Fix me
    module_include_switch = None #XXX Fix me

    def find_executables(self):
        pass


            

Reported by Pylint.

XXX Fix me
Error

Line: 28 Column: 2

                      'ranlib'       : ["ranlib"]
        }
    module_dir_switch = None  #XXX Fix me
    module_include_switch = None #XXX Fix me

    def find_executables(self):
        pass

    def get_version_cmd(self):

            

Reported by Pylint.

Attribute 'version' defined outside __init__
Error

Line: 43 Column: 9

                      vast_version = self.get_version()
        gnu = GnuFCompiler()
        gnu.customize(None)
        self.version = gnu.get_version()
        opt = GnuFCompiler.get_flags_arch(self)
        self.version = vast_version
        return opt

if __name__ == '__main__':

            

Reported by Pylint.

Attribute 'version' defined outside __init__
Error

Line: 45 Column: 9

                      gnu.customize(None)
        self.version = gnu.get_version()
        opt = GnuFCompiler.get_flags_arch(self)
        self.version = vast_version
        return opt

if __name__ == '__main__':
    from distutils import log
    log.set_verbosity(2)

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              import os

from numpy.distutils.fcompiler.gnu import GnuFCompiler

compilers = ['VastFCompiler']

class VastFCompiler(GnuFCompiler):
    compiler_type = 'vast'
    compiler_aliases = ()

            

Reported by Pylint.

Missing class docstring
Error

Line: 7 Column: 1

              
compilers = ['VastFCompiler']

class VastFCompiler(GnuFCompiler):
    compiler_type = 'vast'
    compiler_aliases = ()
    description = 'Pacific-Sierra Research Fortran 90 Compiler'
    version_pattern = (r'\s*Pacific-Sierra Research vf90 '
                       r'(Personal|Professional)\s+(?P<version>[^\s]*)')

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 33 Column: 5

                  def find_executables(self):
        pass

    def get_version_cmd(self):
        f90 = self.compiler_f90[0]
        d, b = os.path.split(f90)
        vf90 = os.path.join(d, 'v'+b)
        return vf90


            

Reported by Pylint.

Variable name "b" doesn't conform to snake_case naming style
Error

Line: 35 Column: 12

              
    def get_version_cmd(self):
        f90 = self.compiler_f90[0]
        d, b = os.path.split(f90)
        vf90 = os.path.join(d, 'v'+b)
        return vf90

    def get_flags_arch(self):
        vast_version = self.get_version()

            

Reported by Pylint.

numpy/ma/tests/test_deprecations.py
11 issues
Method could be a function
Error

Line: 11 Column: 5

              
class TestArgsort:
    """ gh-8701 """
    def _test_base(self, argsort, cls):
        arr_0d = np.array(1).view(cls)
        argsort(arr_0d)

        arr_1d = np.array([1, 2, 3]).view(cls)
        argsort(arr_1d)

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 28 Column: 5

                      argsort(arr_2d, axis=None)
        argsort(arr_2d, axis=-1)

    def test_function_ndarray(self):
        return self._test_base(np.ma.argsort, np.ndarray)

    def test_function_maskedarray(self):
        return self._test_base(np.ma.argsort, np.ma.MaskedArray)


            

Reported by Pylint.

Missing function or method docstring
Error

Line: 31 Column: 5

                  def test_function_ndarray(self):
        return self._test_base(np.ma.argsort, np.ndarray)

    def test_function_maskedarray(self):
        return self._test_base(np.ma.argsort, np.ma.MaskedArray)

    def test_method(self):
        return self._test_base(np.ma.MaskedArray.argsort, np.ma.MaskedArray)


            

Reported by Pylint.

Missing function or method docstring
Error

Line: 34 Column: 5

                  def test_function_maskedarray(self):
        return self._test_base(np.ma.argsort, np.ma.MaskedArray)

    def test_method(self):
        return self._test_base(np.ma.MaskedArray.argsort, np.ma.MaskedArray)


class TestMinimumMaximum:
    def test_minimum(self):

            

Reported by Pylint.

Missing class docstring
Error

Line: 38 Column: 1

                      return self._test_base(np.ma.MaskedArray.argsort, np.ma.MaskedArray)


class TestMinimumMaximum:
    def test_minimum(self):
        assert_warns(DeprecationWarning, np.ma.minimum, np.ma.array([1, 2]))

    def test_maximum(self):
        assert_warns(DeprecationWarning, np.ma.maximum, np.ma.array([1, 2]))

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 39 Column: 5

              

class TestMinimumMaximum:
    def test_minimum(self):
        assert_warns(DeprecationWarning, np.ma.minimum, np.ma.array([1, 2]))

    def test_maximum(self):
        assert_warns(DeprecationWarning, np.ma.maximum, np.ma.array([1, 2]))


            

Reported by Pylint.

Method could be a function
Error

Line: 39 Column: 5

              

class TestMinimumMaximum:
    def test_minimum(self):
        assert_warns(DeprecationWarning, np.ma.minimum, np.ma.array([1, 2]))

    def test_maximum(self):
        assert_warns(DeprecationWarning, np.ma.maximum, np.ma.array([1, 2]))


            

Reported by Pylint.

Missing function or method docstring
Error

Line: 42 Column: 5

                  def test_minimum(self):
        assert_warns(DeprecationWarning, np.ma.minimum, np.ma.array([1, 2]))

    def test_maximum(self):
        assert_warns(DeprecationWarning, np.ma.maximum, np.ma.array([1, 2]))

    def test_axis_default(self):
        # NumPy 1.13, 2017-05-06


            

Reported by Pylint.

Method could be a function
Error

Line: 42 Column: 5

                  def test_minimum(self):
        assert_warns(DeprecationWarning, np.ma.minimum, np.ma.array([1, 2]))

    def test_maximum(self):
        assert_warns(DeprecationWarning, np.ma.maximum, np.ma.array([1, 2]))

    def test_axis_default(self):
        # NumPy 1.13, 2017-05-06


            

Reported by Pylint.

Missing function or method docstring
Error

Line: 45 Column: 5

                  def test_maximum(self):
        assert_warns(DeprecationWarning, np.ma.maximum, np.ma.array([1, 2]))

    def test_axis_default(self):
        # NumPy 1.13, 2017-05-06

        data1d = np.ma.arange(6)
        data2d = data1d.reshape(2, 3)


            

Reported by Pylint.

numpy/typing/_scalars.py
11 issues
Missing module docstring
Error

Line: 1 Column: 1

              from typing import Union, Tuple, Any

import numpy as np

# NOTE: `_StrLike_co` and `_BytesLike_co` are pointless, as `np.str_` and
# `np.bytes_` are already subclasses of their builtin counterpart

_CharLike_co = Union[str, bytes]


            

Reported by Pylint.

Class name "_CharLike_co" doesn't conform to PascalCase naming style
Error

Line: 8 Column: 1

              # NOTE: `_StrLike_co` and `_BytesLike_co` are pointless, as `np.str_` and
# `np.bytes_` are already subclasses of their builtin counterpart

_CharLike_co = Union[str, bytes]

# The 6 `<X>Like_co` type-aliases below represent all scalars that can be
# coerced into `<X>` (with the casting rule `same_kind`)
_BoolLike_co = Union[bool, np.bool_]
_UIntLike_co = Union[_BoolLike_co, np.unsignedinteger]

            

Reported by Pylint.

Class name "_BoolLike_co" doesn't conform to PascalCase naming style
Error

Line: 12 Column: 1

              
# The 6 `<X>Like_co` type-aliases below represent all scalars that can be
# coerced into `<X>` (with the casting rule `same_kind`)
_BoolLike_co = Union[bool, np.bool_]
_UIntLike_co = Union[_BoolLike_co, np.unsignedinteger]
_IntLike_co = Union[_BoolLike_co, int, np.integer]
_FloatLike_co = Union[_IntLike_co, float, np.floating]
_ComplexLike_co = Union[_FloatLike_co, complex, np.complexfloating]
_TD64Like_co = Union[_IntLike_co, np.timedelta64]

            

Reported by Pylint.

Class name "_UIntLike_co" doesn't conform to PascalCase naming style
Error

Line: 13 Column: 1

              # The 6 `<X>Like_co` type-aliases below represent all scalars that can be
# coerced into `<X>` (with the casting rule `same_kind`)
_BoolLike_co = Union[bool, np.bool_]
_UIntLike_co = Union[_BoolLike_co, np.unsignedinteger]
_IntLike_co = Union[_BoolLike_co, int, np.integer]
_FloatLike_co = Union[_IntLike_co, float, np.floating]
_ComplexLike_co = Union[_FloatLike_co, complex, np.complexfloating]
_TD64Like_co = Union[_IntLike_co, np.timedelta64]


            

Reported by Pylint.

Class name "_IntLike_co" doesn't conform to PascalCase naming style
Error

Line: 14 Column: 1

              # coerced into `<X>` (with the casting rule `same_kind`)
_BoolLike_co = Union[bool, np.bool_]
_UIntLike_co = Union[_BoolLike_co, np.unsignedinteger]
_IntLike_co = Union[_BoolLike_co, int, np.integer]
_FloatLike_co = Union[_IntLike_co, float, np.floating]
_ComplexLike_co = Union[_FloatLike_co, complex, np.complexfloating]
_TD64Like_co = Union[_IntLike_co, np.timedelta64]

_NumberLike_co = Union[int, float, complex, np.number, np.bool_]

            

Reported by Pylint.

Class name "_FloatLike_co" doesn't conform to PascalCase naming style
Error

Line: 15 Column: 1

              _BoolLike_co = Union[bool, np.bool_]
_UIntLike_co = Union[_BoolLike_co, np.unsignedinteger]
_IntLike_co = Union[_BoolLike_co, int, np.integer]
_FloatLike_co = Union[_IntLike_co, float, np.floating]
_ComplexLike_co = Union[_FloatLike_co, complex, np.complexfloating]
_TD64Like_co = Union[_IntLike_co, np.timedelta64]

_NumberLike_co = Union[int, float, complex, np.number, np.bool_]
_ScalarLike_co = Union[

            

Reported by Pylint.

Class name "_ComplexLike_co" doesn't conform to PascalCase naming style
Error

Line: 16 Column: 1

              _UIntLike_co = Union[_BoolLike_co, np.unsignedinteger]
_IntLike_co = Union[_BoolLike_co, int, np.integer]
_FloatLike_co = Union[_IntLike_co, float, np.floating]
_ComplexLike_co = Union[_FloatLike_co, complex, np.complexfloating]
_TD64Like_co = Union[_IntLike_co, np.timedelta64]

_NumberLike_co = Union[int, float, complex, np.number, np.bool_]
_ScalarLike_co = Union[
    int,

            

Reported by Pylint.

Class name "_TD64Like_co" doesn't conform to PascalCase naming style
Error

Line: 17 Column: 1

              _IntLike_co = Union[_BoolLike_co, int, np.integer]
_FloatLike_co = Union[_IntLike_co, float, np.floating]
_ComplexLike_co = Union[_FloatLike_co, complex, np.complexfloating]
_TD64Like_co = Union[_IntLike_co, np.timedelta64]

_NumberLike_co = Union[int, float, complex, np.number, np.bool_]
_ScalarLike_co = Union[
    int,
    float,

            

Reported by Pylint.

Class name "_NumberLike_co" doesn't conform to PascalCase naming style
Error

Line: 19 Column: 1

              _ComplexLike_co = Union[_FloatLike_co, complex, np.complexfloating]
_TD64Like_co = Union[_IntLike_co, np.timedelta64]

_NumberLike_co = Union[int, float, complex, np.number, np.bool_]
_ScalarLike_co = Union[
    int,
    float,
    complex,
    str,

            

Reported by Pylint.

Class name "_ScalarLike_co" doesn't conform to PascalCase naming style
Error

Line: 20 Column: 1

              _TD64Like_co = Union[_IntLike_co, np.timedelta64]

_NumberLike_co = Union[int, float, complex, np.number, np.bool_]
_ScalarLike_co = Union[
    int,
    float,
    complex,
    str,
    bytes,

            

Reported by Pylint.

tools/changelog.py
11 issues
Unable to import 'github'
Error

Line: 41 Column: 1

              import sys
import re
from git import Repo
from github import Github

if sys.version_info[:2] < (3, 6):
    raise RuntimeError("Python version must be >= 3.6")

this_repo = Repo(os.path.join(os.path.dirname(__file__), ".."))

            

Reported by Pylint.

Unused variable 'cur_release'
Error

Line: 61 Column: 18

              

def get_authors(revision_range):
    lst_release, cur_release = [r.strip() for r in revision_range.split('..')]
    authors_pat = r'^.*\t(.*)$'

    # authors and co-authors in current and previous releases.
    grp1 = '--group=author'
    grp2 = '--group=trailer:co-authored-by'

            

Reported by Pylint.

Unused variable 'cur_release'
Error

Line: 114 Column: 18

              

def main(token, revision_range):
    lst_release, cur_release = [r.strip() for r in revision_range.split('..')]

    github = Github(token)
    github_repo = github.get_repo('numpy/numpy')

    # document authors

            

Reported by Pylint.

Unused variable 'lst_release'
Error

Line: 114 Column: 5

              

def main(token, revision_range):
    lst_release, cur_release = [r.strip() for r in revision_range.split('..')]

    github = Github(token)
    github_repo = github.get_repo('numpy/numpy')

    # document authors

            

Reported by Pylint.

Constant name "author_msg" doesn't conform to UPPER_CASE naming style
Error

Line: 48 Column: 1

              
this_repo = Repo(os.path.join(os.path.dirname(__file__), ".."))

author_msg =\
"""
A total of %d people contributed to this release.  People with a "+" by their
names contributed a patch for the first time.
"""


            

Reported by Pylint.

Constant name "pull_request_msg" doesn't conform to UPPER_CASE naming style
Error

Line: 54 Column: 1

              names contributed a patch for the first time.
"""

pull_request_msg =\
"""
A total of %d pull requests were merged for this release.
"""



            

Reported by Pylint.

Missing function or method docstring
Error

Line: 60 Column: 1

              """


def get_authors(revision_range):
    lst_release, cur_release = [r.strip() for r in revision_range.split('..')]
    authors_pat = r'^.*\t(.*)$'

    # authors and co-authors in current and previous releases.
    grp1 = '--group=author'

            

Reported by Pylint.

Unnecessary use of a comprehension
Error

Line: 82 Column: 1

              
    # Append '+' to new authors.
    authors_new = [s + ' +' for s in authors_cur - authors_pre]
    authors_old = [s for s in authors_cur & authors_pre]
    authors = authors_new + authors_old
    authors.sort()
    return authors



            

Reported by Pylint.

Missing function or method docstring
Error

Line: 88 Column: 1

                  return authors


def get_pull_requests(repo, revision_range):
    prnums = []

    # From regular merges
    merges = this_repo.git.log(
        '--oneline', '--merges', revision_range)

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 113 Column: 1

                  return prs


def main(token, revision_range):
    lst_release, cur_release = [r.strip() for r in revision_range.split('..')]

    github = Github(token)
    github_repo = github.get_repo('numpy/numpy')


            

Reported by Pylint.

numpy/_pytesttester.py
11 issues
Unable to import 'pytest'
Error

Line: 128 Column: 9

                      True

        """
        import pytest
        import warnings

        module = sys.modules[self.module_name]
        module_path = os.path.abspath(module.__path__[0])


            

Reported by Pylint.

Access to a protected member _opt_info of a client class
Error

Line: 43 Column: 12

                  print("NumPy version %s" % np.__version__)
    relaxed_strides = np.ones((10, 1), order="C").flags.f_contiguous
    print("NumPy relaxed strides checking option:", relaxed_strides)
    info = np.lib.utils._opt_info()
    print("NumPy CPU features: ", (info if info else 'nothing enabled'))



class PytestTester:

            

Reported by Pylint.

Unused cpuinfo imported from numpy.distutils
Error

Line: 145 Column: 13

                      # so fetch module for suppression here.
        with warnings.catch_warnings():
            warnings.simplefilter("always")
            from numpy.distutils import cpuinfo

        # Filter out annoying import messages. Want these in both develop and
        # release mode.
        pytest_args += [
            "-W ignore:Not importing directory",

            

Reported by Pylint.

Import outside toplevel (numpy)
Error

Line: 38 Column: 5

              

def _show_numpy_info():
    import numpy as np

    print("NumPy version %s" % np.__version__)
    relaxed_strides = np.ones((10, 1), order="C").flags.f_contiguous
    print("NumPy relaxed strides checking option:", relaxed_strides)
    info = np.lib.utils._opt_info()

            

Reported by Pylint.

Too few public methods (1/2)
Error

Line: 48 Column: 1

              


class PytestTester:
    """
    Pytest test runner.

    A test function is typically added to a package's __init__.py like so::


            

Reported by Pylint.

Too many local variables (17/15)
Error

Line: 81 Column: 5

                  def __init__(self, module_name):
        self.module_name = module_name

    def __call__(self, label='fast', verbose=1, extra_argv=None,
                 doctests=False, coverage=False, durations=-1, tests=None):
        """
        Run tests for module using pytest.

        Parameters

            

Reported by Pylint.

Too many arguments (8/5)
Error

Line: 81 Column: 5

                  def __init__(self, module_name):
        self.module_name = module_name

    def __call__(self, label='fast', verbose=1, extra_argv=None,
                 doctests=False, coverage=False, durations=-1, tests=None):
        """
        Run tests for module using pytest.

        Parameters

            

Reported by Pylint.

Import outside toplevel (pytest)
Error

Line: 128 Column: 9

                      True

        """
        import pytest
        import warnings

        module = sys.modules[self.module_name]
        module_path = os.path.abspath(module.__path__[0])


            

Reported by Pylint.

Import outside toplevel (warnings)
Error

Line: 129 Column: 9

              
        """
        import pytest
        import warnings

        module = sys.modules[self.module_name]
        module_path = os.path.abspath(module.__path__[0])

        # setup the pytest arguments

            

Reported by Pylint.

Import outside toplevel (numpy.distutils.cpuinfo)
Error

Line: 145 Column: 13

                      # so fetch module for suppression here.
        with warnings.catch_warnings():
            warnings.simplefilter("always")
            from numpy.distutils import cpuinfo

        # Filter out annoying import messages. Want these in both develop and
        # release mode.
        pytest_args += [
            "-W ignore:Not importing directory",

            

Reported by Pylint.

numpy/distutils/fcompiler/pg.py
11 issues
Method 'find_library_file' is abstract in class 'CCompiler' but is not overridden
Error

Line: 11 Column: 1

              compilers = ['PGroupFCompiler', 'PGroupFlangCompiler']


class PGroupFCompiler(FCompiler):

    compiler_type = 'pg'
    description = 'Portland Group Fortran Compiler'
    version_pattern = r'\s*pg(f77|f90|hpf|fortran) (?P<version>[\d.-]+).*'


            

Reported by Pylint.

Method 'wrap_unlinkable_objects' is abstract in class 'FCompiler' but is not overridden
Error

Line: 11 Column: 1

              compilers = ['PGroupFCompiler', 'PGroupFlangCompiler']


class PGroupFCompiler(FCompiler):

    compiler_type = 'pg'
    description = 'Portland Group Fortran Compiler'
    version_pattern = r'\s*pg(f77|f90|hpf|fortran) (?P<version>[\d.-]+).*'


            

Reported by Pylint.

Redefining built-in 'dir'
Error

Line: 61 Column: 42

                      def get_flags_linker_so(self):
            return ["-shared", '-fpic']

    def runtime_library_dir_option(self, dir):
        return '-R%s' % dir


import functools


            

Reported by Pylint.

Redefining built-in 'dir'
Error

Line: 117 Column: 42

                  def get_flags_arch(self):
        return []

    def runtime_library_dir_option(self, dir):
        raise NotImplementedError


if __name__ == '__main__':
    from distutils import log

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              # http://www.pgroup.com
import sys

from numpy.distutils.fcompiler import FCompiler
from sys import platform
from os.path import join, dirname, normpath

compilers = ['PGroupFCompiler', 'PGroupFlangCompiler']


            

Reported by Pylint.

standard import "from sys import platform" should be placed before "from numpy.distutils.fcompiler import FCompiler"
Error

Line: 5 Column: 1

              import sys

from numpy.distutils.fcompiler import FCompiler
from sys import platform
from os.path import join, dirname, normpath

compilers = ['PGroupFCompiler', 'PGroupFlangCompiler']



            

Reported by Pylint.

standard import "from os.path import join, dirname, normpath" should be placed before "from numpy.distutils.fcompiler import FCompiler"
Error

Line: 6 Column: 1

              
from numpy.distutils.fcompiler import FCompiler
from sys import platform
from os.path import join, dirname, normpath

compilers = ['PGroupFCompiler', 'PGroupFlangCompiler']


class PGroupFCompiler(FCompiler):

            

Reported by Pylint.

Missing class docstring
Error

Line: 11 Column: 1

              compilers = ['PGroupFCompiler', 'PGroupFlangCompiler']


class PGroupFCompiler(FCompiler):

    compiler_type = 'pg'
    description = 'Portland Group Fortran Compiler'
    version_pattern = r'\s*pg(f77|f90|hpf|fortran) (?P<version>[\d.-]+).*'


            

Reported by Pylint.

standard import "import functools" should be placed before "from numpy.distutils.fcompiler import FCompiler"
Error

Line: 65 Column: 1

                      return '-R%s' % dir


import functools

class PGroupFlangCompiler(FCompiler):
    compiler_type = 'flang'
    description = 'Portland Group Fortran LLVM Compiler'
    version_pattern = r'\s*(flang|clang) version (?P<version>[\d.-]+).*'

            

Reported by Pylint.

Import "import functools" should be placed at the top of the module
Error

Line: 65 Column: 1

                      return '-R%s' % dir


import functools

class PGroupFlangCompiler(FCompiler):
    compiler_type = 'flang'
    description = 'Portland Group Fortran LLVM Compiler'
    version_pattern = r'\s*(flang|clang) version (?P<version>[\d.-]+).*'

            

Reported by Pylint.