Skip to content

Commit 7494aed

Browse files
committed
Explicitly casting variables to their Z3 type
1 parent 6e9a369 commit 7494aed

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

causal_testing/data_collection/data_collector.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,10 @@ def filter_valid_data(self, data: pd.DataFrame, check_pos: bool = True) -> pd.Da
4949
for _, row in data.iterrows():
5050
solver.push()
5151
# Need to explicitly cast variables to their specified type. Z3 will not take e.g. np.int64 to be an int.
52+
for var in self.scenario.variables:
53+
self.scenario.variables[var].z3 == self.scenario.variables[var].z3_val(
54+
self.scenario.variables[var].z3, row[var]
55+
)
5256
model = [
5357
self.scenario.variables[var].z3
5458
== self.scenario.variables[var].z3_val(self.scenario.variables[var].z3, row[var])

0 commit comments

Comments
 (0)