The following issues were found

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

Line: 11 Column: 8

              AR_LIKE_c: List[complex]
AR_LIKE_U: List[str]

OUT_f: np.ndarray[Any, np.dtype[np.float64]]

reveal_type(np.einsum("i,i->i", AR_LIKE_b, AR_LIKE_b))  # E: Any
reveal_type(np.einsum("i,i->i", AR_LIKE_u, AR_LIKE_u))  # E: Any
reveal_type(np.einsum("i,i->i", AR_LIKE_i, AR_LIKE_i))  # E: Any
reveal_type(np.einsum("i,i->i", AR_LIKE_f, AR_LIKE_f))  # E: Any

            

Reported by Pylint.

Undefined variable 'reveal_type'
Error

Line: 13 Column: 1

              
OUT_f: np.ndarray[Any, np.dtype[np.float64]]

reveal_type(np.einsum("i,i->i", AR_LIKE_b, AR_LIKE_b))  # E: Any
reveal_type(np.einsum("i,i->i", AR_LIKE_u, AR_LIKE_u))  # E: Any
reveal_type(np.einsum("i,i->i", AR_LIKE_i, AR_LIKE_i))  # E: Any
reveal_type(np.einsum("i,i->i", AR_LIKE_f, AR_LIKE_f))  # E: Any
reveal_type(np.einsum("i,i->i", AR_LIKE_c, AR_LIKE_c))  # E: Any
reveal_type(np.einsum("i,i->i", AR_LIKE_b, AR_LIKE_i))  # E: Any

            

Reported by Pylint.

Undefined variable 'reveal_type'
Error

Line: 14 Column: 1

              OUT_f: np.ndarray[Any, np.dtype[np.float64]]

reveal_type(np.einsum("i,i->i", AR_LIKE_b, AR_LIKE_b))  # E: Any
reveal_type(np.einsum("i,i->i", AR_LIKE_u, AR_LIKE_u))  # E: Any
reveal_type(np.einsum("i,i->i", AR_LIKE_i, AR_LIKE_i))  # E: Any
reveal_type(np.einsum("i,i->i", AR_LIKE_f, AR_LIKE_f))  # E: Any
reveal_type(np.einsum("i,i->i", AR_LIKE_c, AR_LIKE_c))  # E: Any
reveal_type(np.einsum("i,i->i", AR_LIKE_b, AR_LIKE_i))  # E: Any
reveal_type(np.einsum("i,i,i,i->i", AR_LIKE_b, AR_LIKE_u, AR_LIKE_i, AR_LIKE_c))  # E: Any

            

Reported by Pylint.

Undefined variable 'reveal_type'
Error

Line: 15 Column: 1

              
reveal_type(np.einsum("i,i->i", AR_LIKE_b, AR_LIKE_b))  # E: Any
reveal_type(np.einsum("i,i->i", AR_LIKE_u, AR_LIKE_u))  # E: Any
reveal_type(np.einsum("i,i->i", AR_LIKE_i, AR_LIKE_i))  # E: Any
reveal_type(np.einsum("i,i->i", AR_LIKE_f, AR_LIKE_f))  # E: Any
reveal_type(np.einsum("i,i->i", AR_LIKE_c, AR_LIKE_c))  # E: Any
reveal_type(np.einsum("i,i->i", AR_LIKE_b, AR_LIKE_i))  # E: Any
reveal_type(np.einsum("i,i,i,i->i", AR_LIKE_b, AR_LIKE_u, AR_LIKE_i, AR_LIKE_c))  # E: Any


            

Reported by Pylint.

Undefined variable 'reveal_type'
Error

Line: 16 Column: 1

              reveal_type(np.einsum("i,i->i", AR_LIKE_b, AR_LIKE_b))  # E: Any
reveal_type(np.einsum("i,i->i", AR_LIKE_u, AR_LIKE_u))  # E: Any
reveal_type(np.einsum("i,i->i", AR_LIKE_i, AR_LIKE_i))  # E: Any
reveal_type(np.einsum("i,i->i", AR_LIKE_f, AR_LIKE_f))  # E: Any
reveal_type(np.einsum("i,i->i", AR_LIKE_c, AR_LIKE_c))  # E: Any
reveal_type(np.einsum("i,i->i", AR_LIKE_b, AR_LIKE_i))  # E: Any
reveal_type(np.einsum("i,i,i,i->i", AR_LIKE_b, AR_LIKE_u, AR_LIKE_i, AR_LIKE_c))  # E: Any

reveal_type(np.einsum("i,i->i", AR_LIKE_c, AR_LIKE_c, out=OUT_f))  # E: numpy.ndarray[Any, numpy.dtype[{float64}]

            

Reported by Pylint.

Undefined variable 'reveal_type'
Error

Line: 17 Column: 1

              reveal_type(np.einsum("i,i->i", AR_LIKE_u, AR_LIKE_u))  # E: Any
reveal_type(np.einsum("i,i->i", AR_LIKE_i, AR_LIKE_i))  # E: Any
reveal_type(np.einsum("i,i->i", AR_LIKE_f, AR_LIKE_f))  # E: Any
reveal_type(np.einsum("i,i->i", AR_LIKE_c, AR_LIKE_c))  # E: Any
reveal_type(np.einsum("i,i->i", AR_LIKE_b, AR_LIKE_i))  # E: Any
reveal_type(np.einsum("i,i,i,i->i", AR_LIKE_b, AR_LIKE_u, AR_LIKE_i, AR_LIKE_c))  # E: Any

reveal_type(np.einsum("i,i->i", AR_LIKE_c, AR_LIKE_c, out=OUT_f))  # E: numpy.ndarray[Any, numpy.dtype[{float64}]
reveal_type(np.einsum("i,i->i", AR_LIKE_U, AR_LIKE_U, dtype=bool, casting="unsafe", out=OUT_f))  # E: numpy.ndarray[Any, numpy.dtype[{float64}]

            

Reported by Pylint.

Undefined variable 'reveal_type'
Error

Line: 18 Column: 1

              reveal_type(np.einsum("i,i->i", AR_LIKE_i, AR_LIKE_i))  # E: Any
