Skip to content

Commit

Permalink
[MRG] Fixes issue PythonOT#239 (deprecated numpy types) (PythonOT#244)
Browse files Browse the repository at this point in the history
* remove warning numpy int?

* use long long

* stoupid mistake

* cleanup double test run in PR from local branch
  • Loading branch information
rflamary authored Apr 21, 2021
1 parent cd3ce61 commit 0d99501
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/build_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@ name: Tests
on:
workflow_dispatch:
pull_request:
branches:
- 'master'
push:
branches:
- '**'
- 'master'
create:
branches:
- 'master'
Expand Down
6 changes: 2 additions & 4 deletions ot/lp/emd_wrap.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,6 @@ def emd_c(np.ndarray[double, ndim=1, mode="c"] a, np.ndarray[double, ndim=1, mod
cdef np.ndarray[double, ndim=2, mode="c"] G=np.zeros([0, 0])

cdef np.ndarray[double, ndim=1, mode="c"] Gv=np.zeros(0)
cdef np.ndarray[long, ndim=1, mode="c"] iG=np.zeros(0,dtype=np.int)
cdef np.ndarray[long, ndim=1, mode="c"] jG=np.zeros(0,dtype=np.int)

if not len(a):
a=np.ones((n1,))/n1
Expand Down Expand Up @@ -169,8 +167,8 @@ def emd_1d_sorted(np.ndarray[double, ndim=1, mode="c"] u_weights,

cdef np.ndarray[double, ndim=1, mode="c"] G = np.zeros((n + m - 1, ),
dtype=np.float64)
cdef np.ndarray[long, ndim=2, mode="c"] indices = np.zeros((n + m - 1, 2),
dtype=np.int)
cdef np.ndarray[long long, ndim=2, mode="c"] indices = np.zeros((n + m - 1, 2),
dtype=np.int64)
cdef Py_ssize_t cur_idx = 0
while True:
if metric == 'sqeuclidean':
Expand Down

0 comments on commit 0d99501

Please sign in to comment.