-
Notifications
You must be signed in to change notification settings - Fork 8
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
gh-272: add tests for glass.points #372
base: main
Are you sure you want to change the base?
Conversation
6edb31e
to
b64f125
Compare
I can't seem to hit the following lines - Lines 227 to 230 in c020f18
@ntessore do you have a specific case in mind that'll hit these lines. Every combination of arguments I have tried results in |
Ah, good catch. The reason is that the batching processes 1000 pixels at a time, but we are using HEALPix maps with only 12 pixels as inputs. Solution: use a higher number of pixels ( def test_positions_from_delta(): # type: ignore[no-untyped-def]
# create maps that saturate the batching in the function
nside = 128
npix = 12 * nside**2
# case: single-dimensional input
ngal = 1e-3
delta = np.zeros(npix)
bias = 0.8
vis = np.ones(npix)
...
# case: only the southern hemisphere is visible
vis[:vis.size//2] = 0.0
lon, lat, cnt = catpos(positions_from_delta(ngal, delta, bias, vis)) # type: ignore[no-untyped-call]
assert cnt.shape == (3, 2)
assert lon.shape == (cnt.sum(),)
assert lat.shape == (cnt.sum(),) |
I see, thanks for the detailed suggestion, @ntessore! I will apply this to the tests. |
f678cee
to
1de25fc
Compare
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.
Can we change the upstream to #368 and fix the typing here?
f43ec94
to
bcab98e
Compare
tests/test_points.py
Outdated
# case: negative delta | ||
|
||
lon, lat, cnt = catpos( | ||
positions_from_delta(ngal, np.linspace(-1, -1, 196608), None, vis) |
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.
why not npix
here and below?
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, updated!
62df4b0
to
4a63162
Compare
Add tests and bump coverage to ~97 for
glass.points
.Closes: #272