Skip to content

Commit 32c3272

Browse files
authored
Merge pull request #58 from Parallel-NetCDF/cmt_clean
cleaned up comments
2 parents a60aa15 + ccb5f3c commit 32c3272

File tree

2 files changed

+7
-9
lines changed

2 files changed

+7
-9
lines changed

src/pnetcdf/_Variable.pyx

+2-2
Original file line numberDiff line numberDiff line change
@@ -675,8 +675,8 @@ cdef class Variable:
675675
data = np.tile(data,datashape)
676676
# reshape data array if needed to conform with start,count,stride.
677677
if data.ndim != len(datashape) or\
678-
(data.shape != datashape and data.ndim > 1): # issue #1083
679-
# create a view so shape in caller is not modified (issue 90)
678+
(data.shape != datashape and data.ndim > 1):
679+
# create a view so shape in caller is not modified
680680
try: # if extra singleton dims, just reshape
681681
data = data.view()
682682
data.shape = tuple(datashape)

src/pnetcdf/_utils.pyx

+5-7
Original file line numberDiff line numberDiff line change
@@ -206,12 +206,12 @@ cdef _set_att(file, int varid, name, value,\
206206
file_id = file._ncid
207207
# put attribute value into a np array.
208208
value_arr = np.array(value)
209-
if value_arr.ndim > 1: # issue #841
209+
if value_arr.ndim > 1:
210210
raise ValueError('multi-dimensional array attributes not supported')
211211
N = value_arr.size
212212

213213
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
215215
if N > 1:
216216
msg='array string attributes not supported'
217217
if not value_arr.shape:
@@ -221,7 +221,7 @@ cdef _set_att(file, int varid, name, value,\
221221
dats = _strencode(''.join(value_arr1.tolist()))
222222
lenarr = len(dats)
223223
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
225225
with nogil:
226226
ierr = ncmpi_put_att_text(file_id, varid, attname, lenarr, datstring)
227227
_check_err(ierr, err_cls=AttributeError)
@@ -551,7 +551,7 @@ cdef _StartCountStride(elem, shape, dimensions=None, file=None, datashape=None,
551551
try:
552552
dimname = dimensions[i]
553553
unlim = unlimd[dimname]
554-
except IndexError: # more slices than dimensions (issue 371)
554+
except IndexError:
555555
unlim = False
556556
else:
557557
unlim = False
@@ -616,7 +616,6 @@ cdef _StartCountStride(elem, shape, dimensions=None, file=None, datashape=None,
616616
ee = False
617617
if ee and len(e) == len(ee) and (e == np.arange(start,stop,step)).all():
618618
# don't convert to slice unless abs(stride) == 1
619-
# (nc_get_vars is very slow, issue #680)
620619
newElem.append(slice(start,stop,step))
621620
else:
622621
newElem.append(e)
@@ -648,15 +647,14 @@ cdef _StartCountStride(elem, shape, dimensions=None, file=None, datashape=None,
648647
else:
649648
sdim.append(1)
650649

651-
# broadcast data shape when assigned to full variable (issue #919)
650+
# broadcast data shape when assigned to full variable
652651
try:
653652
fullslice = elem.count(slice(None,None,None)) == len(elem)
654653
except: # fails if elem contains a numpy array.
655654
fullslice = False
656655
if fullslice and datashape and put and not hasunlim:
657656
datashape = broadcasted_shape(shape, datashape)
658657

659-
# pad datashape with zeros for dimensions not being sliced (issue #906)
660658
# only used when data covers slice over subset of dimensions
661659
if datashape and len(datashape) != len(elem) and\
662660
len(datashape) == sum(1 for e in elem if type(e) == slice):

0 commit comments

Comments
 (0)