summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhippo91 <guillaume.peillex@gmail.com>2019-12-30 14:39:58 +0100
committerClaudiu Popa <pcmanticore@gmail.com>2019-12-30 14:39:58 +0100
commit67321ee2f97b5b096acee9d2395a32bb6e68083a (patch)
tree8467801810c01fb55afe8cae0dcf82efeb84781d
parent1344a1cb42b17c644116cc2f50d54b37ac07167f (diff)
downloadastroid-git-67321ee2f97b5b096acee9d2395a32bb6e68083a.tar.gz
Add the float_power function in the brain and in its associated test
The bug PyCQA/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 PyCQA/pylint#3319
-rw-r--r--ChangeLog4
-rw-r--r--astroid/brain/brain_numpy_core_umath.py6
-rw-r--r--tests/unittest_brain_numpy_core_umath.py6
3 files changed, 16 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index b612aee0..ea5a838d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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
diff --git a/astroid/brain/brain_numpy_core_umath.py b/astroid/brain/brain_numpy_core_umath.py
index 9e03bb9e..f23c01da 100644
--- a/astroid/brain/brain_numpy_core_umath.py
+++ b/astroid/brain/brain_numpy_core_umath.py
@@ -88,6 +88,7 @@ def numpy_core_umath_transform():
logical_not = FakeUfuncOneArg()
modf = FakeUfuncOneArgBis()
negative = FakeUfuncOneArg()
+ positive = FakeUfuncOneArg()
rad2deg = FakeUfuncOneArg()
reciprocal = FakeUfuncOneArg()
rint = FakeUfuncOneArg()
@@ -106,13 +107,18 @@ def numpy_core_umath_transform():
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()
diff --git a/tests/unittest_brain_numpy_core_umath.py b/tests/unittest_brain_numpy_core_umath.py
index 51b696f6..9ae8b9ff 100644
--- a/tests/unittest_brain_numpy_core_umath.py
+++ b/tests/unittest_brain_numpy_core_umath.py
@@ -47,6 +47,7 @@ class NumpyBrainCoreUmathTest(unittest.TestCase):
"logical_not",
"modf",
"negative",
+ "positive",
"rad2deg",
"reciprocal",
"rint",
@@ -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",