Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: set include_cross_pols to False if feed_array has length 1 #1495

Merged
merged 2 commits into from
Nov 5, 2024

Conversation

steven-murray
Copy link
Contributor

@steven-murray steven-murray commented Nov 5, 2024

Description

This simply fixes behavior when setting only a single feed in an AnalyticBeam. You can manually get around this on initialization by setting include_cross_pols=False, but you can't do this when updating an existing object, i.e.

from pyuvdata.analytic_beam import GaussianBeam
from dataclasses import replace

beam = GaussianBeam(diameter=14.0)
new_beam = replace(beam, feed_array=['x'])

This would fail due to the issue resolved here, and you can't specify include_cross_pols in the replace() call, because it's an init-only parameter.

Motivation and Context

Types of changes

  • 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:

Bug fix checklist:

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

Copy link

codecov bot commented Nov 5, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.93%. Comparing base (4e6f3ed) to head (d32869a).
Report is 3 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1495   +/-   ##
=======================================
  Coverage   99.93%   99.93%           
=======================================
  Files          63       63           
  Lines       21748    21750    +2     
=======================================
+ Hits        21733    21735    +2     
  Misses         15       15           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@bhazelton bhazelton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good.

@bhazelton bhazelton merged commit 7f633a2 into main Nov 5, 2024
52 of 54 checks passed
@bhazelton bhazelton deleted the fix-include-cross-pols branch November 5, 2024 16:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants