Skip to content

Commit 0a66332

Browse files
committed
Improve robustness of check on choice coefs
The check now extends to both b1 and b2 coefficients and ensures the coefficient value is a float as expected, with anything other than a float resulting in the default set of coefficients being chosen.
1 parent 398af4a commit 0a66332

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

scout/ecm_prep.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5567,10 +5567,10 @@ def fill_mkts(self, msegs, msegs_cpl, convert_data, tsv_data_init, opts,
55675567
"choice data structure for segment '" + str(mskeys))
55685568
# Ensure dictionary has end point data to draw from; if not, set segment
55695569
# coefficients to a default and notify user in verbose mode
5570-
if (tiered_flag and (
5571-
any([x[1] in [0, "NA"] for x in choice_dict["typical"]["b1"].items()]))
5572-
or (not tiered_flag and
5573-
any([x[1] in [0, "NA"] for x in choice_dict["b1"].items()]))):
5570+
if (tiered_flag and (any([any([not isinstance(x[1], float) for
5571+
x in choice_dict["typical"][coef].items()]) for coef in ["b1", "b2"]]))
5572+
or (not tiered_flag and any([any([not isinstance(x[1], float) for
5573+
x in choice_dict[coef].items()]) for coef in ["b1", "b2"]]))):
55745574
choice_params = self.use_deflt_res_choice(mskeys, consume_warn, opts)
55755575
# Case where checks above have cleared and the coefficients are tiered
55765576
# (best vs. typical)

0 commit comments

Comments
 (0)