reveal_type(np.einsum("i,i->i", AR_LIKE_f, AR_LIKE_f))  # E: Any
reveal_type(np.einsum("i,i->i", AR_LIKE_c, AR_LIKE_c))  # E: Any
reveal_type(np.einsum("i,i->i", AR_LIKE_b, AR_LIKE_i))  # E: Any
reveal_type(np.einsum("i,i,i,i->i", AR_LIKE_b, AR_LIKE_u, AR_LIKE_i, AR_LIKE_c))  # E: Any

reveal_type(np.einsum("i,i->i", AR_LIKE_c, AR_LIKE_c, out=OUT_f))  # E: numpy.ndarray[Any, numpy.dtype[{float64}]
reveal_type(np.einsum("i,i->i", AR_LIKE_U, AR_LIKE_U, dtype=bool, casting="unsafe", out=OUT_f))  # E: numpy.ndarray[Any, numpy.dtype[{float64}]
reveal_type(np.einsum("i,i->i", AR_LIKE_f, AR_LIKE_f, dtype="c16"))  # E: Any

            

Reported by Pylint.

Undefined variable 'reveal_type'
Error

Line: 19 Column: 1

              reveal_type(np.einsum("i,i->i", AR_LIKE_f, AR_LIKE_f))  # E: Any
reveal_type(np.einsum("i,i->i", AR_LIKE_c, AR_LIKE_c))  # E: Any
reveal_type(np.einsum("i,i->i", AR_LIKE_b, AR_LIKE_i))  # E: Any
reveal_type(np.einsum("i,i,i,i->i", AR_LIKE_b, AR_LIKE_u, AR_LIKE_i, AR_LIKE_c))  # E: Any

reveal_type(np.einsum("i,i->i", AR_LIKE_c, AR_LIKE_c, out=OUT_f))  # E: numpy.ndarray[Any, numpy.dtype[{float64}]
reveal_type(np.einsum("i,i->i", AR_LIKE_U, AR_LIKE_U, dtype=bool, casting="unsafe", out=OUT_f))  # E: numpy.ndarray[Any, numpy.dtype[{float64}]
reveal_type(np.einsum("i,i->i", AR_LIKE_f, AR_LIKE_f, dtype="c16"))  # E: Any
reveal_type(np.einsum("i,i->i", AR_LIKE_U, AR_LIKE_U, dtype=bool, casting="unsafe"))  # E: Any

            

Reported by Pylint.

Undefined variable 'reveal_type'
Error

Line: 21 Column: 1

              reveal_type(np.einsum("i,i->i", AR_LIKE_b, AR_LIKE_i))  # E: Any
reveal_type(np.einsum("i,i,i,i->i", AR_LIKE_b, AR_LIKE_u, AR_LIKE_i, AR_LIKE_c))  # E: Any

reveal_type(np.einsum("i,i->i", AR_LIKE_c, AR_LIKE_c, out=OUT_f))  # E: numpy.ndarray[Any, numpy.dtype[{float64}]
reveal_type(np.einsum("i,i->i", AR_LIKE_U, AR_LIKE_U, dtype=bool, casting="unsafe", out=OUT_f))  # E: numpy.ndarray[Any, numpy.dtype[{float64}]
reveal_type(np.einsum("i,i->i", AR_LIKE_f, AR_LIKE_f, dtype="c16"))  # E: Any
reveal_type(np.einsum("i,i->i", AR_LIKE_U, AR_LIKE_U, dtype=bool, casting="unsafe"))  # E: Any

reveal_type(np.einsum_path("i,i->i", AR_LIKE_b, AR_LIKE_b))  # E: Tuple[builtins.list[Any], builtins.str]

            

Reported by Pylint.

Undefined variable 'reveal_type'
Error

Line: 22 Column: 1

              reveal_type(np.einsum("i,i,i,i->i", AR_LIKE_b, AR_LIKE_u, AR_LIKE_i, AR_LIKE_c))  # E: Any

reveal_type(np.einsum("i,i->i", AR_LIKE_c, AR_LIKE_c, out=OUT_f))  # E: numpy.ndarray[Any, numpy.dtype[{float64}]
reveal_type(np.einsum("i,i->i", AR_LIKE_U, AR_LIKE_U, dtype=bool, casting="unsafe", out=OUT_f))  # E: numpy.ndarray[Any, numpy.dtype[{float64}]
reveal_type(np.einsum("i,i->i", AR_LIKE_f, AR_LIKE_f, dtype="c16"))  # E: Any
reveal_type(np.einsum("i,i->i", AR_LIKE_U, AR_LIKE_U, dtype=bool, casting="unsafe"))  # E: Any

reveal_type(np.einsum_path("i,i->i", AR_LIKE_b, AR_LIKE_b))  # E: Tuple[builtins.list[Any], builtins.str]
reveal_type(np.einsum_path("i,i->i", AR_LIKE_u, AR_LIKE_u))  # E: Tuple[builtins.list[Any], builtins.str]

            

Reported by Pylint.

numpy/tests/test_reloading.py
29 issues
Access to a protected member _NoValue of a client class
Error

Line: 15 Column: 16

                  import numpy as np
    import numpy._globals

    _NoValue = np._NoValue
    VisibleDeprecationWarning = np.VisibleDeprecationWarning
    ModuleDeprecationWarning = np.ModuleDeprecationWarning

    with assert_warns(UserWarning):
        reload(np)

            

Reported by Pylint.

Using deprecated method assert_()
Error

Line: 21 Column: 5

              
    with assert_warns(UserWarning):
        reload(np)
    assert_(_NoValue is np._NoValue)
    assert_(ModuleDeprecationWarning is np.ModuleDeprecationWarning)
    assert_(VisibleDeprecationWarning is np.VisibleDeprecationWarning)

    assert_raises(RuntimeError, reload, numpy._globals)
    with assert_warns(UserWarning):

            

Reported by Pylint.

Access to a protected member _NoValue of a client class
Error

Line: 21 Column: 25

              
    with assert_warns(UserWarning):
        reload(np)
    assert_(_NoValue is np._NoValue)
    assert_(ModuleDeprecationWarning is np.ModuleDeprecationWarning)
    assert_(VisibleDeprecationWarning is np.VisibleDeprecationWarning)

    assert_raises(RuntimeError, reload, numpy._globals)
    with assert_warns(UserWarning):

            

Reported by Pylint.

Using deprecated method assert_()
Error

