Skip to content

Commit 4bdc580

Browse files
Stop using deprecated pkg_resources
Use NumPy’s own `np.lib.NumpyVersion` to test NumPy versions. Fixes #67
1 parent 255824f commit 4bdc580

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/pyemd/emd.pyx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
# distutils: language = c++
44
# emd.pyx
55

6-
from pkg_resources import parse_version
7-
86
from libcpp.pair cimport pair
97
from libcpp.vector cimport vector
108
import cython
@@ -142,7 +140,7 @@ def euclidean_pairwise_distance_matrix(x):
142140

143141

144142
# Use `np.histogram_bin_edges` if available (since NumPy version 1.15.0)
145-
if parse_version(np.__version__) >= parse_version('1.15.0'):
143+
if np.lib.NumpyVersion(np.__version__) >= np.lib.NumpyVersion('1.15.0'):
146144
get_bins = np.histogram_bin_edges
147145
else:
148146
def get_bins(a, bins=10, **kwargs):

0 commit comments

Comments
 (0)