-
Notifications
You must be signed in to change notification settings - Fork 153
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
Add pretransform for full-sphere selection #2360
Conversation
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.
Thanks for the fix and improving the tests!
I could not read out of the test setup if there is actually an example with, say RA > 2*pi input, tested. Otherwise only the small restructuring request.
pretrans = state.pretransform | ||
assert isinstance(pretrans, ProjectionMplTransform) | ||
assert pretrans._state['y_scale'] == 'log' | ||
for angle_unit in ['radians', 'degrees']: |
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.
for angle_unit in ['radians', 'degrees']: | |
for angle_unit in ['radians', 'degrees']: |
I think testing structure would benefit from instead setting this and the other test up with
@pytest.mark.parametrize('angle_unit', ['radians', 'degrees'])
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.
I agree, using parametrize
would be better. Maybe should include the expected mask as a parameter as well?
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.
As in parametrize('angle_unit,expected_mask' (...)
? Had not even thought of that, but yes, that might make it even clearer.
@dhomeier I've updated the tests to use Some of the export tests are now failing. I suspect these failures are unrelated because they're using the |
The same errors with the image export are popping up in the CI of other PRs (e.g. #2365), so I think it's safe to say that they're unrelated. Edit: one of the errors was related, which has been fixed. |
Updated the similar polar test while I was at it to make it a bit more robust.
Just rebased to pick up the changes from #2370 for CI purposes |
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 all good now; I trust that the tests have the correct expected outcomes, thanks!
if self.state.using_full_sphere: | ||
transform = FullSphereLongitudeTransform(next_transform=transform) |
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.
Was wondering why you switched this, as the conversion from degrees should come first, but now realised the pretransforms are applied in reverse polish notation...
I realized that I missed one thing in #2348 with regards to selection. Any points whose latitudes were wrapped back into [-π,π] won't be selected when making a ROI selection because the scatter viewer's
apply_roi
doesn't know about that transformation. This PR adds a pretransform that lets it know about what happens with longitudes.