ncplot 0.3.8__tar.gz → 0.3.10__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {ncplot-0.3.8 → ncplot-0.3.10}/PKG-INFO +1 -1
- {ncplot-0.3.8 → ncplot-0.3.10}/ncplot/plot.py +12 -29
- {ncplot-0.3.8 → ncplot-0.3.10}/setup.py +1 -1
- {ncplot-0.3.8 → ncplot-0.3.10}/LICENSE +0 -0
- {ncplot-0.3.8 → ncplot-0.3.10}/MANIFEST.in +0 -0
- {ncplot-0.3.8 → ncplot-0.3.10}/README.md +0 -0
- {ncplot-0.3.8 → ncplot-0.3.10}/ncplot/__init__.py +0 -0
- {ncplot-0.3.8 → ncplot-0.3.10}/ncplot/command_line.py +0 -0
- {ncplot-0.3.8 → ncplot-0.3.10}/ncplot/deprecated.py +0 -0
- {ncplot-0.3.8 → ncplot-0.3.10}/ncplot/utils.py +0 -0
- {ncplot-0.3.8 → ncplot-0.3.10}/ncplot/xarray.py +0 -0
- {ncplot-0.3.8 → ncplot-0.3.10}/ncplot.egg-info/SOURCES.txt +0 -0
- {ncplot-0.3.8 → ncplot-0.3.10}/requirements.txt +0 -0
- {ncplot-0.3.8 → ncplot-0.3.10}/setup.cfg +0 -0
|
@@ -165,7 +165,7 @@ def in_notebook(out=None):
|
|
|
165
165
|
return "ipykernel" in sys.modules
|
|
166
166
|
|
|
167
167
|
|
|
168
|
-
def view(x, vars=None, autoscale=True, out=None,
|
|
168
|
+
def view(x, vars=None, autoscale=True, out=None, **kwargs):
|
|
169
169
|
"""
|
|
170
170
|
Plot the contents of a NetCDF out
|
|
171
171
|
|
|
@@ -175,6 +175,9 @@ def view(x, vars=None, autoscale=True, out=None, server = None, **kwargs):
|
|
|
175
175
|
xarray object or file path
|
|
176
176
|
vars : list or str
|
|
177
177
|
Variables you want to plot. Everything will be plotted if this is not supplied
|
|
178
|
+
autoscale : bool
|
|
179
|
+
Set to False if you do not want the colour scales to vary. Defaults to True, which sets
|
|
180
|
+
scales based on minimum and maximum values.
|
|
178
181
|
|
|
179
182
|
out : str
|
|
180
183
|
Name of file if you want to store output
|
|
@@ -244,12 +247,11 @@ def view(x, vars=None, autoscale=True, out=None, server = None, **kwargs):
|
|
|
244
247
|
|
|
245
248
|
coord_list = list(ds.coords)
|
|
246
249
|
|
|
247
|
-
#if vars is None:
|
|
248
|
-
#vars = [x for x in list(ds.data_vars) if x not in coord_list]
|
|
249
|
-
|
|
250
|
-
|
|
251
250
|
|
|
252
251
|
for cc in coord_list:
|
|
252
|
+
new_coords = list(ds.coords)
|
|
253
|
+
if cc not in new_coords:
|
|
254
|
+
continue
|
|
253
255
|
if len(ds[cc].values.ravel()) <= 1:
|
|
254
256
|
if cc in list(ds.dims):
|
|
255
257
|
ds = ds.squeeze(cc, drop=True)
|
|
@@ -479,11 +481,15 @@ def view(x, vars=None, autoscale=True, out=None, server = None, **kwargs):
|
|
|
479
481
|
|
|
480
482
|
coord_list = list(ds.coords)
|
|
481
483
|
|
|
484
|
+
|
|
482
485
|
for cc in coord_list:
|
|
486
|
+
new_coords = list(ds.coords)
|
|
487
|
+
if cc not in new_coords:
|
|
488
|
+
continue
|
|
483
489
|
if len(ds[cc].values.ravel()) <= 1:
|
|
484
490
|
if cc in list(ds.dims):
|
|
485
491
|
ds = ds.squeeze(cc, drop=True)
|
|
486
|
-
|
|
492
|
+
|
|
487
493
|
coord_list = list(ds.coords)
|
|
488
494
|
|
|
489
495
|
coord_list = [x for x in coord_list if x in list(ds.dims)]
|
|
@@ -547,11 +553,6 @@ def view(x, vars=None, autoscale=True, out=None, server = None, **kwargs):
|
|
|
547
553
|
t = Thread(target=ctrc)
|
|
548
554
|
t.start()
|
|
549
555
|
|
|
550
|
-
# create a panel server if server specified
|
|
551
|
-
|
|
552
|
-
bokeh_server = pn.panel(intplot, sizing_mode="stretch_both", websocket_origin = server).show(
|
|
553
|
-
threaded=False
|
|
554
|
-
)
|
|
555
556
|
return None
|
|
556
557
|
|
|
557
558
|
# heat map where 2 coords have more than 1 value, not a spatial map
|
|
@@ -692,9 +693,6 @@ def view(x, vars=None, autoscale=True, out=None, server = None, **kwargs):
|
|
|
692
693
|
|
|
693
694
|
t = Thread(target=ctrc)
|
|
694
695
|
t.start()
|
|
695
|
-
bokeh_server = pn.panel(intplot, sizing_mode="stretch_both").show(
|
|
696
|
-
threaded=False
|
|
697
|
-
)
|
|
698
696
|
return None
|
|
699
697
|
|
|
700
698
|
# heat map where 3 coords have more than 1 value, and one of them is time. Not a spatial map though
|
|
@@ -808,9 +806,6 @@ def view(x, vars=None, autoscale=True, out=None, server = None, **kwargs):
|
|
|
808
806
|
|
|
809
807
|
t = Thread(target=ctrc)
|
|
810
808
|
t.start()
|
|
811
|
-
bokeh_server = pn.panel(intplot, sizing_mode="stretch_both").show(
|
|
812
|
-
threaded=False
|
|
813
|
-
)
|
|
814
809
|
return None
|
|
815
810
|
|
|
816
811
|
if (n_times > 1) and (n_points < 2) and (n_levels <= 1):
|
|
@@ -860,9 +855,6 @@ def view(x, vars=None, autoscale=True, out=None, server = None, **kwargs):
|
|
|
860
855
|
t = Thread(target=ctrc)
|
|
861
856
|
t.start()
|
|
862
857
|
|
|
863
|
-
bokeh_server = pn.panel(intplot, sizing_mode="stretch_both").show(
|
|
864
|
-
threaded=False
|
|
865
|
-
)
|
|
866
858
|
return None
|
|
867
859
|
|
|
868
860
|
if (n_points > 1) and (n_levels >= 1) and (type(vars) is list):
|
|
@@ -929,9 +921,6 @@ def view(x, vars=None, autoscale=True, out=None, server = None, **kwargs):
|
|
|
929
921
|
|
|
930
922
|
t = Thread(target=ctrc)
|
|
931
923
|
t.start()
|
|
932
|
-
bokeh_server = pn.panel(intplot, sizing_mode="stretch_both").show(
|
|
933
|
-
threaded=False
|
|
934
|
-
)
|
|
935
924
|
return None
|
|
936
925
|
|
|
937
926
|
if n_points > 1:
|
|
@@ -1039,9 +1028,6 @@ def view(x, vars=None, autoscale=True, out=None, server = None, **kwargs):
|
|
|
1039
1028
|
|
|
1040
1029
|
t = Thread(target=ctrc)
|
|
1041
1030
|
t.start()
|
|
1042
|
-
bokeh_server = pn.panel(intplot, sizing_mode="stretch_both").show(
|
|
1043
|
-
threaded=False
|
|
1044
|
-
)
|
|
1045
1031
|
return None
|
|
1046
1032
|
|
|
1047
1033
|
else:
|
|
@@ -1135,9 +1121,6 @@ def view(x, vars=None, autoscale=True, out=None, server = None, **kwargs):
|
|
|
1135
1121
|
|
|
1136
1122
|
t = Thread(target=ctrc)
|
|
1137
1123
|
t.start()
|
|
1138
|
-
bokeh_server = pn.panel(intplot, sizing_mode="stretch_both").show(
|
|
1139
|
-
threaded=False
|
|
1140
|
-
)
|
|
1141
1124
|
|
|
1142
1125
|
return None
|
|
1143
1126
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|