grimbough / rhdf5

Package providing an interface between HDF5 and R
http://bioconductor.org/packages/rhdf5
60 stars 21 forks source link

Missing `@export` on `h5writeAttribute` S3 methods #89

Closed LTLA closed 2 years ago

LTLA commented 3 years ago

This causes problems like:

h5writeAttribute(cn, mat, "dimnames2")
## Error in UseMethod("h5writeAttribute") :
##   no applicable method for 'h5writeAttribute' applied to an object of class "character"
grimbough commented 3 years ago

Thanks for pointing this out. Any idea why it doesn't trip up the unit tests in https://github.com/grimbough/rhdf5/blob/master/tests/testthat/test_h5writeAttributes.R ?

If I run the tests manually I see the error, but its fine in R CMD check or devtools::test(). Either way I'll get it fixed.

LTLA commented 3 years ago

Probably because testthat fiddles with the package namespace to export all of the symbols (including those not exported) when tests are run via test_check(), but not when tests are run manually.