natverse / coconatfly

Comparative Connectomics of Public and In Progress Drosophila Datasets
https://natverse.org/coconatfly/
6 stars 1 forks source link

Generic support for additional metadata #23

Open jefferis opened 2 months ago

jefferis commented 2 months ago

The PR for additional fanc_meta (https://github.com/natverse/coconatfly/pull/22) gives one pattern, where we just return accept a path to a file on disk (tsv/feather) or a dataframe. I think more generically we could provide the option to register a metadata function (possibly even more than one) for a dataset.

cf_register_meta<-function(dataset, FUN, add = TRUE, after = TRUE) {

}

Where FUN would look like

FUN<-function(ids=NULL, ...) {
  # fetch metadata
  return(df)
}

using cf_register_meta would allow the actual method of storing the metadata FUN to evolve as we change coconatfly. Furthermore it would be a step on the way to actually using the coconat::register_dataset function (which could perhaps use this under the hood?).

Questions/todos