Line: 22 Column: 5

                  with assert_warns(UserWarning):
        reload(np)
    assert_(_NoValue is np._NoValue)
    assert_(ModuleDeprecationWarning is np.ModuleDeprecationWarning)
    assert_(VisibleDeprecationWarning is np.VisibleDeprecationWarning)

    assert_raises(RuntimeError, reload, numpy._globals)
    with assert_warns(UserWarning):
        reload(np)

            

Reported by Pylint.

Using deprecated method assert_()
Error

Line: 23 Column: 5

                      reload(np)
    assert_(_NoValue is np._NoValue)
    assert_(ModuleDeprecationWarning is np.ModuleDeprecationWarning)
    assert_(VisibleDeprecationWarning is np.VisibleDeprecationWarning)

    assert_raises(RuntimeError, reload, numpy._globals)
    with assert_warns(UserWarning):
        reload(np)
    assert_(_NoValue is np._NoValue)

            

Reported by Pylint.

Access to a protected member _globals of a client class
Error

Line: 25 Column: 41

                  assert_(ModuleDeprecationWarning is np.ModuleDeprecationWarning)
    assert_(VisibleDeprecationWarning is np.VisibleDeprecationWarning)

    assert_raises(RuntimeError, reload, numpy._globals)
    with assert_warns(UserWarning):
        reload(np)
    assert_(_NoValue is np._NoValue)
    assert_(ModuleDeprecationWarning is np.ModuleDeprecationWarning)
    assert_(VisibleDeprecationWarning is np.VisibleDeprecationWarning)

            

Reported by Pylint.

Access to a protected member _NoValue of a client class
Error

Line: 28 Column: 25

                  assert_raises(RuntimeError, reload, numpy._globals)
    with assert_warns(UserWarning):
        reload(np)
    assert_(_NoValue is np._NoValue)
    assert_(ModuleDeprecationWarning is np.ModuleDeprecationWarning)
    assert_(VisibleDeprecationWarning is np.VisibleDeprecationWarning)

def test_novalue():
    import numpy as np

            

Reported by Pylint.

Using deprecated method assert_()
Error

Line: 28 Column: 5

                  assert_raises(RuntimeError, reload, numpy._globals)
    with assert_warns(UserWarning):
        reload(np)
    assert_(_NoValue is np._NoValue)
    assert_(ModuleDeprecationWarning is np.ModuleDeprecationWarning)
    assert_(VisibleDeprecationWarning is np.VisibleDeprecationWarning)

def test_novalue():
    import numpy as np

            

Reported by Pylint.

Using deprecated method assert_()
Error

Line: 29 Column: 5

                  with assert_warns(UserWarning):
        reload(np)
    assert_(_NoValue is np._NoValue)
    assert_(ModuleDeprecationWarning is np.ModuleDeprecationWarning)
    assert_(VisibleDeprecationWarning is np.VisibleDeprecationWarning)

def test_novalue():
    import numpy as np
    for proto in range(2, pickle.HIGHEST_PROTOCOL + 1):

            

Reported by Pylint.

Using deprecated method assert_()
Error

Line: 30 Column: 5

                      reload(np)
    assert_(_NoValue is np._NoValue)
    assert_(ModuleDeprecationWarning is np.ModuleDeprecationWarning)
    assert_(VisibleDeprecationWarning is np.VisibleDeprecationWarning)

def test_novalue():
    import numpy as np
    for proto in range(2, pickle.HIGHEST_PROTOCOL + 1):
        assert_equal(repr(np._NoValue), '<no value>')

            

Reported by Pylint.

numpy/lib/tests/test__version.py
29 issues
Using deprecated method assert_()
Error

Line: 9 Column: 5

              

def test_main_versions():
    assert_(NumpyVersion('1.8.0') == '1.8.0')
    for ver in ['1.9.0', '2.0.0', '1.8.1', '10.0.1']:
        assert_(NumpyVersion('1.8.0') < ver)

    for ver in ['1.7.0', '1.7.1', '0.9.9']:
        assert_(NumpyVersion('1.8.0') > ver)

            

Reported by Pylint.

Using deprecated method assert_()
Error

Line: 11 Column: 9

              def test_main_versions():
    assert_(NumpyVersion('1.8.0') == '1.8.0')
    for ver in ['1.9.0', '2.0.0', '1.8.1', '10.0.1']:
        assert_(NumpyVersion('1.8.0') < ver)

    for ver in ['1.7.0', '1.7.1', '0.9.9']:
        assert_(NumpyVersion('1.8.0') > ver)



            

Reported by Pylint.

Using deprecated method assert_()
Error

Line: 14 Column: 9

                      assert_(NumpyVersion('1.8.0') < ver)

    for ver in ['1.7.0', '1.7.1', '0.9.9']:
        assert_(NumpyVersion('1.8.0') > ver)


def test_version_1_point_10():
    # regression test for gh-2998.
    assert_(NumpyVersion('1.9.0') < '1.10.0')

            

Reported by Pylint.

Using deprecated method assert_()
Error

Line: 19 Column: 5

              
def test_version_1_point_10():
    # regression test for gh-2998.
    assert_(NumpyVersion('1.9.0') < '1.10.0')
    assert_(NumpyVersion('1.11.0') < '1.11.1')
    assert_(NumpyVersion('1.11.0') == '1.11.0')
    assert_(NumpyVersion('1.99.11') < '1.99.12')



            

Reported by Pylint.

Using deprecated method assert_()
Error

Line: 20 Column: 5

              def test_version_1_point_10():
    # regression test for gh-2998.
    assert_(NumpyVersion('1.9.0') < '1.10.0')
    assert_(NumpyVersion('1.11.0') < '1.11.1')
    assert_(NumpyVersion('1.11.0') == '1.11.0')
    assert_(NumpyVersion('1.99.11') < '1.99.12')


def test_alpha_beta_rc():

            

Reported by Pylint.

Using deprecated method assert_()
Error

Line: 21 Column: 5

                  # regression test for gh-2998.
    assert_(NumpyVersion('1.9.0') < '1.10.0')
    assert_(NumpyVersion('1.11.0') < '1.11.1')
    assert_(NumpyVersion('1.11.0') == '1.11.0')
    assert_(NumpyVersion('1.99.11') < '1.99.12')


