The following issues were found
numpy/typing/tests/data/pass/ndarray_shape_manipulation.py
2 issues
Line: 14
Column: 1
nd1.reshape(4, order="C")
# resize
nd1.resize()
nd1.resize(4)
nd1.resize(2, 2)
nd1.resize((2, 2))
nd1.resize((2, 2), refcheck=True)
Reported by Pylint.
Line: 1
Column: 1
import numpy as np
nd1 = np.array([[1, 2], [3, 4]])
# reshape
nd1.reshape(4)
nd1.reshape(2, 2)
nd1.reshape((2, 2))
Reported by Pylint.
numpy/lib/mixins.py
2 issues
Line: 162
Column: 3
__divmod__ = _binary_method(um.divmod, 'divmod')
__rdivmod__ = _reflected_binary_method(um.divmod, 'divmod')
# __idivmod__ does not exist
# TODO: handle the optional third argument for __pow__?
__pow__, __rpow__, __ipow__ = _numeric_methods(um.power, 'pow')
__lshift__, __rlshift__, __ilshift__ = _numeric_methods(
um.left_shift, 'lshift')
__rshift__, __rrshift__, __irshift__ = _numeric_methods(
um.right_shift, 'rshift')
Reported by Pylint.
Line: 59
Column: 1
return func
class NDArrayOperatorsMixin:
"""Mixin defining all operator special methods using __array_ufunc__.
This class implements the special methods for almost all of Python's
builtin operators defined in the `operator` module, including comparisons
(``==``, ``>``, etc.) and arithmetic (``+``, ``*``, ``-``, etc.), by
Reported by Pylint.
numpy/typing/tests/data/pass/literal.py
2 issues
Line: 4
Column: 1
from functools import partial
from typing import Callable, List, Tuple
import pytest # type: ignore
import numpy as np
AR = np.array(0)
AR.setflags(write=False)
Reported by Pylint.
Line: 1
Column: 1
from functools import partial
from typing import Callable, List, Tuple
import pytest # type: ignore
import numpy as np
AR = np.array(0)
AR.setflags(write=False)
Reported by Pylint.
numpy/typing/tests/data/pass/simple_py3.py
2 issues
Line: 6
Column: 1
array = np.array([1, 2])
# The @ operator is not in python 2
array @ array
Reported by Pylint.
Line: 1
Column: 1
import numpy as np
array = np.array([1, 2])
# The @ operator is not in python 2
array @ array
Reported by Pylint.
numpy/f2py/__version__.py
2 issues
Line: 1
Column: 1
from numpy.version import version
Reported by Pylint.
Line: 1
Column: 1
from numpy.version import version
Reported by Pylint.
numpy/core/src/umath/dispatching.c
1 issues
Line: 370
CWE codes:
908
if (PyCapsule_CheckExact(promoter)) {
/* We could also go the other way and wrap up the python function... */
promoter_function *promoter_function = PyCapsule_GetPointer(promoter,
"numpy._ufunc_promoter");
if (promoter_function == NULL) {
return NULL;
}
promoter_result = promoter_function(ufunc,
Reported by Cppcheck.
numpy/typing/tests/data/pass/numeric.py
1 issues
Line: 11
Column: 1
from typing import List
import numpy as np
class SubClass(np.ndarray):
...
i8 = np.int64(1)
A = np.arange(27).reshape(3, 3, 3)
Reported by Pylint.
numpy/typing/tests/data/pass/ndarray_conversion.py
1 issues
Line: 1
Column: 1
import os
import tempfile
import numpy as np
nd = np.array([[1, 2], [3, 4]])
scalar_array = np.array(1)
# item
Reported by Pylint.
numpy/typing/tests/data/pass/arrayprint.py
1 issues
Line: 1
Column: 1
import numpy as np
AR = np.arange(10)
AR.setflags(write=False)
with np.printoptions():
np.set_printoptions(
precision=1,
threshold=2,
Reported by Pylint.
numpy/typing/tests/data/pass/fromnumeric.py
1 issues
Line: 12
Column: 1
a = np.bool_(True)
b = np.float32(1.0)
c = 1.0
d = np.array(1.0, dtype=np.float32) # writeable
np.take(a, 0)
np.take(b, 0)
np.take(c, 0)
Reported by Pylint.