Skip to content

Commit 25d4375

Browse files
thearnTristan
authored andcommitted
fixed core functions for python3 compatibility
1 parent 833c7e4 commit 25d4375

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ install:
1414
- sudo apt-get install $PYTHON-setuptools
1515
- sudo apt-get install $PYTHON-nose
1616
- sudo easy_install$PYSUF pip
17+
- sudo pip install Pillow
1718
- if [[ $PYVER == '2.7' ]]; then sudo apt-get install $PYTHON-matplotlib; fi
1819
- if [[ $PYVER == '3.2' ]]; then sudo pip-$PYVER install git+git://github.com/matplotlib/[email protected]; fi
1920
- $PYTHON setup.py build

stl_tools/test/test_stl.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
import unittest
44
import os
55
import numpy as np
6-
from scipy.misc import imresize
76
from stl_tools import text2array, numpy2stl, text2png
87

98
"""
@@ -38,23 +37,23 @@ def test_png(self):
3837
"""
3938
output_name = "OUT_.stl"
4039
# test ascii output
41-
A = imresize([[0, 1], [1, 0]], (64, 64))
40+
A = 100*np.random.randn(64, 64)
4241
numpy2stl(A, output_name, scale=0.05, mask_val=3., ascii=True)
4342
assert os.path.exists(output_name)
44-
assert os.stat(output_name).st_size > 1500000
43+
assert os.stat(output_name).st_size > 1e5
4544

4645
# test binary output
47-
numpy2stl(A, output_name, scale=0.05, mask_val=3., ascii=False)
46+
numpy2stl(A, output_name, scale=0.05, mask_val=3.)
4847
assert os.path.exists(output_name)
49-
assert os.stat(output_name).st_size > 200000
48+
assert os.stat(output_name).st_size > 1e5
5049
os.remove(output_name)
5150

5251
def test_calc_normals(self):
5352
output_name = "OUT_.stl"
54-
A = imresize([[0, 1], [1, 0]], (64, 64))
53+
A = 100*np.random.randn(64, 64)
5554
numpy2stl(A, output_name, scale=0.05, mask_val=3., calc_normals=True)
5655
assert os.path.exists(output_name)
57-
assert os.stat(output_name).st_size > 200000
56+
assert os.stat(output_name).st_size > 1e5
5857
os.remove(output_name)
5958

6059
if __name__ == '__main__':

0 commit comments

Comments
 (0)