Skip to content

Commit

Permalink
Fix bug where floats may be used as indexes
Browse files Browse the repository at this point in the history
  • Loading branch information
gacou54 committed Jul 15, 2021
1 parent 14ccf77 commit 1bd97ff
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions othello/macbeth/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ def evaluate_new_values(
use_indexes: bool = False) -> List:
# If using indexes (counting from 1) in the macbeth file rather than raw values
if use_indexes:
new_values = []
return [criterion_parameters.weights[i-1] for i in x_to_eval_or_indexes]
return [criterion_parameters.weights[int(i - 1)] for i in x_to_eval_or_indexes]

# If the levels can be used in a interpolation
if type(criterion_parameters.levels[0]) in [int, float]:
Expand Down

0 comments on commit 1bd97ff

Please sign in to comment.