Open keller-mark opened 10 months ago
+1 to this
Consider the RNetCDF API pattern where you pass an open object to a function that works with it.
e.g. open.nc()
returns an nc
object and you pass that object to functions like att.get()
or var.put()
etc.
@keller-mark -- here's what I've got cooking.
https://code.usgs.gov/wma/nhgf/geo-data-portal/rnz/-/tree/develop
The README there shows the basics of what it does so far.
I am going to get a copy of that repository public at: https://github.com/DOI-USGS/rnz and will do the rest of the development on a dirty main branch but there's a bit more paperwork to get cleared before it's done.
I implemented:
#' Returns results of listing the store
#'
#' @param x a pizzar Store object
#' @export
names.Store <- function(x) {
x$listdir()
}
And a side affect that is kind of unfortunate is:
> class(store)
[1] "DirectoryStore" "Store" "R6"
Not sure what the UX of working with these classes really should be, but I'm not sure that R6 and S3 should really coexist based on this?
might be some relevance in the new S7 on your questions here (if you haven't seen that): https://blog.r-project.org/2024/05/17/generalizing-support-for-functional-oop-in-r/index.html
I need to sit quietly with some examples of how to implement subsetting and assignment. @keller-mark -- do you feel like the implementations of bracket methods in zarr-array.R
are the way they should be or were those just a starting point?
From discussions with @pieterjanvc the non-R6 API would be much more natural for the R ecosystem