Closed iparask closed 9 months ago
Attention: 4 lines
in your changes are missing coverage. Please review.
Comparison is base (
f412f41
) 43.72% compared to head (7878201
) 43.71%.
Files | Patch % | Lines |
---|---|---|
pixell/utils.py | 0.00% | 4 Missing :warning: |
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
I pushed a fix for this. It does basically the same thing except:
np.asanyarray
instead of np.asarray
to make it still work for numpy subclasses like enmap. np.asarray
removes the subclass, so would have broken this functionality.
This PR fixes #250.
The existing code passed the input to Allreduce without any checks. As a consequence, when a scalar was passed at the input, it failed. This function is heavily used from the methods in
sotodlib
mapmaking utilities.The solution is to add a check, and whenever Allreduce gets a scalar as input, change it to a NumPy array if 1 element and pass it. Since
res
isres = np.zeros_like(a)
, then it is a scalar when the input is one. As a result, the fix selects the first element of the result to return.Also, sorry for the huge diff. I changed alltabs
to 4 spaces. This is Python, after all.The actual fix is in lines 1236-1249.