Skip to content

Commit

Permalink
change geoviews to extra req
Browse files Browse the repository at this point in the history
  • Loading branch information
robertjwilson committed Mar 1, 2023
1 parent 82b3dd4 commit 1c0676c
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 9 deletions.
13 changes: 12 additions & 1 deletion ncplot/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,17 @@
hv.extension("bokeh")
hv.Store.renderers

def as_raster():
"""
Simple hack to rasterize when datashader is available.
This is to get around Python 3.11 datashader nonavailability
"""
try:
import datashader
return True
except:
return False


def get_coastline(ds, lon_name, lat_name):
"""
Expand Down Expand Up @@ -286,7 +297,7 @@ def view(x, vars=None, autoscale=True, out=None, **kwargs):
switch_coords = False

try:
import datashader
#import datashader
rasterize = True
except:
rasterize = False
Expand Down
3 changes: 0 additions & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,5 @@ bokeh
panel
pandas
metpy
#datashader
#cartopy
geoviews>=1.9.4
jinja2<=3.0.3

13 changes: 8 additions & 5 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,13 @@
except IOError:
long_description = DESCRIPTION

extras_require: dict[str, list[str]] = {
':python_version <= "3.10"': [
'datashader',
],
}

extras_require["complete"] = ["geoviews"]

setup(name='ncplot',
version='0.2.9',
Expand Down Expand Up @@ -56,11 +63,7 @@
'wheel',
],
install_requires = REQUIREMENTS,
extras_require={
':python_version <= "3.10"': [
'datashader',
],
},
extras_require = extras_require,
zip_safe=False)


Expand Down

0 comments on commit 1c0676c

Please sign in to comment.