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-43982: Raise FatalAlgorithmError in sizeExtendedness plugin #271
Conversation
59fadac
to
f5d2dc3
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.
I had originally intended to catch this in __init__
but we cannot guarantee that the required shape algorithms are registered before this. We should allow them to be registered in any order, since the plugins are ordered only at run time.
A measurement plugin's |
You're absolutely right. The plugins are initialized according to their execution order value. So we can definitely move up this check during initialization which is still at runtime, but not during config validation time (as John had originally intended, I assume). A plugin's config knows nothing about other plugins. |
6c7019e
to
4425b5c
Compare
python/lsst/meas/base/plugins.py
Outdated
if not all(("slot_Shape" in schema.getAliasMap().keys(), | ||
"slot_PsfShape" in schema.getAliasMap().keys(), |
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.
Do you have to get the alias map here, or can you just ask "slot_Shape" in schema
? I just checked and that appears to do what you'd want.
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.
You'd have had to do "slot_Shape_xx" in schema
and not what you typed, right? I could go either way, but I inclined towards the current implementation since it felt more generalizable without putting in the extra _xx
by hand.
python/lsst/meas/base/plugins.py
Outdated
@@ -695,6 +701,16 @@ def getExecutionOrder(cls): | |||
|
|||
def __init__(self, config, name, schema, metadata): | |||
SingleFramePlugin.__init__(self, config, name, schema, metadata) | |||
|
|||
# Check that the required columns are already in the schema. | |||
if not all(("slot_Shape" in schema.getAliasMap().keys(), |
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.
Instead of all
, just and
them. There's on two things, no need for all
.
Testing this against ap_verify, this doesn't actually solve the problem. It looks like I need to clear all the slots in CalibrateImageTask, as the schema there has the slots defined but they're not pointing to anything. For example I'll separately fix CalibrateImage to remove all the nonexistent slots (probably om DM-43973). |
I can confirm the same. The previous version had |
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, I think this does take care of all the necessary cases.
if the required columns are missing.
887c5a7
to
b653471
Compare
No description provided.