ncplot 0.3.12__tar.gz → 0.3.13__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.12 → ncplot-0.3.13}/PKG-INFO +1 -1
- {ncplot-0.3.12 → ncplot-0.3.13}/ncplot/plot.py +9 -10
- {ncplot-0.3.12 → ncplot-0.3.13}/setup.py +1 -1
- {ncplot-0.3.12 → ncplot-0.3.13}/LICENSE +0 -0
- {ncplot-0.3.12 → ncplot-0.3.13}/MANIFEST.in +0 -0
- {ncplot-0.3.12 → ncplot-0.3.13}/README.md +0 -0
- {ncplot-0.3.12 → ncplot-0.3.13}/ncplot/__init__.py +0 -0
- {ncplot-0.3.12 → ncplot-0.3.13}/ncplot/command_line.py +0 -0
- {ncplot-0.3.12 → ncplot-0.3.13}/ncplot/deprecated.py +0 -0
- {ncplot-0.3.12 → ncplot-0.3.13}/ncplot/utils.py +0 -0
- {ncplot-0.3.12 → ncplot-0.3.13}/ncplot/xarray.py +0 -0
- {ncplot-0.3.12 → ncplot-0.3.13}/ncplot.egg-info/SOURCES.txt +0 -0
- {ncplot-0.3.12 → ncplot-0.3.13}/pyproject.toml +0 -0
- {ncplot-0.3.12 → ncplot-0.3.13}/requirements.txt +0 -0
- {ncplot-0.3.12 → ncplot-0.3.13}/setup.cfg +0 -0
|
@@ -495,7 +495,7 @@ def view(x, vars=None, autoscale=True, out=None, **kwargs):
|
|
|
495
495
|
coord_list = [x for x in coord_list if x in list(ds.dims)]
|
|
496
496
|
|
|
497
497
|
coord_df = pd.DataFrame(
|
|
498
|
-
{"coord": coord_list, "
|
|
498
|
+
{"coord": coord_list, "coord_length": [len(ds.coords[x].values) for x in coord_list]}
|
|
499
499
|
)
|
|
500
500
|
|
|
501
501
|
# It's possible there are still 2 time variables in the dimensions which could cause problems...
|
|
@@ -515,7 +515,7 @@ def view(x, vars=None, autoscale=True, out=None, **kwargs):
|
|
|
515
515
|
if (len(ds[lon_name].values) > 1) and (len(ds[lat_name].values) > 1):
|
|
516
516
|
spatial_map = True
|
|
517
517
|
|
|
518
|
-
if len([x for x in coord_df.
|
|
518
|
+
if len([x for x in coord_df.coord_length if x > 1]) == 1 and spatial_map is False:
|
|
519
519
|
|
|
520
520
|
df = ds.to_dataframe()
|
|
521
521
|
if nc_vars is not None:
|
|
@@ -556,12 +556,11 @@ def view(x, vars=None, autoscale=True, out=None, **kwargs):
|
|
|
556
556
|
return None
|
|
557
557
|
|
|
558
558
|
# heat map where 2 coords have more than 1 value, not a spatial map
|
|
559
|
-
if len([x for x in coord_df.
|
|
559
|
+
if len([x for x in coord_df.coord_length if x > 1]) == 2 and spatial_map is False:
|
|
560
560
|
|
|
561
561
|
df = ds.to_dataframe().reset_index()
|
|
562
|
-
x_var = coord_df.query("
|
|
563
|
-
y_var = coord_df.query("
|
|
564
|
-
|
|
562
|
+
x_var = coord_df.query("coord_length > 1").reset_index().coord[0]
|
|
563
|
+
y_var = coord_df.query("coord_length > 1").reset_index().coord[1]
|
|
565
564
|
selection = [x for x in df.columns if x in vars or x == x_var or x == y_var]
|
|
566
565
|
|
|
567
566
|
df = df.loc[:, selection].melt([x_var, y_var]).drop_duplicates()
|
|
@@ -696,18 +695,18 @@ def view(x, vars=None, autoscale=True, out=None, **kwargs):
|
|
|
696
695
|
return None
|
|
697
696
|
|
|
698
697
|
# heat map where 3 coords have more than 1 value, and one of them is time. Not a spatial map though
|
|
699
|
-
if len([x for x in coord_df.
|
|
698
|
+
if len([x for x in coord_df.coord_length if x > 1]) == 3:
|
|
700
699
|
|
|
701
700
|
non_map = True
|
|
702
701
|
|
|
703
702
|
if lon_name is not None and lat_name is not None:
|
|
704
703
|
if (lon_name is not None) and (lon_name in list(ds.coords)):
|
|
705
|
-
lons = int(coord_df.query("coord == @lon_name").
|
|
704
|
+
lons = int(coord_df.query("coord == @lon_name").coord_length.values[0])
|
|
706
705
|
else:
|
|
707
706
|
lons = 0
|
|
708
707
|
|
|
709
708
|
if (lat_name) is not None and (lat_name in list(ds.coords)):
|
|
710
|
-
lats = int(coord_df.query("coord == @lat_name").
|
|
709
|
+
lats = int(coord_df.query("coord == @lat_name").coord_length.values[0])
|
|
711
710
|
else:
|
|
712
711
|
lats = 0
|
|
713
712
|
|
|
@@ -725,7 +724,7 @@ def view(x, vars=None, autoscale=True, out=None, **kwargs):
|
|
|
725
724
|
|
|
726
725
|
if time_name in coord_list and time_in and non_map:
|
|
727
726
|
|
|
728
|
-
if coord_df.query("coord == @time_name").
|
|
727
|
+
if coord_df.query("coord == @time_name").coord_length.values[0] > 1:
|
|
729
728
|
|
|
730
729
|
df = ds.to_dataframe().reset_index()
|
|
731
730
|
for x in list(ds.coords):
|
|
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
|
|
File without changes
|