File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change 1
1
"""Substance parameters."""
2
2
3
3
import gc
4
+ import warnings
4
5
from functools import cached_property
5
6
from typing import Any , ClassVar
6
7
@@ -140,8 +141,17 @@ def comp_df(self) -> pd.DataFrame:
140
141
kwargs_fingerprint = self .kwargs_fingerprint ,
141
142
)
142
143
143
- # Drop NaN and constant columns
144
+ # Drop NaN, constant columns and columns with duplicated names
144
145
comp_df = comp_df .loc [:, ~ comp_df .isna ().any (axis = 0 )]
146
+ mask_duplicated_columns = comp_df .columns .duplicated ()
147
+ if any (mask_duplicated_columns ):
148
+ warnings .warn (
149
+ f"There were duplicated column names for the substance parameter "
150
+ f"{ self .name } with encoding { self .encoding .name } . This could indicate "
151
+ f"bugs with the encoding computation. The duplicated columns will be "
152
+ f"dropped."
153
+ )
154
+ comp_df = comp_df .loc [:, ~ mask_duplicated_columns ]
145
155
comp_df = df_drop_single_value_columns (comp_df )
146
156
147
157
# Label the rows with the molecule names
You can’t perform that action at this time.
0 commit comments