Skip to content

Commit 71a9c4c

Browse files
authored
Merge pull request #172 from AllenInstitute/test_fixes
Test fixes
2 parents 118b0b1 + 5d7e85b commit 71a9c4c

File tree

3 files changed

+13
-10
lines changed

3 files changed

+13
-10
lines changed

integration_tests/test_stack_integrated.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ def render():
3232

3333
@pytest.fixture
3434
def simpletilespec():
35-
mml = renderapi.image_pyramid.MipMapLevel(0, '/not/a/path.jpg')
35+
mm = renderapi.image_pyramid.MipMap(imageUrl='file://not/a/path.jpg')
36+
ip = renderapi.image_pyramid.ImagePyramid({0: mm})
3637
tform = renderapi.transform.AffineModel(labels=['simple'])
3738
layout = renderapi.tilespec.Layout(sectionId="section0",
3839
scopeId="testscope",
@@ -45,7 +46,7 @@ def simpletilespec():
4546
ts = renderapi.tilespec.TileSpec(tileId="1000",
4647
width=2048,
4748
height=2048,
48-
mipMapLevels=[mml],
49+
imagePyramid=ip,
4950
z=0,
5051
tforms=[tform],
5152
layout=layout)

renderapi/transform/leaf/polynomial_models.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
logger.info(e)
1111
logger.info('scipy-based linalg may or may not lead '
1212
'to better parameter fitting')
13-
from numpy.linalg import svd
14-
from numpy.linalg.linalg import LinAlgError
13+
from numpy.linalg import svd, LinAlgError
14+
1515
__all__ = [
1616
'Polynomial2DTransform', 'NonLinearCoordinateTransform',
1717
'NonLinearTransform', 'LensCorrection']

test/test_imagepyramid.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -74,18 +74,20 @@ def test_pyramid_deserialize():
7474

7575

7676
def test_mipmaplevel_deprecated():
77-
mml = image_pyramid.MipMapLevel(0,
78-
imageUrl=image_filename,
79-
maskUrl=mask_filename)
77+
with pytest.deprecated_call():
78+
mml = image_pyramid.MipMapLevel(
79+
0,
80+
imageUrl=image_filename,
81+
maskUrl=mask_filename)
8082
assert(mml['imageUrl'] == image_filename)
8183
assert(mml['maskUrl'] == mask_filename)
8284
with pytest.raises(KeyError):
8385
mml['not_a_key']
8486

8587
assert(mml == mml)
86-
87-
mml2 = image_pyramid.MipMapLevel(0,
88-
imageUrl=image_filename)
88+
with pytest.deprecated_call():
89+
mml2 = image_pyramid.MipMapLevel(0,
90+
imageUrl=image_filename)
8991
assert(mml != mml2)
9092
assert(len([k for k, v in mml]) == 2)
9193

0 commit comments

Comments
 (0)