-
Notifications
You must be signed in to change notification settings - Fork 14
Add hilbert_pixels_from_pixel_scale to model_util #288
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -58,6 +58,48 @@ def test__mge_point_model_from__shared_centre_and_ell_comps(): | |||||||||||||||||||||
| assert model.prior_count == 4 | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
|
|
||||||||||||||||||||||
| def test__hilbert_pixels_from_pixel_scale__above_006(): | ||||||||||||||||||||||
| assert ag.model_util.hilbert_pixels_from_pixel_scale(0.07) == 1000 | ||||||||||||||||||||||
| assert ag.model_util.hilbert_pixels_from_pixel_scale(0.1) == 1000 | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
|
|
||||||||||||||||||||||
| def test__hilbert_pixels_from_pixel_scale__between_004_and_006(): | ||||||||||||||||||||||
| assert ag.model_util.hilbert_pixels_from_pixel_scale(0.05) == 1250 | ||||||||||||||||||||||
| assert ag.model_util.hilbert_pixels_from_pixel_scale(0.061) == 1000 | ||||||||||||||||||||||
|
Comment on lines
+64
to
+68
|
||||||||||||||||||||||
| def test__hilbert_pixels_from_pixel_scale__between_004_and_006(): | |
| assert ag.model_util.hilbert_pixels_from_pixel_scale(0.05) == 1250 | |
| assert ag.model_util.hilbert_pixels_from_pixel_scale(0.061) == 1000 | |
| assert ag.model_util.hilbert_pixels_from_pixel_scale(0.061) == 1000 | |
| def test__hilbert_pixels_from_pixel_scale__between_004_and_006(): | |
| assert ag.model_util.hilbert_pixels_from_pixel_scale(0.05) == 1250 |
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.
hilbert_pixels_from_pixel_scalesilently returns a value for non-physical inputs (e.g.pixel_scale <= 0or NaN), which can mask upstream bugs and produce misleading pixel counts. Consider validating thatpixel_scaleis finite and > 0 and raising aValueError(similar to the validation inmge_point_model_from).