Skip to content

Commit 58582a0

Browse files
committed
dynamic typing
1 parent fdf4628 commit 58582a0

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

causal_testing/surrogate/surrogate_search_algorithms.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,13 +99,14 @@ def create_gene_types(
9999
rel_split = str(relationship).split(" ")
100100

101101
if rel_split[0] in var_space:
102+
datatype = specification.scenario.variables.get(rel_split[0]).datatype
102103
if rel_split[1] == ">=":
103-
var_space[rel_split[0]]["low"] = int(rel_split[2])
104+
var_space[rel_split[0]]["low"] = datatype(rel_split[2])
104105
elif rel_split[1] == "<=":
105-
if specification.scenario.variables.get(rel_split[0]).datatype == int:
106+
if datatype == int:
106107
var_space[rel_split[0]]["high"] = int(rel_split[2]) + 1
107108
else:
108-
var_space[rel_split[0]]["high"] = int(rel_split[2])
109+
var_space[rel_split[0]]["high"] = datatype(rel_split[2])
109110

110111
gene_space = []
111112
gene_space.append(var_space[surrogate_model.treatment])

0 commit comments

Comments
 (0)