HERA-Team / hera_cal

Library for HERA data reduction, including redundant calibration, absolute calibration, and LST-binning.
MIT License
13 stars 8 forks source link

Fix `build_fringe_rate_profiles` bug when number of pols = 1 #903

Closed jsdillon closed 1 year ago

jsdillon commented 1 year ago

This PR fixes a small bug where .squeeze(), which is designed to eliminate extraneous dimensions in pyuvdata objects, can also squeeze out dimensions in the flag_array when the number of polarizations is 1. This PR prevents that by first doing a np.all over the polarization axis, as was intended, then squeezing (which does nothing when future_array_shapes == True).

This PR also fixes a bunch of pep8 stuff.

jsdillon commented 1 year ago

@aewallwi Not asking you for a review (I know you're busy!) but I thought I'd just flag this for you in case you were curious or if it impacted H4C analysis (I doubt it).

codecov[bot] commented 1 year ago

Codecov Report

Patch coverage: 100.00% and project coverage change: -0.06 :warning:

Comparison is base (c7fdf56) 97.20% compared to head (d86b043) 97.15%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #903 +/- ## ========================================== - Coverage 97.20% 97.15% -0.06% ========================================== Files 21 23 +2 Lines 9455 10262 +807 ========================================== + Hits 9191 9970 +779 - Misses 264 292 +28 ``` | [Impacted Files](https://app.codecov.io/gh/HERA-Team/hera_cal/pull/903?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=HERA-Team) | Coverage Δ | | |---|---|---| | [hera\_cal/frf.py](https://app.codecov.io/gh/HERA-Team/hera_cal/pull/903?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=HERA-Team#diff-aGVyYV9jYWwvZnJmLnB5) | `97.50% <100.00%> (ø)` | | ... and [13 files with indirect coverage changes](https://app.codecov.io/gh/HERA-Team/hera_cal/pull/903/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=HERA-Team)

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.

aewallwi commented 1 year ago

Thanks for keeping me in the loop @jsdillon! This all looks good :)