Skip to content

Commit 83df3d6

Browse files
author
stephaniegott
committed
import xarray in Velocity, remove dependecy
1 parent c606fc5 commit 83df3d6

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

ipyleaflet/leaflet.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -329,6 +329,15 @@ class VideoOverlay(RasterLayer):
329329

330330

331331
class Velocity(Layer):
332+
try:
333+
import xarray
334+
except ModuleNotFoundError:
335+
raise ImportError(
336+
'The `xarray` module (required for use of the Velocity layer) is'
337+
'not installed. Run "$ pip install xarray" to install the latest'
338+
'version.'
339+
)
340+
332341
_view_name = Unicode('LeafletVelocityView').tag(sync=True)
333342
_model_name = Unicode('LeafletVelocityModel').tag(sync=True)
334343

setup.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,7 @@ def run(self):
137137
'install_requires': [
138138
'ipywidgets>=7.5.0,<8',
139139
'traittypes>=0.2.1,<3',
140-
'xarray>=0.10',
141-
'branca>=0.3.1,<0.4'
140+
'branca>=0.3.1,<0.4',
142141
],
143142
'packages': find_packages(),
144143
'zip_safe': False,

0 commit comments

Comments
 (0)