Skip to content

Commit 60d7f14

Browse files
committed
Merge branch 'parcel-buffer' into integration
* parcel-buffer: RF+BF: work round Windows not having longcomplex BF: use safe Python 2 / 3 check for number BF: fix various Windows errors
2 parents 5861fc1 + 9c29a39 commit 60d7f14

File tree

4 files changed

+9
-6
lines changed

4 files changed

+9
-6
lines changed

nipy/algorithms/group/parcel_analysis.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ def __init__(self, con_imgs, parcel_img, parcel_info=None,
251251
# load the parcellation and resample it at the appropriate
252252
# resolution
253253
self.reference = parcel_img.reference
254-
self.parcel_full_res = parcel_img.get_data().astype('uint').squeeze()
254+
self.parcel_full_res = parcel_img.get_data().astype('uintp').squeeze()
255255
self.affine_full_res = xyz_affine(parcel_img)
256256
parcel_img = make_xyz_image(self.parcel_full_res,
257257
self.affine_full_res,
@@ -261,7 +261,7 @@ def __init__(self, con_imgs, parcel_img, parcel_info=None,
261261
reference=(self.con_imgs[0].shape,
262262
self.affine),
263263
interp_order=0)
264-
self.parcel = parcel_img_rsp.get_data().astype('uint').squeeze()
264+
self.parcel = parcel_img_rsp.get_data().astype('uintp').squeeze()
265265
if self.msk is None:
266266
self.msk = self.parcel > 0
267267

nipy/algorithms/registration/histogram_registration.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
from .similarity_measures import similarity_measures as _sms
2020
from ._registration import _joint_histogram
2121

22-
MAX_INT = np.iinfo(np.intp).max
22+
MAX_INT = np.iinfo(np.int).max
2323

2424
# Module globals
2525
VERBOSE = True # enables online print statements

nipy/algorithms/segmentation/tests/test_segmentation.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
"""
33
from __future__ import absolute_import
44

5+
from numbers import Number
6+
57
import numpy as np
68

79
from nose.tools import assert_equal, assert_almost_equal
@@ -20,8 +22,8 @@
2022

2123

2224
def _check_dims(x, ndim, shape):
23-
if isinstance(shape, int):
24-
shape = (shape, )
25+
if isinstance(shape, Number):
26+
shape = (shape,)
2527
for i in range(ndim):
2628
assert_equal(x.shape[i], shape[i])
2729

nipy/core/reference/tests/test_coordinate_map.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@
3131
[np.object])
3232
# Sympy <= 1.1 does not handle numpy longcomplex correctly. See:
3333
# https://github.com/sympy/sympy/pull/12901
34-
_SYMPY_SAFE_DTYPES.remove(np.longcomplex)
34+
if np.longcomplex in _SYMPY_SAFE_DTYPES: # Not present for Windows
35+
_SYMPY_SAFE_DTYPES.remove(np.longcomplex)
3536

3637

3738
class empty(object):

0 commit comments

Comments
 (0)