BUG: More Python3 fixes by Christoph Gohlke.

This commit is contained in:
Stefan van der Walt
2011-03-14 17:06:22 +02:00
parent 4760fc3dd4
commit 082ff69549
6 changed files with 18 additions and 8 deletions
+3 -3
View File
@@ -12,7 +12,7 @@ Original author: Lee Kamentsky
'''
import numpy as np
import _ctmf
from . import _ctmf
from rank_order import rank_order
def median_filter(data, mask=None, radius=1, percent=50):
@@ -59,7 +59,7 @@ def median_filter(data, mask=None, radius=1, percent=50):
if max_ranked_data == 0:
return data
if max_ranked_data > 255:
ranked_data = ranked_data * 255 / max_ranked_data
ranked_data = ranked_data * 255 // max_ranked_data
was_ranked = True
else:
ranked_data = data[mask]
@@ -78,7 +78,7 @@ def median_filter(data, mask=None, radius=1, percent=50):
# use the translation to look up the original value in the data.
#
if max_ranked_data > 255:
result = translation[output.astype(np.uint32) * max_ranked_data / 255]
result = translation[output.astype(np.uint32) * max_ranked_data // 255]
else:
result = translation[output]
else:
+1 -1
View File
@@ -1,4 +1,4 @@
from _mcp import MCP, MCP_Geometric, make_offsets
from ._mcp import MCP, MCP_Geometric, make_offsets
def route_through_array(array, start, end, fully_connected=True, geometric=True):
"""Simple example of how to use the MCP and MCP_Geometric classes.
+1 -1
View File
@@ -1,5 +1,5 @@
import numpy as np
import _spath
from . import _spath
def shortest_path(arr, reach=1, axis=-1, output_indexlist=False):
"""Find the shortest path through an n-d array from one side to another.
+2 -2
View File
@@ -1,6 +1,6 @@
import numpy as np
import _colormixer
import _histograms
from . import _colormixer
from . import _histograms
import threading
# utilities to make life easier for plugin writers.
@@ -1,3 +1,4 @@
import sys
import os.path
import numpy as np
@@ -7,6 +8,10 @@ from scikits.image import data_dir
from scikits.image.io import ImageCollection, MultiImage
if sys.version_info[0] > 2:
basestring = str
class TestImageCollection():
pattern = [os.path.join(data_dir, pic) for pic in ['camera.png',
'color.png']]
+6 -1
View File
@@ -3,13 +3,18 @@
from __future__ import with_statement
import os
import sys
import warnings
import numpy as np
from numpy.testing import *
from scikits.image import data_dir
import cPickle
if sys.version_info[0] < 3:
import cPickle
else:
import pickle as cPickle
with warnings.catch_warnings():
warnings.simplefilter("ignore")