def __call__(self, *coords):
<EOL>indices = []<EOL>norm_distances = []<EOL>for coord, breaks in zip(coords, self.grid):<EOL><INDENT>i = numpy.searchsorted(breaks, coord) - <NUM_LIT:1><EOL>i = numpy.where(i == -<NUM_LIT:1>, <NUM_LIT:0>, i)<EOL>indices.append(i)<EOL>norm_distances.append((coord - breaks[i]) / (breaks[i+<NUM_LIT:1>] - breaks[i]))<EOL><DEDENT>edges = itertools.product(*[[i, i+<NUM_LIT:1>] for i in indices])<EOL>value = <NUM_LIT:0.><EOL>for edge_indices in edges:<EOL><INDENT>weight = <NUM_LIT:1.><EOL>for ei, i, yi in zip(edge_indices, indices, norm_distances):<EOL><INDENT>weight *= numpy.where(ei == i, <NUM_LIT:1> - yi, yi)<EOL><DEDENT>value += self.values[edge_indices] * weight<EOL><DEDENT>return value<EOL>
interpolation at coordinates