Skip to content

Commit 76bac61

Browse files
authored
Merge pull request #59 from Parallel-NetCDF/cleanup
remove _check_safecast
2 parents 72856ec + d4da3d2 commit 76bac61

File tree

1 file changed

+0
-19
lines changed

1 file changed

+0
-19
lines changed

src/pnetcdf/_Variable.pyx

-19
Original file line numberDiff line numberDiff line change
@@ -698,25 +698,6 @@ cdef class Variable:
698698
dataput=np.array(dataput,dataput.dtype)
699699
self._put(dataput,a,b,c)
700700

701-
def _check_safecast(self, attname):
702-
# check to see that variable attribute exists
703-
# and can be safely cast to variable data type.
704-
msg="""WARNING: %s not used since it
705-
cannot be safely cast to variable data type""" % attname
706-
if hasattr(self, attname):
707-
att = np.array(self.get_att(attname))
708-
else:
709-
return False
710-
try:
711-
atta = np.array(att, self.dtype)
712-
except ValueError:
713-
is_safe = False
714-
warnings.warn(msg)
715-
return is_safe
716-
is_safe = _safecast(att,atta)
717-
if not is_safe:
718-
warnings.warn(msg)
719-
return is_safe
720701

721702
def _put_var1(self, value, tuple index, bufcount, Datatype buftype, collective = True):
722703
cdef int ierr, ndims

0 commit comments

Comments
 (0)