@@ -1057,7 +1057,8 @@ def get_xname(self, var, coords=None):
1057
1057
PsyPlotRuntimeWarning )
1058
1058
return dimlist [0 ]
1059
1059
# otherwise we return the coordinate in the last position
1060
- return var .dims [- 1 ]
1060
+ if var .dims :
1061
+ return var .dims [- 1 ]
1061
1062
1062
1063
@docstrings .get_sections (base = "CFDecoder.get_y" , sections = [
1063
1064
'Parameters' , 'Returns' ])
@@ -1126,9 +1127,10 @@ def get_yname(self, var, coords=None):
1126
1127
return dimlist [0 ]
1127
1128
# otherwise we return the coordinate in the last or second last
1128
1129
# position
1129
- if self .is_unstructured (var ):
1130
- return var .dims [- 1 ]
1131
- return var .dims [- 2 if var .ndim > 1 else - 1 ]
1130
+ if var .dims :
1131
+ if self .is_unstructured (var ):
1132
+ return var .dims [- 1 ]
1133
+ return var .dims [- 2 if var .ndim > 1 else - 1 ]
1132
1134
1133
1135
@docstrings .get_sections (base = "CFDecoder.get_z" , sections = [
1134
1136
'Parameters' , 'Returns' ])
@@ -1200,12 +1202,13 @@ def get_zname(self, var, coords=None):
1200
1202
PsyPlotRuntimeWarning )
1201
1203
return dimlist [0 ]
1202
1204
# otherwise we return the coordinate in the third last position
1203
- is_unstructured = self .is_unstructured (var )
1204
- icheck = - 2 if is_unstructured else - 3
1205
- min_dim = abs (icheck ) if 'variable' not in var .dims else abs (icheck - 1 )
1206
- if var .ndim >= min_dim and var .dims [icheck ] != self .get_tname (
1207
- var , coords ):
1208
- return var .dims [icheck ]
1205
+ if var .dims :
1206
+ is_unstructured = self .is_unstructured (var )
1207
+ icheck = - 2 if is_unstructured else - 3
1208
+ min_dim = abs (icheck ) if 'variable' not in var .dims else abs (icheck - 1 )
1209
+ if var .ndim >= min_dim and var .dims [icheck ] != self .get_tname (
1210
+ var , coords ):
1211
+ return var .dims [icheck ]
1209
1212
return None
1210
1213
1211
1214
@docstrings .get_sections (base = "CFDecoder.get_t" , sections = [
0 commit comments