File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
chebai/preprocessing/datasets Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -253,7 +253,12 @@ def _extract_class_hierarchy(self, data_path: str) -> "nx.DiGraph":
253253 ):
254254 term_dict = term_callback (term_doc )
255255 if term_dict and (
256- not self .subset or term_dict ["subset" ] == self .subset
256+ not self .subset
257+ or (
258+ "subset" in term_dict
259+ and term_dict ["subset" ] is not None
260+ and term_dict ["subset" ][0 ] == self .subset [0 ]
261+ ) # match 3:STAR to 3_STAR, 3star, 3_star, etc.
257262 ):
258263 elements .append (term_dict )
259264
@@ -1068,6 +1073,6 @@ def term_callback(doc: "fastobo.term.TermFrame") -> Union[Dict, bool]:
10681073
10691074
10701075if __name__ == "__main__" :
1071- dataset = ChEBIOver50 (chebi_version = 246 )
1072- # dataset.prepare_data()
1076+ dataset = ChEBIOver50 (chebi_version = 248 , subset = "3_STAR" )
1077+ dataset .prepare_data ()
10731078 dataset .setup ()
You can’t perform that action at this time.
0 commit comments