Skip to content

Commit

Permalink
Add the float_power function in the brain and in its associated test
Browse files Browse the repository at this point in the history
The bug pylint-dev/pylint#3319 was caused due to a missing function, named float_power inside the brain_numpy_core_umath module. This brain is used to infer all the numpy's ufunc functions. The problem is that in the website documentation of numpy, in the section that list all those functions, there is not entry dealing with the float_power function.

Also adds 5 missing functions detected by @texadactyl

Closes pylint-dev/pylint#3319
  • Loading branch information
hippo91 authored and PCManticore committed Dec 30, 2019
1 parent 1344a1c commit 67321ee
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
4 changes: 4 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ What's New in astroid 2.4.0?
============================
Release Date: TBA

* Added some functions to the ``brain_numpy_core_umath`` module

Close PyCQA/pylint#3319

* Added some functions of the ``numpy.core.multiarray`` module

Close PyCQA/pylint#3208
Expand Down
6 changes: 6 additions & 0 deletions astroid/brain/brain_numpy_core_umath.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ def __call__(self, x1, x2, {opt_args:s}):
logical_not = FakeUfuncOneArg()
modf = FakeUfuncOneArgBis()
negative = FakeUfuncOneArg()
positive = FakeUfuncOneArg()
rad2deg = FakeUfuncOneArg()
reciprocal = FakeUfuncOneArg()
rint = FakeUfuncOneArg()
Expand All @@ -106,13 +107,18 @@ def __call__(self, x1, x2, {opt_args:s}):
bitwise_xor = FakeUfuncTwoArgs()
copysign = FakeUfuncTwoArgs()
divide = FakeUfuncTwoArgs()
divmod = FakeUfuncTwoArgs()
equal = FakeUfuncTwoArgs()
float_power = FakeUfuncTwoArgs()
floor_divide = FakeUfuncTwoArgs()
fmax = FakeUfuncTwoArgs()
fmin = FakeUfuncTwoArgs()
fmod = FakeUfuncTwoArgs()
greater = FakeUfuncTwoArgs()
gcd = FakeUfuncTwoArgs()
hypot = FakeUfuncTwoArgs()
heaviside = FakeUfuncTwoArgs()
lcm = FakeUfuncTwoArgs()
ldexp = FakeUfuncTwoArgs()
left_shift = FakeUfuncTwoArgs()
less = FakeUfuncTwoArgs()
Expand Down
6 changes: 6 additions & 0 deletions tests/unittest_brain_numpy_core_umath.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ class NumpyBrainCoreUmathTest(unittest.TestCase):
"logical_not",
"modf",
"negative",
"positive",
"rad2deg",
"reciprocal",
"rint",
Expand All @@ -65,13 +66,18 @@ class NumpyBrainCoreUmathTest(unittest.TestCase):
"bitwise_xor",
"copysign",
"divide",
"divmod",
"equal",
"float_power",
"floor_divide",
"fmax",
"fmin",
"fmod",
"gcd",
"greater",
"heaviside",
"hypot",
"lcm",
"ldexp",
"left_shift",
"less",
Expand Down

0 comments on commit 67321ee

Please sign in to comment.