Small change that allows key of AnnDataField to be a list of strings.
An accompanying change that allows categories_to_codes to handle a DataFrame (the result of accessing adata.obs with a list of keys) as well as a Series.
This enables the scvi model to be written much more efficiently. We have a use case where we can have several adata.obs keys designated as "categorical covariates", and we would like to load them all into a single tensor that gets passed to the forward call of the model. These changes enable that.
Small change that allows
key
ofAnnDataField
to be a list of strings.An accompanying change that allows
categories_to_codes
to handle aDataFrame
(the result of accessingadata.obs
with a list of keys) as well as aSeries
.This enables the scvi model to be written much more efficiently. We have a use case where we can have several
adata.obs
keys designated as "categorical covariates", and we would like to load them all into a single tensor that gets passed to theforward
call of the model. These changes enable that.