Skip to content

Commit

Permalink
fix bug: Variable.put_var has no parameter of num
Browse files Browse the repository at this point in the history
  • Loading branch information
wkliao committed Sep 10, 2024
1 parent e5f3fdf commit 81b8dcc
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions src/pnetcdf/_Variable.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -1305,25 +1305,23 @@ cdef class Variable:
var[start[0]:end[0], start[1]:end[1]] = buf
"""
if data is not None and all(arg is None for arg in [start, count, stride, num, imap]):
if data is not None and all(arg is None for arg in [start, count, stride, imap]):
self._put_var(data, collective = True, bufcount = bufcount, buftype = buftype)
elif all(arg is not None for arg in [data, start]) and all(arg is None for arg in [count, stride, num, imap]):
elif all(arg is not None for arg in [data, start]) and all(arg is None for arg in [count, stride, imap]):
self._put_var1(data, start, collective = True, bufcount = bufcount, buftype = buftype)
elif all(arg is not None for arg in [data, start, count]) and all(arg is None for arg in [stride, num, imap]):
elif all(arg is not None for arg in [data, start, count]) and all(arg is None for arg in [stride, imap]):
self._put_vara(start, count, data, collective = True, bufcount = bufcount, buftype = buftype)
elif all(arg is not None for arg in [data, start, count, stride]) and all(arg is None for arg in [num, imap]):
elif all(arg is not None for arg in [data, start, count, stride]) and all(arg is None for arg in [imap]):
self._put_vars(start, count, stride, data, collective = True, bufcount = bufcount, buftype = buftype)
elif all(arg is not None for arg in [data, start, count, num]) and all(arg is None for arg in [stride, imap]):
self._put_varn(start, count, num, data, collective = True, bufcount = bufcount, buftype = buftype)
elif all(arg is not None for arg in [data, start, count, imap]) and all(arg is None for arg in [num]):
elif all(arg is not None for arg in [data, start, count, imap]):
self._put_varm(data, start, count, stride, imap, collective = True, bufcount = bufcount, buftype = buftype)
else:
raise ValueError("Invalid input arguments for put_var_all")


def put_var(self, data, start=None, count=None, stride=None, num=None, imap=None, bufcount=None, buftype=None):
def put_var(self, data, start=None, count=None, stride=None, imap=None, bufcount=None, buftype=None):
"""
put_var(self, data, start=None, count=None, stride=None, num=None, imap=None, bufcount=None, buftype=None)
put_var(self, data, start=None, count=None, stride=None, imap=None, bufcount=None, buftype=None)
Method to write in parallel to the netCDF variable in the independent
I/O mode. For the argument usage, please refer to method
Expand Down

0 comments on commit 81b8dcc

Please sign in to comment.