Closed ChristopherChudzicki closed 6 years ago
Is this a simple matter of mapping is_inf over a list? Where exactly does the error occur?
It happens here:
https://github.com/mitodl/mitx-grading-library/blob/master/mitxgraders/helpers/calc/calc.py#L589 https://github.com/mitodl/mitx-grading-library/blob/master/mitxgraders/helpers/calc/calc.py#L592
Is this a simple matter of mapping is_inf over a list?
Yes, I think so. And probably wrap results
in a list if it isn't one already. (I believe the only case when results
should be a list is with self.actions['arguments']
.)
But I was going to remove IdentityMultiple before dealing with this, since I think that will make some of the comments simpler (e.g., https://github.com/mitodl/mitx-grading-library/blob/master/mitxgraders/helpers/calc/calc.py#L583 will say something like "Float, MathArray, or List (in case of function arguments)".
A very minimal example:
I don't completely understand the issue, but apparently
np.isinf
cannot handle a list where some members are arrays and some members are not. Same issue withnp.isnan
.This shows up for us in
calc.py
, where theself.actions['arguments']
outputs a list of function arguments, some of which might be arrays, some of which might be numbers.Here's a full example that produces the error:
(Discovered while writing documentation for
specify_domain
)