pyuvdata icon indicating copy to clipboard operation
pyuvdata copied to clipboard

Fix bug where the real part of the xy autos wasn't corrected

Open bhazelton opened this issue 1 year ago • 2 comments

Description

Fix a bug @d3v-null noticed in the MWA correlator FITS file reader.

Motivation and Context

Types of changes

  • [x] Bug fix (non-breaking change which fixes an issue)
  • [ ] New feature (non-breaking change which adds functionality)
  • [ ] Breaking change (fix or feature that would cause existing functionality to change)
  • [ ] Documentation change (documentation changes only)
  • [ ] Version change
  • [ ] Build or continuous integration change

Checklist:

  • [x] I have read the contribution guide.
  • [x] My code follows the code style of this project.

Bug fix checklist:

  • [ ] My fix includes a new test that breaks as a result of the bug (if possible).
  • [x] All new and existing tests pass.
  • [ ] I have updated the CHANGELOG.

bhazelton avatar Oct 24 '24 18:10 bhazelton

@PyxieLouStar can you look at this and make sure it's right?

bhazelton avatar Oct 24 '24 18:10 bhazelton

I think we determined that it looks like xy aren't being corrected when you read the code, but in fact they are. It's more of a code clarity issue

d3v-null avatar Oct 24 '24 21:10 d3v-null

This looks good! Though as @d3v-null says, the code is actually functioning properly. When cheby_approx=False, most of the values are not corrected in-place due to array reshaping. However, the yx autos end up being corrected in-place, so the data_array assignment is redundant in this case.

PyxieLouStar avatar Nov 11 '24 22:11 PyxieLouStar

ok. I think we should either do this fix or add a comment so that a future reader isn't confused. What would you prefer?

bhazelton avatar Nov 12 '24 22:11 bhazelton

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 99.93%. Comparing base (1297c87) to head (ea18751). Report is 101 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1491   +/-   ##
=======================================
  Coverage   99.93%   99.93%           
=======================================
  Files          63       63           
  Lines       21807    21808    +1     
=======================================
+ Hits        21792    21793    +1     
  Misses         15       15           

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar Nov 12 '24 23:11 codecov[bot]

I think my preference would be to add the fix and also add a comment noting something like: these autos are corrected in-place and the data_array assignment is there in case the in-place correction changes/stops working.

PyxieLouStar avatar Nov 12 '24 23:11 PyxieLouStar

@PyxieLouStar I added the comments, can you take a look when you have a chance?

bhazelton avatar Nov 18 '24 19:11 bhazelton

Looks great!

PyxieLouStar avatar Nov 19 '24 04:11 PyxieLouStar