@@ -206,12 +206,12 @@ cdef _set_att(file, int varid, name, value,\
206
206
file_id = file ._ncid
207
207
# put attribute value into a np array.
208
208
value_arr = np.array(value)
209
- if value_arr.ndim > 1 : # issue #841
209
+ if value_arr.ndim > 1 :
210
210
raise ValueError (' multi-dimensional array attributes not supported' )
211
211
N = value_arr.size
212
212
213
213
if value_arr.dtype.char in [' S' ,' U' ]:
214
- # don't allow string array attributes in NETCDF3 files.
214
+ # don't allow string array attributes
215
215
if N > 1 :
216
216
msg= ' array string attributes not supported'
217
217
if not value_arr.shape:
@@ -221,7 +221,7 @@ cdef _set_att(file, int varid, name, value,\
221
221
dats = _strencode(' ' .join(value_arr1.tolist()))
222
222
lenarr = len (dats)
223
223
datstring = dats
224
- # TODO: resolve the special case when set attribute to none(\177)
224
+ # TODO: resolve the special case when set attribute to none
225
225
with nogil:
226
226
ierr = ncmpi_put_att_text(file_id, varid, attname, lenarr, datstring)
227
227
_check_err(ierr, err_cls = AttributeError )
@@ -551,7 +551,7 @@ cdef _StartCountStride(elem, shape, dimensions=None, file=None, datashape=None,
551
551
try :
552
552
dimname = dimensions[i]
553
553
unlim = unlimd[dimname]
554
- except IndexError : # more slices than dimensions (issue 371)
554
+ except IndexError :
555
555
unlim = False
556
556
else :
557
557
unlim = False
@@ -616,7 +616,6 @@ cdef _StartCountStride(elem, shape, dimensions=None, file=None, datashape=None,
616
616
ee = False
617
617
if ee and len (e) == len (ee) and (e == np.arange(start,stop,step)).all():
618
618
# don't convert to slice unless abs(stride) == 1
619
- # (nc_get_vars is very slow, issue #680)
620
619
newElem.append(slice (start,stop,step))
621
620
else :
622
621
newElem.append(e)
@@ -648,15 +647,14 @@ cdef _StartCountStride(elem, shape, dimensions=None, file=None, datashape=None,
648
647
else :
649
648
sdim.append(1 )
650
649
651
- # broadcast data shape when assigned to full variable (issue #919)
650
+ # broadcast data shape when assigned to full variable
652
651
try :
653
652
fullslice = elem.count(slice (None ,None ,None )) == len (elem)
654
653
except : # fails if elem contains a numpy array.
655
654
fullslice = False
656
655
if fullslice and datashape and put and not hasunlim:
657
656
datashape = broadcasted_shape(shape, datashape)
658
657
659
- # pad datashape with zeros for dimensions not being sliced (issue #906)
660
658
# only used when data covers slice over subset of dimensions
661
659
if datashape and len (datashape) != len (elem) and \
662
660
len (datashape) == sum (1 for e in elem if type (e) == slice ):
0 commit comments