Skip to content

Commit 63f6131

Browse files
authored
Make PubChem datasets **dynamic** / Remove unsupported PubChem classes (#167)
* update pubchem for dynamic dataset * move classes.txt property (not used by unlabeled datasets like PubChem) * update configs
1 parent 760c304 commit 63f6131

7 files changed

Lines changed: 152 additions & 765 deletions

File tree

chebai/preprocessing/datasets/base.py

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1267,16 +1267,3 @@ def processed_file_names_dict(self) -> dict:
12671267
if self.n_token_limit is not None:
12681268
return {"data": f"data_maxlen{self.n_token_limit}.pt"}
12691269
return {"data": "data.pt"}
1270-
1271-
@property
1272-
def classes_txt_file_path(self) -> str:
1273-
"""
1274-
Returns the filename for the classes text file.
1275-
1276-
Returns:
1277-
str: The filename for the classes text file.
1278-
"""
1279-
# This property also used in following places:
1280-
# - chebai/result/prediction.py: to load class names for csv columns names
1281-
# - chebai/cli.py: to link this property to `model.init_args.classes_txt_file_path`
1282-
return os.path.join(self.processed_dir_main, "classes.txt")

chebai/preprocessing/datasets/chebi.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -519,6 +519,19 @@ def processed_file_names_dict(self) -> dict:
519519
}
520520
return {"data": f"aug_data_var{self.aug_smiles_variations}.pt"}
521521

522+
@property
523+
def classes_txt_file_path(self) -> str:
524+
"""
525+
Returns the filename for the classes text file.
526+
527+
Returns:
528+
str: The filename for the classes text file.
529+
"""
530+
# This property also used in following places:
531+
# - chebai/result/prediction.py: to load class names for csv columns names
532+
# - chebai/cli.py: to link this property to `model.init_args.classes_txt_file_path`
533+
return os.path.join(self.processed_dir_main, "classes.txt")
534+
522535

523536
class ChEBIFromList(_ChEBIDataExtractor):
524537
"""

0 commit comments

Comments
 (0)