scvi-tools icon indicating copy to clipboard operation
scvi-tools copied to clipboard

Manager summary stats should be per field

Open adamgayoso opened this issue 3 years ago • 3 comments

Because of this line summary stats can be overwritten if two fields use the same name. Summary stats should be a dict with keys being the unique registry keys of the field and values being the summary stats

https://github.com/scverse/scvi-tools/blob/00e03420c5b7b59bd9ae57238bbfe431d9ab8865/scvi/data/_manager.py#L315

adamgayoso avatar Oct 16 '22 19:10 adamgayoso

what do you think @justjhong?

adamgayoso avatar Oct 16 '22 19:10 adamgayoso

It's a logical change, but also results in verbose access to the field-specific summary stats. If we could create an API to easily fetch summary stats (e.g. get_summary_stat(field name, stat key)) then it could work well enough. Mainly was being conservative about the structure of summary stats as a single high-level object when I implemented this.

justjhong avatar Oct 17 '22 14:10 justjhong

I think we should be raising an error here instead if someone has two fields with the same name.

martinkim0 avatar Jul 12 '24 17:07 martinkim0