scverse/anndataR

avoid code duplication in `validate_obs()`/ `validate_var()`

Closed this issue · 0 comments

https://github.com/scverse/scverseio/blob/d3e5c1a3f3a672617da953181911a3e837b2887c/R/InMemoryAnnData.R#L39-L56

It seems like the code duplication here could be avoided by writing private[[field]] instead of using private$.obs, something like

.validate_dataframe = function(field) {
    value <- private[[field]]
    ...
}