def test_alpha_beta_rc():
    assert_(NumpyVersion('1.8.0rc1') == '1.8.0rc1')

            

Reported by Pylint.

Using deprecated method assert_()
Error

Line: 22 Column: 5

                  assert_(NumpyVersion('1.9.0') < '1.10.0')
    assert_(NumpyVersion('1.11.0') < '1.11.1')
    assert_(NumpyVersion('1.11.0') == '1.11.0')
    assert_(NumpyVersion('1.99.11') < '1.99.12')


def test_alpha_beta_rc():
    assert_(NumpyVersion('1.8.0rc1') == '1.8.0rc1')
    for ver in ['1.8.0', '1.8.0rc2']:

            

Reported by Pylint.

Using deprecated method assert_()
Error

Line: 26 Column: 5

              

def test_alpha_beta_rc():
    assert_(NumpyVersion('1.8.0rc1') == '1.8.0rc1')
    for ver in ['1.8.0', '1.8.0rc2']:
        assert_(NumpyVersion('1.8.0rc1') < ver)

    for ver in ['1.8.0a2', '1.8.0b3', '1.7.2rc4']:
        assert_(NumpyVersion('1.8.0rc1') > ver)

            

Reported by Pylint.

Using deprecated method assert_()
Error

Line: 28 Column: 9

              def test_alpha_beta_rc():
    assert_(NumpyVersion('1.8.0rc1') == '1.8.0rc1')
    for ver in ['1.8.0', '1.8.0rc2']:
        assert_(NumpyVersion('1.8.0rc1') < ver)

    for ver in ['1.8.0a2', '1.8.0b3', '1.7.2rc4']:
        assert_(NumpyVersion('1.8.0rc1') > ver)

    assert_(NumpyVersion('1.8.0b1') > '1.8.0a2')

            

Reported by Pylint.

Using deprecated method assert_()
Error

Line: 31 Column: 9

                      assert_(NumpyVersion('1.8.0rc1') < ver)

    for ver in ['1.8.0a2', '1.8.0b3', '1.7.2rc4']:
        assert_(NumpyVersion('1.8.0rc1') > ver)

    assert_(NumpyVersion('1.8.0b1') > '1.8.0a2')


def test_dev_version():

            

Reported by Pylint.

numpy/f2py/diagnose.py
29 issues
Starting a process with a shell, possible injection detected, security issue.
Security injection

Line: 9
Suggestion: https://bandit.readthedocs.io/en/latest/plugins/b605_start_process_with_a_shell.html

              
def run_command(cmd):
    print('Running %r:' % (cmd))
    os.system(cmd)
    print('------')


def run():
    _path = os.getcwd()

            

Reported by Bandit.

Module 'numpy.distutils' has no '__version__' member
Error

Line: 75 Column: 21

                      try:
            if has_numpy_distutils == 2:
                print('Found numpy.distutils version %r in %r' % (
                    numpy.distutils.__version__,
                    numpy.distutils.__file__))
            else:
                print('Found numpy_distutils version %r in %r' % (
                    numpy_distutils.numpy_distutils_version.numpy_distutils_version,
                    numpy_distutils.__file__))

            

Reported by Pylint.

Unable to import 'numpy_distutils.command.build_flib'
Error

Line: 89 Column: 17

                          if has_numpy_distutils == 1:
                print(
                    'Importing numpy_distutils.command.build_flib ...', end=' ')
                import numpy_distutils.command.build_flib as build_flib
                print('ok')
                print('------')
                try:
                    print(
                        'Checking availability of supported Fortran compilers:')

            

Reported by Pylint.

Unable to import 'numpy_distutils.fcompiler'
Error

Line: 111 Column: 17

                              import numpy.distutils.fcompiler as fcompiler
            else:
                print('Importing numpy_distutils.fcompiler ...', end=' ')
                import numpy_distutils.fcompiler as fcompiler
            print('ok')
            print('------')
            try:
                print('Checking availability of supported Fortran compilers:')
                fcompiler.show_fcompilers()

            

Reported by Pylint.

Catching too general exception Exception
Error

Line: 59 Column: 16

                      try:
            print('Found new numpy version %r in %s' %
                  (numpy.__version__, numpy.__file__))
        except Exception as msg:
            print('error:', msg)
            print('------')

    if has_f2py2e:
        try:

            

Reported by Pylint.

Catching too general exception Exception
Error

Line: 67 Column: 16

                      try:
            print('Found f2py2e version %r in %s' %
                  (f2py2e.__version__.version, f2py2e.__file__))
        except Exception as msg:
            print('error:', msg)
            print('------')

    if has_numpy_distutils:
        try:

            

Reported by Pylint.

Catching too general exception Exception
Error

