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: blt slicing and other things for new uvdata 3.0 functionality #931

Closed steven-murray closed 2 months ago

steven-murray commented 6 months ago

Fixes #928

This fixes issues related to the antpair2ind update in pyuvdata v3.0. The biggest issue was that the output of antpair2ind is now no longer guaranteed to be an array of indices, but instead could be either None or a slice object. Furthermore, the results of calls to antpair2ind are now cached on the UVData object, and this cache needs to be refreshed on any update to the blt axis of the data. This is done in UVData.read() but this method is over-written in HERAData so it needed to be added manually.

Bryna's comment: It also fixes things for some other changes in pyuvdata v3.0. There's an update to the telescope metadata handling, which has deprecation but I went ahead and fixed some of the places this comes up. Also, write_vis and write_cal broke when we actually removed support for the current array shapes. In the process of fixing these, I decided that it would be easier and better to just change them to use the .new methods on those objects. That reduces the amount of code that needs to be maintained in this repo. Note that this makes #851 unnecessary.

codecov[bot] commented 5 months ago

Codecov Report

Attention: Patch coverage is 88.57143% with 8 lines in your changes are missing coverage. Please review.

Project coverage is 97.18%. Comparing base (93f6fa3) to head (bbb76f5).

Files Patch % Lines
hera_cal/io.py 88.23% 8 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #931 +/- ## ========================================== - Coverage 97.25% 97.18% -0.08% ========================================== Files 30 30 Lines 10766 10733 -33 ========================================== - Hits 10471 10431 -40 - Misses 295 302 +7 ``` | [Flag](https://app.codecov.io/gh/HERA-Team/hera_cal/pull/931/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=HERA-Team) | Coverage Δ | | |---|---|---| | [unittests](https://app.codecov.io/gh/HERA-Team/hera_cal/pull/931/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=HERA-Team) | `97.18% <88.57%> (-0.08%)` | :arrow_down: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=HERA-Team#carryforward-flags-in-the-pull-request-comment) to find out more.

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

steven-murray commented 2 months ago

@jsdillon I'm inclined to merge even though not all lines are covered -- the remaining lines are very difficult to cover right now (most of them will be covered once pyuvdata 3 is out by default, and then we can remove some other code branches)

jsdillon commented 2 months ago

Fine by me.

On Wed, May 22, 2024 at 12:45 PM Steven Murray @.***> wrote:

@jsdillon https://github.com/jsdillon I'm inclined to merge even though not all lines are covered -- the remaining lines are very difficult to cover right now (most of them will be covered once pyuvdata 3 is out by default, and then we can remove some other code branches)

— Reply to this email directly, view it on GitHub https://github.com/HERA-Team/hera_cal/pull/931#issuecomment-2125623205, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABIJK424Q54RAJCQFM45GHLZDTYVTAVCNFSM6AAAAABCTNBYC6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMRVGYZDGMRQGU . You are receiving this because you were mentioned.Message ID: @.***>