Repository navigation
Fix for cov() failing when a complex input matrix is given - #2716
vaamarnath wants to merge 3 commits into
Conversation
|
(The travis failures are spurious.) This needs tests added before we could commit it. It seems like unconditionally casting input to complex will have nasty effects. Does this mean that cov() will always return a complex array, even for real inputs? It should really return an array of the same type as its input (modulo casting the two inputs onto each other, possible upcasting from integer -> float, that sort of thing). |
|
@njsmith Yeah, I understand what I have done is not the optimum solution. I would like to get some help in this regard. Could you give me some pointers to how to deal this case? Like how to find the highest type in the passed arrays. The only thing I can think of is iterating through the list and getting the highest type. Then I can cast to that type. Yet another issue I face for this solution is that, I am not able to compare the types in python3 using >, < operators. In python2, I am able to do this. |
|
@vaamarnath do you still want to fix this? I think a decent method is probably As for the result, I think it is always real (even with complex input), right? So I think cov should return (If you want, while you are at it, you could remove that empty array special case and fix the tests for |
|
ping travisbot. |
|
@seberg I'm tempted to close this for lack of activity. What do you think. |
|
Agreed, though I would be happy to see it reopened. |
|
Could you reopen this issue please ? I think the right fix is by using iscomplexobj: A simple test case can be found in #597. I will try to do a full PR soon if this one is completely abandoned. |
|
Actually, I can't (not sure why), but since there is an issue about it and this was a pull request, I don't really see why it should be reopened, unless the original owner wants to resurrect it. This PR was closed because it seemed abandoned, so please do put together a new one. |
Fix for issue #2680