Skip to content

Commit 9fcf1c5

Browse files
authored
fix: handle new/ removed variables (#26)
1 parent a2c259a commit 9fcf1c5

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/comment_components.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,9 @@ def variables_deviation_df(self) -> pd.DataFrame:
211211
:, [col for col in vars2.columns if str(col).replace(".", "", 1).isdigit()]
212212
]
213213

214-
assert vars1.index.equals(vars2.index)
214+
# Filter any new/ removed variables
215+
vars1 = vars1[vars1.index.isin(vars2.index)]
216+
vars2 = vars2[vars2.index.isin(vars1.index)]
215217

216218
deviation_df = self.get_deviation_df(
217219
vars1, vars2, nrmse_normalization_method=self.NRMSE_NORMALIZATION_METHOD

0 commit comments

Comments
 (0)