Type error when running scib_metrics
HelloWorldLTY opened this issue · 2 comments
Report
Hi, here is a bug when running:
bm.benchmark()
209 if not self._prepared:
210 self.prepare()
212 num_metrics = sum(
--> 213 [sum([v is not False for v in asdict(met_col)]) for met_col in self._metric_collection_dict.values()]
214 )
216 for emb_key, ad in tqdm(self._emb_adatas.items(), desc="Embeddings", position=0, colour="green"):
217 pbar = tqdm(total=num_metrics, desc="Metrics", position=1, leave=False, colour="blue")
File ~/.conda/envs/tangram/lib/python3.8/dataclasses.py:1072, in asdict(obj, dict_factory)
1053 """Return the fields of a dataclass instance as a new dictionary mapping
1054 field names to field values.
1055
(...)
1069 tuples, lists, and dicts.
1070 """
1071 if not _is_dataclass_instance(obj):
-> 1072 raise TypeError("asdict() should be called on dataclass instances")
1073 return _asdict_inner(obj, dict_factory)
TypeError: asdict() should be called on dataclass instances
Could you please help me handle this bug? Thanks.
Version information
No response
What version of python are you using?
1.1.4 I think.