Skip to content

Commit

Permalink
Merge pull request #59 from Parallel-NetCDF/cleanup
Browse files Browse the repository at this point in the history
remove _check_safecast
  • Loading branch information
wkliao authored Sep 11, 2024
2 parents 72856ec + d4da3d2 commit 76bac61
Showing 1 changed file with 0 additions and 19 deletions.
19 changes: 0 additions & 19 deletions src/pnetcdf/_Variable.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -698,25 +698,6 @@ cdef class Variable:
dataput=np.array(dataput,dataput.dtype)
self._put(dataput,a,b,c)

def _check_safecast(self, attname):
# check to see that variable attribute exists
# and can be safely cast to variable data type.
msg="""WARNING: %s not used since it
cannot be safely cast to variable data type""" % attname
if hasattr(self, attname):
att = np.array(self.get_att(attname))
else:
return False
try:
atta = np.array(att, self.dtype)
except ValueError:
is_safe = False
warnings.warn(msg)
return is_safe
is_safe = _safecast(att,atta)
if not is_safe:
warnings.warn(msg)
return is_safe

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

0 comments on commit 76bac61

Please sign in to comment.