-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
rray removes custom classes #247
Comments
There is, but I haven't exported it yet (it isn't fully tested). If you look at In a dev version I had exported these, but decided against it before release because I am not sure if this is a good long term solution for extensibility. The ideas are still being developed in vctrs, and I didn't want to provide something that we would have to immediately break. vctrs doesn't currently have the "container type" idea sorted out yet (see r-lib/vctrs#211). I'm not currently working on rray, so it would be awhile before I could get back around to this. If you want to take a shot at reexporting If you aren't familiar with the double dispatch idea yet, see this vignette: Here is the commit where I un-exported the functions. You'd have to add the roxygen tags back (also note that there was a name change after this |
Do be aware that due to some xtensor-r bugs, I was not able to get missing values implemented in this first version 😢 #21 |
Thank you for this super helpful answer! I will take a look at the non-exported solution you provided. At least for the time being, it may be safer for our purposes to use base R arrays (with |
We are currently in the process of writing a new package to efficiently handle posterior samples as return by MCMC samplers of Bayesian models and we consider using rray for matrix and array representations. However, for easy S3 method dispatch, we need to have custom classes on top of rray's classes that simply indicate that the rray is in the right format (without having to check again every time). Unfortunately, rray removes custom classes, while base R array does not. Here is a reproducible example:
Is there a way to preserve custom classes for all vectorized (pointwise) operations without having to redefine every numerical function rray provides for its objects?
The text was updated successfully, but these errors were encountered: