Skip to content

Commit 385cd5e

Browse files
committed
fix comments
1 parent cac00ff commit 385cd5e

File tree

3 files changed

+8
-9
lines changed

3 files changed

+8
-9
lines changed

examples/get_vara.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,8 @@ def pnetcdf_io(filename, file_format):
9595
if rank == 0 and verbose:
9696
print("variable attribute \"str_att_name\" of type text =", str_att)
9797

98-
# Get the length of the variable's attribute named "float_att_name"
99-
float_att = v.get_att("float_att_name")
98+
# Get the variable's attribute named "float_att_name"
99+
float_att = v.get_att("float_att_name")
100100

101101
# set access pattern for reading subarray
102102
local_ny = global_ny

src/pnetcdf/_File.pyx

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -499,12 +499,11 @@ cdef class File:
499499
500500
Operational mode: This method must be called while the file is in define mode.
501501
"""
502-
503-
504502
cdef nc_type xtype
505503
xtype=-99
506504
_set_att(self, NC_GLOBAL, name, value, xtype=xtype)
507505

506+
508507
def get_att(self,name,encoding='utf-8'):
509508
"""
510509
get_att(self,name,encoding='utf-8')
@@ -519,14 +518,14 @@ cdef class File:
519518
:param name: Name of the attribute.
520519
:type name: str
521520
522-
:rtype: str
521+
:rtype: str or numpy.ndarray
523522
524-
Operational mode: This method must be called while the file is in define mode.
523+
Operational mode: This method can be called while the file is in either
524+
define or data mode (collective or independent).
525525
"""
526-
527-
528526
return _get_att(self, NC_GLOBAL, name, encoding=encoding)
529527

528+
530529
def __delattr__(self,name):
531530
# if it's a netCDF attribute, remove it
532531
if name not in _private_atts:

src/pnetcdf/_utils.pyx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ cdef _get_att(file, int varid, name, encoding='utf-8'):
296296

297297

298298
cdef _get_att_names(int file_id, int varid):
299-
# Private function to get all the attribute names in a group
299+
# Private function to get all the attribute names of a variable
300300
cdef int ierr, numatts, n
301301
cdef char namstring[NC_MAX_NAME+1]
302302
if varid == NC_GLOBAL:

0 commit comments

Comments
 (0)