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

Implement pol_convention in pstokes module #404

Merged
merged 6 commits into from
Jul 19, 2024

Conversation

adeliegorce
Copy link
Contributor

@adeliegorce adeliegorce commented Jul 18, 2024

This PR introduces some changes to the pstokes module for two purposes

  1. Take into account the new pol_convention attribute of UVData objects (see this PR) when constructing pseudo-Stokes polarizations whilst ensuring backwards compatibility (if there is no pol_convention, then there is a warning and avg is assumed). This is commit 6ffd0dc.
  2. As per @jsdillon's request, create a new method called _combine_pol_arrays (final name still open to debate) which takes lists of data, flags, and nsamples arrays and combines them into pseudo-Stokes following the appropriate pol_convention (i.e. avg and sum). Although I see how useful this method can be, it does make the code slightly heavy so, reviewers, please let me know if you have any suggestions on how to make things cleaner. This is commit 2601670.
    I added new tests and modified existing ones accordingly.

@adeliegorce adeliegorce linked an issue Jul 18, 2024 that may be closed by this pull request
Copy link

codecov bot commented Jul 18, 2024

Codecov Report

Attention: Patch coverage is 97.72727% with 1 line in your changes missing coverage. Please review.

Project coverage is 96.09%. Comparing base (8950367) to head (7a030d4).
Report is 4 commits behind head on main.

Files with missing lines Patch % Lines
hera_pspec/pstokes.py 97.72% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main     #404   +/-   ##
=======================================
  Coverage   96.09%   96.09%           
=======================================
  Files          17       17           
  Lines        6121     6152   +31     
=======================================
+ Hits         5882     5912   +30     
- Misses        239      240    +1     
Flag Coverage Δ
unittests 96.09% <97.72%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

Copy link
Member

@jsdillon jsdillon left a comment

Choose a reason for hiding this comment

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

Thanks @adeliegorce! A handful of comments, mostly related to documentation, as well as one substantial one about nsamples.

hera_pspec/pstokes.py Show resolved Hide resolved
hera_pspec/pstokes.py Outdated Show resolved Hide resolved
hera_pspec/pstokes.py Outdated Show resolved Hide resolved
hera_pspec/pstokes.py Outdated Show resolved Hide resolved
hera_pspec/pstokes.py Outdated Show resolved Hide resolved
hera_pspec/pstokes.py Outdated Show resolved Hide resolved
hera_pspec/tests/test_pstokes.py Show resolved Hide resolved
@adeliegorce
Copy link
Contributor Author

Hi @jsdillon, I made the requested changes. Let me know if you're happy with the new version.

Copy link
Contributor

@steven-murray steven-murray left a comment

Choose a reason for hiding this comment

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

Thanks @adeliegorce -- I htink is almost ready to go, but does need a simple fix

hera_pspec/pstokes.py Outdated Show resolved Hide resolved
@adeliegorce
Copy link
Contributor Author

Done!

Copy link
Member

@jsdillon jsdillon left a comment

Choose a reason for hiding this comment

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

Just one suggestion that will hopefully avoid confusion in some weird edge cases

hera_pspec/pstokes.py Outdated Show resolved Hide resolved
@jsdillon
Copy link
Member

Looks good, thanks @adeliegorce!

@adeliegorce adeliegorce merged commit 4151d80 into main Jul 19, 2024
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement psuedostokes that uses pol_convention appropriately
3 participants