Open HenrikBengtsson opened 9 years ago
As a start, the 'devel' branch (sic!) of this repository now gives an informative error in all of the above cases when indices
or units
is of length zero and not NULL
, e.g.
> readCdfUnits(cdf, units=integer(0))
Error in readCdfUnits(cdf, units = integer(0)) :
readCdfUnits(..., units=integer(0)) is not supported.
Added the same protection for:
readPgf(..., indices=integer(0))
readPgfEnv(..., indices=integer(0))
which is somewhat related to Issue #2.
I think by now that all read as well as update functions are protected and give informative error messages.
Just a reminder: Protection against integer(0)
indices was added to:
Version: 1.39.1 [2014-10-26] o ROBUSTNESS: Now all methods gives an informative error message if zero elements are requested, i.e. via zero-length argument 'indices' or 'units' that is not NULL. Previously this case would access all values just like NULL does.
[Adding a bug report that's been open since 2008-05-08!]
Several methods treats cell/unit indices specified as
integer(0)
just asNULL
. For consistency, we should letNULL
mean "read everything", whereasinteger(0)
should be "read nothing/read zero elements".