Skip to content

Commit

Permalink
Merge pull request #858 from arokem/fixes-for-np-1.11
Browse files Browse the repository at this point in the history
Updates for upcoming numpy 1.11 release
  • Loading branch information
Garyfallidis committed Feb 9, 2016
2 parents 52d564c + 4b33282 commit f1ea967
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion dipy/direction/peaks.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ def _peaks_from_model_parallel(model, data, sphere, relative_peak_threshold,
mode='w+',
shape=(data.shape[0], npeaks))
if return_sh:
nbr_shm_coeff = (sh_order + 2) * (sh_order + 1) / 2
nbr_shm_coeff = (sh_order + 2) * (sh_order + 1) // 2
pam.shm_coeff = np.memmap(path.join(tmpdir, 'shm.npy'),
dtype=pam_res[0].shm_coeff.dtype,
mode='w+',
Expand Down
2 changes: 1 addition & 1 deletion dipy/reconst/tests/test_shm.py
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ def test_SphHarmFit():
assert_equal(item.shape, ())
slice = fit[0]
assert_equal(slice.shape, (4, 5))
slice = fit[..., 0]
slice = fit[:, :, 0]
assert_equal(slice.shape, (3, 4))


Expand Down
6 changes: 3 additions & 3 deletions dipy/tracking/local/tests/test_local_tracking.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class SimpleDirectionGetter(DirectionGetter):
def initial_direction(self, point):
# Test tracking along the rows (z direction)
# of the tissue array above
p = np.round(point)
p = np.round(point).astype(int)
if (any(p < 0) or
any(p >= tissue.shape) or
tissue[p[0], p[1], p[2]] == TissueTypes.INVALIDPOINT):
Expand Down Expand Up @@ -151,10 +151,10 @@ def get_direction(self, p, d):
npt.assert_equal(sl[-1], seeds[y])
npt.assert_equal(len(sl), 1)

bad_affine = np.eye(3.)
bad_affine = np.eye(3)
npt.assert_raises(ValueError, LocalTracking, dg, tc, seeds, bad_affine, 1.)

bad_affine = np.eye(4.)
bad_affine = np.eye(4)
bad_affine[0, 1] = 1.
npt.assert_raises(ValueError, LocalTracking, dg, tc, seeds, bad_affine, 1.)

Expand Down
2 changes: 1 addition & 1 deletion dipy/tracking/tests/test_markov.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ def fit(self, data):

class MyFit(object):
def __init__(self, n):
self.n = n
self.n = int(n)

def odf(self, sphere):
return odf_list[self.n]
Expand Down

0 comments on commit f1ea967

Please sign in to comment.