Open rcannood opened 5 days ago
Functions like from_path and from_anndata should only be added if the class is an Artifact Registry.
from_path
from_anndata
We probably need a
create_registry <- function(instance, module, api, registry_name, registry_schema) { public <- list( initialize = function(instance, module, api, registry_name, registry_schema) { super$new( instance = instance, module = module, api = api, registry_name = registry_name, registry_schema = registry_schema ) }, # ... ) if (registry_name == "Artifact") { public$from_path <- ... public$from_anndata <- .. public$from_dir <- ... public$from_mudata <- ... } if (registry_names == "FeatureSet") { public$from_values <- ... } # ... RichRegistryClass <- R6::R6Class( paste0(registry_name, "Registry"), cloneable = FALSE, inherit = Registry, public = public ) RichRegistryClass }
Or the other way around
create_registry <- function(instance, module, api, registry_name, registry_schema) { public <- list( initialize = function(instance, module, api, registry_name, registry_schema) { super$new( instance = instance, module = module, api = api, registry_name = registry_name, registry_schema = registry_schema ) }, from_path = function(...) { ... }, from_anndata = function(...) { ... }, from_dir = function(...) { ... }, # ... ) if (registry_name != "Artifact") { public$from_path <- NULL public$from_anndata <- NULL public$from_dir <- NULL public$from_mudata <- NULL } if (registry_names != "FeatureSet") { public$from_values <- NULL } # ... RichRegistryClass <- R6::R6Class( paste0(registry_name, "Registry"), cloneable = FALSE, inherit = Registry, public = public ) RichRegistryClass }
_Originally posted by @rcannood in https://github.com/laminlabs/laminr/pull/85#discussion_r1848335300_
Somewhat related to #63
Functions like
from_path
andfrom_anndata
should only be added if the class is an Artifact Registry.We probably need a
Or the other way around
_Originally posted by @rcannood in https://github.com/laminlabs/laminr/pull/85#discussion_r1848335300_