Skip to content
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

Merged
merged 2 commits into from Apr 19, 2024

Conversation

arunkannawadi
Copy link
Member

No description provided.

@arunkannawadi arunkannawadi force-pushed the tickets/DM-43969 branch 3 times, most recently from 1ceea79 to ac2ca3a Compare April 18, 2024 22:55
in sizeExtendedness plugin.
Copy link
Contributor

@parejkoj parejkoj left a 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.

@@ -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."""
Copy link
Contributor

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
Copy link
Contributor

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?

catalog["slot_Shape_flag"] = 1
for record in catalog:
with self.subTest(id=record["id"]):
with self.assertRaises(measBase.MeasurementError):
Copy link
Contributor

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.

@arunkannawadi arunkannawadi merged commit f18bd83 into main Apr 19, 2024
2 checks passed
@arunkannawadi arunkannawadi deleted the tickets/DM-43969 branch April 19, 2024 18:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants