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
DM-43969: Call MeasurementError correctly in sizeExtendedness plugin #270
Conversation
1ceea79
to
ac2ca3a
Compare
in sizeExtendedness plugin.
ac2ca3a
to
c4a3a53
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.
A couple of clarification comments, otherwise this is good.
tests/test_MomentsClassifier.py
Outdated
@@ -56,6 +56,20 @@ def testSingleFramePlugin(self): | |||
for ii in range(self.n_stars, self.n_stars + self.n_gals): | |||
self.assertGreater(catalog[ii].get("base_ClassificationSizeExtendedness_value"), 0.02) | |||
|
|||
def testFailure(self): | |||
"""Test that MeasurementError is raised properly.""" |
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.
Please say here why MeasurementError should be raised in this test?
plugin = task.plugins["base_ClassificationSizeExtendedness"] | ||
plugin_order = plugin.getExecutionOrder() | ||
task.run(catalog, exposure, endOrder=plugin_order) | ||
catalog["slot_Shape_flag"] = 1 |
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 assume this is what causes the raise?
tests/test_MomentsClassifier.py
Outdated
catalog["slot_Shape_flag"] = 1 | ||
for record in catalog: | ||
with self.subTest(id=record["id"]): | ||
with self.assertRaises(measBase.MeasurementError): |
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.
Please use assertRaisesRegex
to confirm that the error you expected is what is being raised. I think just "Shape flag is set." is enough.
c4a3a53
to
ac5733b
Compare
No description provided.