Skip to content

Commit 4e2c331

Browse files
committed
add missing argument fill_value
1 parent 7136ef7 commit 4e2c331

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/pnetcdf/_Variable.pyx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@ cdef class Variable:
4141
method of a `File` instance, not using this class constructor directly.
4242
"""
4343

44-
def __init__(self, file, name, datatype, dimensions=(), **kwargs):
44+
def __init__(self, file, name, datatype, dimensions=(), fill_value=None, **kwargs):
4545
"""
46-
__init__(self, file, name, datatype, dimensions=(), **kwargs)
46+
__init__(self, file, name, datatype, dimensions=(), fill_value=None, **kwargs)
4747
4848
The constructor for :class:`pnetcdf.Variable`.
4949
@@ -157,6 +157,10 @@ cdef class Variable:
157157
self.chartostring = True
158158
# propagate _ncstring_attrs__ setting from parent group.
159159

160+
if fill_value != None:
161+
self.def_fill(0, fill_value = fill_value)
162+
163+
160164
def __array__(self):
161165
# numpy special method that returns a numpy array.
162166
# allows numpy ufuncs to work faster on Variable objects

0 commit comments

Comments
 (0)