Line: 82 Column: 16

                                  numpy_distutils.numpy_distutils_version.numpy_distutils_version,
                    numpy_distutils.__file__))
            print('------')
        except Exception as msg:
            print('error:', msg)
            print('------')
        try:
            if has_numpy_distutils == 1:
                print(

            

Reported by Pylint.

Catching too general exception Exception
Error

Line: 98 Column: 24

                                  for compiler_class in build_flib.all_compilers:
                        compiler_class(verbose=1).is_available()
                        print('------')
                except Exception as msg:
                    print('error:', msg)
                    print('------')
        except Exception as msg:
            print(
                'error:', msg, '(ignore it, build_flib is obsolute for numpy.distutils 0.2.2 and up)')

            

Reported by Pylint.

Catching too general exception Exception
Error

Line: 101 Column: 16

                              except Exception as msg:
                    print('error:', msg)
                    print('------')
        except Exception as msg:
            print(
                'error:', msg, '(ignore it, build_flib is obsolute for numpy.distutils 0.2.2 and up)')
            print('------')
        try:
            if has_numpy_distutils == 2:

            

Reported by Pylint.

Catching too general exception Exception
Error

Line: 118 Column: 20

                              print('Checking availability of supported Fortran compilers:')
                fcompiler.show_fcompilers()
                print('------')
            except Exception as msg:
                print('error:', msg)
                print('------')
        except Exception as msg:
            print('error:', msg)
            print('------')

            

Reported by Pylint.

numpy/core/getlimits.py
29 issues
Attempted relative import beyond top-level package
Error

Line: 8 Column: 1

              
import warnings

from .machar import MachAr
from .overrides import set_module
from . import numeric
from . import numerictypes as ntypes
from .numeric import array, inf, NaN
from .umath import log10, exp2, nextafter, isnan

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 9 Column: 1

              import warnings

from .machar import MachAr
from .overrides import set_module
from . import numeric
from . import numerictypes as ntypes
from .numeric import array, inf, NaN
from .umath import log10, exp2, nextafter, isnan
from . import umath

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 10 Column: 1

              
from .machar import MachAr
from .overrides import set_module
from . import numeric
from . import numerictypes as ntypes
from .numeric import array, inf, NaN
from .umath import log10, exp2, nextafter, isnan
from . import umath


            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 11 Column: 1

              from .machar import MachAr
from .overrides import set_module
from . import numeric
from . import numerictypes as ntypes
from .numeric import array, inf, NaN
from .umath import log10, exp2, nextafter, isnan
from . import umath



            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 12 Column: 1

              from .overrides import set_module
from . import numeric
from . import numerictypes as ntypes
from .numeric import array, inf, NaN
from .umath import log10, exp2, nextafter, isnan
from . import umath


def _fr0(a):

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 13 Column: 1

              from . import numeric
from . import numerictypes as ntypes
from .numeric import array, inf, NaN
from .umath import log10, exp2, nextafter, isnan
from . import umath


def _fr0(a):
    """fix rank-0 --> rank-1"""

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 14 Column: 1

              from . import numerictypes as ntypes
from .numeric import array, inf, NaN
from .umath import log10, exp2, nextafter, isnan
from . import umath


def _fr0(a):
    """fix rank-0 --> rank-1"""
    if a.ndim == 0:

            

Reported by Pylint.

Unused import umath
Error

Line: 14 Column: 1

              from . import numerictypes as ntypes
from .numeric import array, inf, NaN
from .umath import log10, exp2, nextafter, isnan
from . import umath


def _fr0(a):
    """fix rank-0 --> rank-1"""
    if a.ndim == 0:

            

Reported by Pylint.

Access to a protected member _str_xmin of a client class
Error

Line: 506 Column: 26

                      self.nexp = machar.iexp
        self.nmant = machar.it
        self.machar = machar
        self._str_tiny = machar._str_xmin.strip()
        self._str_max = machar._str_xmax.strip()
        self._str_epsneg = machar._str_epsneg.strip()
        self._str_eps = machar._str_eps.strip()
        self._str_resolution = machar._str_resolution.strip()
        self._str_smallest_normal = machar._str_smallest_normal.strip()

            

Reported by Pylint.

Access to a protected member _str_xmax of a client class
Error

Line: 507 Column: 25

                      self.nmant = machar.it
        self.machar = machar
        self._str_tiny = machar._str_xmin.strip()
        self._str_max = machar._str_xmax.strip()
        self._str_epsneg = machar._str_epsneg.strip()
        self._str_eps = machar._str_eps.strip()
        self._str_resolution = machar._str_resolution.strip()
        self._str_smallest_normal = machar._str_smallest_normal.strip()
        self._str_smallest_subnormal = machar._str_smallest_subnormal.strip()

            

Reported by Pylint.

doc/neps/conf.py
28 issues
Unused import os
Error

Line: 19 Column: 1

              # add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#
import os
# import sys
# sys.path.insert(0, os.path.abspath('.'))


# -- General configuration ------------------------------------------------

            

Reported by Pylint.

Redefining built-in 'copyright'
Error

Line: 52 Column: 1

              
# General information about the project.
project = u'NumPy Enhancement Proposals'
copyright = u'2017-2018, NumPy Developers'
author = u'NumPy Developers'

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              # -*- coding: utf-8 -*-
#
# NumPy Enhancement Proposals documentation build configuration file, created by
# sphinx-quickstart on Mon Dec 11 12:45:09 2017.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this

            

Reported by Pylint.

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

Line: 45 Column: 1

              # You can specify multiple suffix as a list of string:
#
# source_suffix = ['.rst', '.md']
source_suffix = '.rst'

# The master toctree document.
master_doc = 'content'

# General information about the project.

            

Reported by Pylint.

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

Line: 48 Column: 1

              source_suffix = '.rst'

# The master toctree document.
master_doc = 'content'

# General information about the project.
project = u'NumPy Enhancement Proposals'
copyright = u'2017-2018, NumPy Developers'
author = u'NumPy Developers'

            

Reported by Pylint.

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

Line: 51 Column: 1

              master_doc = 'content'

# General information about the project.
project = u'NumPy Enhancement Proposals'
copyright = u'2017-2018, NumPy Developers'
author = u'NumPy Developers'

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the

            

Reported by Pylint.

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

Line: 52 Column: 1

              
# General information about the project.
project = u'NumPy Enhancement Proposals'
copyright = u'2017-2018, NumPy Developers'
author = u'NumPy Developers'

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.

            

Reported by Pylint.

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

Line: 53 Column: 1

              # General information about the project.
project = u'NumPy Enhancement Proposals'
copyright = u'2017-2018, NumPy Developers'
author = u'NumPy Developers'

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#

            

Reported by Pylint.

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

Line: 60 Column: 1

              # built documents.
#
# The short X.Y version.
version = u''
# The full version, including alpha/beta/rc tags.
release = u''

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.

            

Reported by Pylint.

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

Line: 62 Column: 1

              # The short X.Y version.
version = u''
# The full version, including alpha/beta/rc tags.
release = u''

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
#
# This is also used if you do content translation via gettext catalogs.

            

Reported by Pylint.

numpy/typing/tests/data/reveal/ndarray_conversion.py
28 issues
Module 'numpy.typing' has no 'NDArray' member
Error

Line: 4 Column: 5

              import numpy as np
import numpy.typing as npt

nd: npt.NDArray[np.int_] = np.array([[1, 2], [3, 4]])

# item
reveal_type(nd.item())  # E: int
reveal_type(nd.item(1))  # E: int
reveal_type(nd.item(0, 1))  # E: int

            

Reported by Pylint.

Undefined variable 'reveal_type'
Error

Line: 7 Column: 1

              nd: npt.NDArray[np.int_] = np.array([[1, 2], [3, 4]])

# item
reveal_type(nd.item())  # E: int
reveal_type(nd.item(1))  # E: int
reveal_type(nd.item(0, 1))  # E: int
reveal_type(nd.item((0, 1)))  # E: int

# tolist

            

Reported by Pylint.

Undefined variable 'reveal_type'
Error

Line: 8 Column: 1

              
# item
reveal_type(nd.item())  # E: int
reveal_type(nd.item(1))  # E: int
reveal_type(nd.item(0, 1))  # E: int
reveal_type(nd.item((0, 1)))  # E: int

# tolist
reveal_type(nd.tolist())  # E: Any

            

Reported by Pylint.

Undefined variable 'reveal_type'
Error

Line: 9 Column: 1

              # item
reveal_type(nd.item())  # E: int
reveal_type(nd.item(1))  # E: int
reveal_type(nd.item(0, 1))  # E: int
reveal_type(nd.item((0, 1)))  # E: int

# tolist
reveal_type(nd.tolist())  # E: Any


            

Reported by Pylint.

Undefined variable 'reveal_type'
Error

Line: 10 Column: 1

              reveal_type(nd.item())  # E: int
reveal_type(nd.item(1))  # E: int
reveal_type(nd.item(0, 1))  # E: int
reveal_type(nd.item((0, 1)))  # E: int

# tolist
reveal_type(nd.tolist())  # E: Any

# itemset does not return a value

            

Reported by Pylint.

Undefined variable 'reveal_type'
Error

Line: 13 Column: 1

              reveal_type(nd.item((0, 1)))  # E: int

# tolist
reveal_type(nd.tolist())  # E: Any

# itemset does not return a value
# tostring is pretty simple
# tobytes is pretty simple
# tofile does not return a value

            

Reported by Pylint.

Undefined variable 'reveal_type'
Error

Line: 23 Column: 1

              # dumps is pretty simple

# astype
reveal_type(nd.astype("float"))  # E: numpy.ndarray[Any, numpy.dtype[Any]]
reveal_type(nd.astype(float))  # E: numpy.ndarray[Any, numpy.dtype[Any]]
reveal_type(nd.astype(np.float64))  # E: numpy.ndarray[Any, numpy.dtype[{float64}]]
reveal_type(nd.astype(np.float64, "K"))  # E: numpy.ndarray[Any, numpy.dtype[{float64}]]
reveal_type(nd.astype(np.float64, "K", "unsafe"))  # E: numpy.ndarray[Any, numpy.dtype[{float64}]]
reveal_type(nd.astype(np.float64, "K", "unsafe", True))  # E: numpy.ndarray[Any, numpy.dtype[{float64}]]

            

Reported by Pylint.

Undefined variable 'reveal_type'
Error

Line: 24 Column: 1

              
# astype
reveal_type(nd.astype("float"))  # E: numpy.ndarray[Any, numpy.dtype[Any]]
reveal_type(nd.astype(float))  # E: numpy.ndarray[Any, numpy.dtype[Any]]
reveal_type(nd.astype(np.float64))  # E: numpy.ndarray[Any, numpy.dtype[{float64}]]
reveal_type(nd.astype(np.float64, "K"))  # E: numpy.ndarray[Any, numpy.dtype[{float64}]]
reveal_type(nd.astype(np.float64, "K", "unsafe"))  # E: numpy.ndarray[Any, numpy.dtype[{float64}]]
reveal_type(nd.astype(np.float64, "K", "unsafe", True))  # E: numpy.ndarray[Any, numpy.dtype[{float64}]]
reveal_type(nd.astype(np.float64, "K", "unsafe", True, True))  # E: numpy.ndarray[Any, numpy.dtype[{float64}]]

            

Reported by Pylint.

Undefined variable 'reveal_type'
Error

Line: 25 Column: 1

              # astype
reveal_type(nd.astype("float"))  # E: numpy.ndarray[Any, numpy.dtype[Any]]
reveal_type(nd.astype(float))  # E: numpy.ndarray[Any, numpy.dtype[Any]]
reveal_type(nd.astype(np.float64))  # E: numpy.ndarray[Any, numpy.dtype[{float64}]]
reveal_type(nd.astype(np.float64, "K"))  # E: numpy.ndarray[Any, numpy.dtype[{float64}]]
reveal_type(nd.astype(np.float64, "K", "unsafe"))  # E: numpy.ndarray[Any, numpy.dtype[{float64}]]
reveal_type(nd.astype(np.float64, "K", "unsafe", True))  # E: numpy.ndarray[Any, numpy.dtype[{float64}]]
reveal_type(nd.astype(np.float64, "K", "unsafe", True, True))  # E: numpy.ndarray[Any, numpy.dtype[{float64}]]


            

Reported by Pylint.

Undefined variable 'reveal_type'
Error

Line: 26 Column: 1

              reveal_type(nd.astype("float"))  # E: numpy.ndarray[Any, numpy.dtype[Any]]
reveal_type(nd.astype(float))  # E: numpy.ndarray[Any, numpy.dtype[Any]]
reveal_type(nd.astype(np.float64))  # E: numpy.ndarray[Any, numpy.dtype[{float64}]]
reveal_type(nd.astype(np.float64, "K"))  # E: numpy.ndarray[Any, numpy.dtype[{float64}]]
reveal_type(nd.astype(np.float64, "K", "unsafe"))  # E: numpy.ndarray[Any, numpy.dtype[{float64}]]
reveal_type(nd.astype(np.float64, "K", "unsafe", True))  # E: numpy.ndarray[Any, numpy.dtype[{float64}]]
reveal_type(nd.astype(np.float64, "K", "unsafe", True, True))  # E: numpy.ndarray[Any, numpy.dtype[{float64}]]

# byteswap

            

Reported by Pylint.

numpy/core/tests/test_umath_accuracy.py
28 issues
Unable to import 'pytest'
Error

Line: 6 Column: 1

              import os
from os import path
import sys
import pytest
from ctypes import c_longlong, c_double, c_float, c_int, cast, pointer, POINTER
from numpy.testing import assert_array_max_ulp
from numpy.core._multiarray_umath import __cpu_features__

IS_AVX = __cpu_features__.get('AVX512F', False) or \

            

Reported by Pylint.

Unable to import 'numpy.core._multiarray_umath'
Error

Line: 9 Column: 1

              import pytest
from ctypes import c_longlong, c_double, c_float, c_int, cast, pointer, POINTER
from numpy.testing import assert_array_max_ulp
from numpy.core._multiarray_umath import __cpu_features__

IS_AVX = __cpu_features__.get('AVX512F', False) or \
        (__cpu_features__.get('FMA3', False) and __cpu_features__.get('AVX2', False))
runtest = sys.platform.startswith('linux') and IS_AVX
platform_skip = pytest.mark.skipif(not runtest,

            

Reported by Pylint.

Module 'numpy.random' has no 'permutation' member
Error

Line: 55 Column: 32

                                      data_subset = data[data['type'] == datatype]
                        inval  = np.array(str_to_float(data_subset['input'].astype(str), data_subset['type'].astype(str)), dtype=eval(datatype))
                        outval = np.array(str_to_float(data_subset['output'].astype(str), data_subset['type'].astype(str)), dtype=eval(datatype))
                        perm = np.random.permutation(len(inval))
                        inval = inval[perm]
                        outval = outval[perm]
                        maxulperr = data_subset['ulperr'].max()
                        assert_array_max_ulp(npfunc(inval), outval, maxulperr)

            

Reported by Pylint.

Unused import platform
Error

Line: 2 Column: 1

              import numpy as np
import platform
import os
from os import path
import sys
import pytest
from ctypes import c_longlong, c_double, c_float, c_int, cast, pointer, POINTER
from numpy.testing import assert_array_max_ulp
from numpy.core._multiarray_umath import __cpu_features__

            

Reported by Pylint.

Use of possibly insecure function - consider using safer ast.literal_eval.
Security blacklist

Line: 53
Suggestion: https://bandit.readthedocs.io/en/latest/blacklists/blacklist_calls.html#b307-eval

                                  npfunc = getattr(np, npname)
                    for datatype in np.unique(data['type']):
                        data_subset = data[data['type'] == datatype]
                        inval  = np.array(str_to_float(data_subset['input'].astype(str), data_subset['type'].astype(str)), dtype=eval(datatype))
                        outval = np.array(str_to_float(data_subset['output'].astype(str), data_subset['type'].astype(str)), dtype=eval(datatype))
                        perm = np.random.permutation(len(inval))
                        inval = inval[perm]
                        outval = outval[perm]
                        maxulperr = data_subset['ulperr'].max()

            

Reported by Bandit.

Use of eval
Error

Line: 53 Column: 130

                                  npfunc = getattr(np, npname)
                    for datatype in np.unique(data['type']):
                        data_subset = data[data['type'] == datatype]
                        inval  = np.array(str_to_float(data_subset['input'].astype(str), data_subset['type'].astype(str)), dtype=eval(datatype))
                        outval = np.array(str_to_float(data_subset['output'].astype(str), data_subset['type'].astype(str)), dtype=eval(datatype))
                        perm = np.random.permutation(len(inval))
                        inval = inval[perm]
                        outval = outval[perm]
                        maxulperr = data_subset['ulperr'].max()

            

Reported by Pylint.

Use of eval
Error

Line: 54 Column: 131

                                  for datatype in np.unique(data['type']):
                        data_subset = data[data['type'] == datatype]
                        inval  = np.array(str_to_float(data_subset['input'].astype(str), data_subset['type'].astype(str)), dtype=eval(datatype))
                        outval = np.array(str_to_float(data_subset['output'].astype(str), data_subset['type'].astype(str)), dtype=eval(datatype))
                        perm = np.random.permutation(len(inval))
                        inval = inval[perm]
                        outval = outval[perm]
                        maxulperr = data_subset['ulperr'].max()
                        assert_array_max_ulp(npfunc(inval), outval, maxulperr)

            

Reported by Pylint.

Use of possibly insecure function - consider using safer ast.literal_eval.
Security blacklist

Line: 54
Suggestion: https://bandit.readthedocs.io/en/latest/blacklists/blacklist_calls.html#b307-eval

                                  for datatype in np.unique(data['type']):
                        data_subset = data[data['type'] == datatype]
                        inval  = np.array(str_to_float(data_subset['input'].astype(str), data_subset['type'].astype(str)), dtype=eval(datatype))
                        outval = np.array(str_to_float(data_subset['output'].astype(str), data_subset['type'].astype(str)), dtype=eval(datatype))
                        perm = np.random.permutation(len(inval))
                        inval = inval[perm]
                        outval = outval[perm]
                        maxulperr = data_subset['ulperr'].max()
                        assert_array_max_ulp(npfunc(inval), outval, maxulperr)

            

Reported by Bandit.

Missing module docstring
Error

Line: 1 Column: 1

              import numpy as np
import platform
import os
from os import path
import sys
import pytest
from ctypes import c_longlong, c_double, c_float, c_int, cast, pointer, POINTER
from numpy.testing import assert_array_max_ulp
from numpy.core._multiarray_umath import __cpu_features__

            

Reported by Pylint.

standard import "import platform" should be placed before "import numpy as np"
Error

Line: 2 Column: 1

              import numpy as np
import platform
import os
from os import path
import sys
import pytest
from ctypes import c_longlong, c_double, c_float, c_int, cast, pointer, POINTER
from numpy.testing import assert_array_max_ulp
from numpy.core._multiarray_umath import __cpu_features__

            

Reported by Pylint.

numpy/core/tests/test_print.py
28 issues
Unable to import 'pytest'
Error

Line: 3 Column: 1

              import sys

import pytest

import numpy as np
from numpy.testing import assert_, assert_equal
from numpy.core.tests._locales import CommaDecimalPointLocale



            

Reported by Pylint.

Using deprecated method assert_()
Error

Line: 182 Column: 13

                          assert_equal(fmat.format(val), fmat.format(valtype(val)),
                    "failed with val %s, type %s" % (val, valtype))
        except ValueError as e:
            assert_(False,
               "format raised exception (fmt='%s', val=%s, type=%s, exc='%s')" %
                            (fmat, repr(val), repr(valtype), str(e)))


#

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              import sys

import pytest

import numpy as np
from numpy.testing import assert_, assert_equal
from numpy.core.tests._locales import CommaDecimalPointLocale



            

Reported by Pylint.

standard import "from io import StringIO" should be placed before "import pytest"
Error

Line: 10 Column: 1

              from numpy.core.tests._locales import CommaDecimalPointLocale


from io import StringIO

_REF = {np.inf: 'inf', -np.inf: '-inf', np.nan: 'nan'}


@pytest.mark.parametrize('tp', [np.float32, np.double, np.longdouble])

            

Reported by Pylint.

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

Line: 16 Column: 1

              

@pytest.mark.parametrize('tp', [np.float32, np.double, np.longdouble])
def test_float_types(tp):
    """ Check formatting.

        This is only for the str function, and only for simple types.
        The precision of np.float32 and np.longdouble aren't the same as the
        python float precision.

            

Reported by Pylint.

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

Line: 24 Column: 9

                      python float precision.

    """
    for x in [0, 1, -1, 1e20]:
        assert_equal(str(tp(x)), str(float(x)),
                     err_msg='Failed str formatting for type %s' % tp)

    if tp(1e16).itemsize > 4:
        assert_equal(str(tp(1e16)), str(float('1e16')),

            

Reported by Pylint.

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

Line: 38 Column: 1

              

@pytest.mark.parametrize('tp', [np.float32, np.double, np.longdouble])
def test_nan_inf_float(tp):
    """ Check formatting of nan & inf.

        This is only for the str function, and only for simple types.
        The precision of np.float32 and np.longdouble aren't the same as the
        python float precision.

            

Reported by Pylint.

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

Line: 46 Column: 9

                      python float precision.

    """
    for x in [np.inf, -np.inf, np.nan]:
        assert_equal(str(tp(x)), _REF[x],
                     err_msg='Failed str formatting for type %s' % tp)


@pytest.mark.parametrize('tp', [np.complex64, np.cdouble, np.clongdouble])

            

Reported by Pylint.

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

Line: 52 Column: 1

              

@pytest.mark.parametrize('tp', [np.complex64, np.cdouble, np.clongdouble])
def test_complex_types(tp):
    """Check formatting of complex types.

        This is only for the str function, and only for simple types.
        The precision of np.float32 and np.longdouble aren't the same as the
        python float precision.

            

Reported by Pylint.

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

Line: 60 Column: 9

                      python float precision.

    """
    for x in [0, 1, -1, 1e20]:
        assert_equal(str(tp(x)), str(complex(x)),
                     err_msg='Failed str formatting for type %s' % tp)
        assert_equal(str(tp(x*1j)), str(complex(x*1j)),
                     err_msg='Failed str formatting for type %s' % tp)
        assert_equal(str(tp(x + x*1j)), str(complex(x + x*1j)),

            

Reported by Pylint.

numpy/core/memmap.py
28 issues
Attempted relative import beyond top-level package
Error

Line: 4 Column: 1

              from contextlib import nullcontext

import numpy as np
from .numeric import uint8, ndarray, dtype
from numpy.compat import os_fspath, is_pathlib_path
from numpy.core.overrides import set_module

__all__ = ['memmap']


            

Reported by Pylint.

Redefining name 'dtype' from outer scope (line 4)
Error

Line: 208 Column: 36

              
    __array_priority__ = -100.0

    def __new__(subtype, filename, dtype=uint8, mode='r+', offset=0,
                shape=None, order='C'):
        # Import here to minimize 'import numpy' overhead
        import mmap
        import os.path
        try:

            

Reported by Pylint.

Unused variable 'e'
Error

Line: 215 Column: 9

                      import os.path
        try:
            mode = mode_equivalents[mode]
        except KeyError as e:
            if mode not in valid_filemodes:
                raise ValueError(
                    "mode must be one of {!r} (got {!r})"
                    .format(valid_filemodes + list(mode_equivalents.keys()), mode)
                ) from None

            

Reported by Pylint.

Redefining built-in 'bytes'
Error

Line: 237 Column: 17

                          _dbytes = descr.itemsize

            if shape is None:
                bytes = flen - offset
                if bytes % _dbytes:
                    raise ValueError("Size of available data is not a "
                            "multiple of the data-type size.")
                size = bytes // _dbytes
                shape = (size,)

            

Reported by Pylint.

Attribute '_mmap' defined outside __init__
Error

Line: 290 Column: 13

              
    def __array_finalize__(self, obj):
        if hasattr(obj, '_mmap') and np.may_share_memory(self, obj):
            self._mmap = obj._mmap
            self.filename = obj.filename
            self.offset = obj.offset
            self.mode = obj.mode
        else:
            self._mmap = None

            

Reported by Pylint.

Access to a protected member _mmap of a client class
Error

Line: 290 Column: 26

              
    def __array_finalize__(self, obj):
        if hasattr(obj, '_mmap') and np.may_share_memory(self, obj):
            self._mmap = obj._mmap
            self.filename = obj.filename
            self.offset = obj.offset
            self.mode = obj.mode
        else:
            self._mmap = None

            

Reported by Pylint.

Attribute 'filename' defined outside __init__
Error

Line: 291 Column: 13

                  def __array_finalize__(self, obj):
        if hasattr(obj, '_mmap') and np.may_share_memory(self, obj):
            self._mmap = obj._mmap
            self.filename = obj.filename
            self.offset = obj.offset
            self.mode = obj.mode
        else:
            self._mmap = None
            self.filename = None

            

Reported by Pylint.

Attribute 'offset' defined outside __init__
Error

Line: 292 Column: 13

                      if hasattr(obj, '_mmap') and np.may_share_memory(self, obj):
            self._mmap = obj._mmap
            self.filename = obj.filename
            self.offset = obj.offset
            self.mode = obj.mode
        else:
            self._mmap = None
            self.filename = None
            self.offset = None

            

Reported by Pylint.

Attribute 'mode' defined outside __init__
Error

Line: 293 Column: 13

                          self._mmap = obj._mmap
            self.filename = obj.filename
            self.offset = obj.offset
            self.mode = obj.mode
        else:
            self._mmap = None
            self.filename = None
            self.offset = None
            self.mode = None

            

Reported by Pylint.

Attribute '_mmap' defined outside __init__
Error

Line: 295 Column: 13

                          self.offset = obj.offset
            self.mode = obj.mode
        else:
            self._mmap = None
            self.filename = None
            self.offset = None
            self.mode = None

    def flush(self):

            

Reported by Pylint.