Skip to content

Commit a2e1c2f

Browse files
committed
FIX: import error on non-osx platform
1 parent 5ce4ede commit a2e1c2f

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

chaco/lod_image_plot.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,19 @@
11
from contextlib import contextmanager
22

3-
import numpy as np
4-
53
from enable.base import intersect_bounds
6-
from kiva.quartz.ABCGI import InterpolationQuality
74
from traits.api import (
8-
Bool, Event, Instance, Int, List, Property,
5+
Event, Instance, Int, List, Property,
96
cached_property, on_trait_change
107
)
11-
8+
try:
9+
# InterpolationQuality required for Quartz backend only (requires OSX).
10+
from kiva.quartz.ABCGI import InterpolationQuality
11+
except ImportError:
12+
pass
13+
else:
14+
KIVA_INTERP_QUALITY = {"nearest": InterpolationQuality.none,
15+
"bilinear": InterpolationQuality.low,
16+
"bicubic": InterpolationQuality.high}
1217
try:
1318
from encore.concurrent.futures.serializer import Serializer
1419
from encore.concurrent.futures.enhanced_thread_pool_executor import \
@@ -21,11 +26,6 @@
2126
from .image_plot import ImagePlot
2227

2328

24-
KIVA_INTERP_QUALITY = {"nearest": InterpolationQuality.none,
25-
"bilinear": InterpolationQuality.low,
26-
"bicubic": InterpolationQuality.high}
27-
28-
2929
class LODImagePlot(ImagePlot):
3030
"""Image renderer using data sources that don't directly expose their data
3131
and has pre-calculated LOD images.

0 commit comments

Comments
 (0)