-
Notifications
You must be signed in to change notification settings - Fork 3
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
Enable cross-pol power spectra *and* Python 3 support #189
Conversation
…cross-pol support)
* Bugfixes in tests to make cross-pol work * Replace deprecated Py2 functions, e.g. map(), reduce() * Adapt to new behaviour of dict.keys() etc. which return iterators instead of lists now
The tests are only failing because of a weird bug with the print statement in |
…fix variable description
…version.py test failure
OK, I managed to fix the test failure (it was due to a change in |
@philbull just for posterity: on the hera_pspec telecon 3/5/18 I think we decided to punt on cross-visibility-polarization scalars, and that cross-visibility-pol jacknives should be done in "data units" rather than "cosmo units"--so no scalar. Also, I take back my support for interpreting |
@philbull so I've finished my skim of the PR. it looks good to me with minor requests for revision. ping me when you are done w/ edits and i'll approve! |
Thanks Nick! I've made all the changes you suggested, and improved test coverage slightly to get that coveted green checkmark. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great, thanks @philbull for getting us py3k supported and for the cross-visibility-pol functionality!
This PR enables cross-polarisation support, subject to the limitation that the beam scalar can't be computed for cross-pol yet. (In other words, this PR only allows unnormalised cross-pol spectra to be computed.)
The main change in the PR is to store polarisation pairs inside
UVPSpec
, instead of individual polarisations. Pol-pairs can be specified as tuples, e.g.('xx', 'xx')
, or as specially-constructed integers (there are helper functions to deal with these). Individual polarisations (e.g.'xx'
) are no longer accepted.I also got a bit carried away and enabled Python 3 support in this PR. This required more extensive changes than first expected, as functions like
map()
andreduce()
have been deprecated (now replaced with list comprehensions andnp.reduce
), some string handling has changed (especially annoying for HDF5), and methods likedict.keys()
now return iterators instead of lists, and so can't be indexed directly (fixed by callinglist()
on the iterators).