E: 58,17: spatial.cKDTree is not callable (not-callable)
spatial.cKDTree run well in my project, I want to know why Pylint gives error.
For me, spatial.cKDTree is callable in ipython, Pylint should not be seeing this as error.
pylint 1.7.2,
astroid 1.5.3
Python 3.6.0 |Continuum Analytics, Inc.| (default, Dec 23 2016, 13:19:00)
[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.57)]
Can you provide a short reproducing example? I can't reproduce this bug with the example you gave. Also I tried instantiating the class and Pylint didn't complain at all.
pylint_test_scipy.py
def nearest_ckdtree(self, cities):
"""
we have m (n, 2) cities and we need to find time series of temperature from
reanalysis/station obsevations whose coordinates are grids (n, 2)
Args:
cities: m cities of (lat, lon in each row)
Returns:
lists whose length is same as cities, each element of (indexes, dist) is the index of
nearest point and the distance between the city and the point.
"""
import scipy.spatial as spatial
# points: n points of (lat, lon in each row)
points = []
for ix in self.lons:
for iy in self.lats:
points.append([iy, ix])
mytree = spatial.cKDTree(points)
dist, indexes = mytree.query(cities)
return dist, indexes"
pylint --rcfile pylint.conf pylint_test_scipy.py gives *** Module pylint_test_scipy
E: 20,17: spatial.cKDTree is not callable (not-callable)
Most helpful comment
pylint --rcfile pylint.conf pylint_test_scipy.pygives