diff --git a/ncplot/plot.py b/ncplot/plot.py index e049a94..8ad99e0 100644 --- a/ncplot/plot.py +++ b/ncplot/plot.py @@ -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): """ @@ -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 diff --git a/requirements.txt b/requirements.txt index 18a2e62..5c1ed2b 100644 --- a/requirements.txt +++ b/requirements.txt @@ -7,8 +7,5 @@ bokeh panel pandas metpy -#datashader -#cartopy -geoviews>=1.9.4 jinja2<=3.0.3 diff --git a/setup.py b/setup.py index de18ca1..e1fd11c 100755 --- a/setup.py +++ b/setup.py @@ -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', @@ -56,11 +63,7 @@ 'wheel', ], install_requires = REQUIREMENTS, - extras_require={ - ':python_version <= "3.10"': [ - 'datashader', - ], - }, + extras_require = extras_require, zip_safe=False)