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

Review for DM-2306: Transforms for Centroid Measurements #14

Merged
merged 15 commits into from Apr 7, 2015

Conversation

TallJimbo
Copy link
Member

No description provided.

We will use the same scaffolding with slighty different methods for setting and
checking fields for testing other transform types.
Thereby make the test code robust against changes to the underlying delimeter.
public:
typedef GaussianCentroidControl Control;
GaussianCentroidTransform(Control const & ctrl, std::string const & name, afw::table::SchemaMapper & mapper);
};
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's much more common in our codebase to have blank lines between each method, typedef, and member in a class (see standard 6-19, though reading that just now is the first time I've noticed that we actually suggest two blank lines in source files).

@TallJimbo
Copy link
Member Author

This looks really good - I especially like the pythonprepend trick you used to make C++ and Python objects callable the same way despite the Control/Config difference.

Aside from the really nitpicky things above, my only big-picture question is whether we need the CoordResult and CoordResultKey objects (or, for that matter, MagResult and MagResultKey). Since measurement algorithms won't be producing those outputs directly, I think only the Transform objects will use them, and they just aggregate two quantities that already have FunctorKeys. I'm inclined to say that we don't need them if we can move all the convenience functionality they provide into the Transform base classes themselves. Quite happy to entertain arguments to the contrary, though.

@jdswinbank
Copy link
Contributor

Thanks for the review!

Regarding your 'big picture' comment, I guess this depends on the likely longer-term uses of the code. It seemed not implausible to me that sometime in the future folks would want to unpack celestial positions from tables into code, and this makes it easy for them to do so. You probably have a better idea than I do as to whether that's long-term-useful, though, and I certainly agree that it's not being used anywhere today, so I have no objection to rearranging things as you suggest.

@TallJimbo
Copy link
Member Author

I suspect anyone wanting extract these values from tables would also want to extract the flags as well, and hence aggregating 2 of the 3 sets of fields they'd want doesn't really gain them much (and unfortunately, extracting the flags in a generic-but-safe way is much harder).

Make it possible to use the same transformation test framework for both single
frame and forced measurement plugins, which require slightly different
initialization.
Previously, this was either not checked or checked only via assertion (which
may be disabled or result in premature termination).

By throw an appropriate exception, the error can be caught and handled in the
calling code.
Provide a specialized version of TransformTestCase that populates the input
of, and checks the output of, centroid transformations.
Remove unused include statements, or convert them to import where necessary,
thereby preventing duplicate exports of C++ code.

As well as being tidier, this is necessary to make the behaviour of
SillyCentroid consistent with the rest of the stack. For example, raising an
exception in SillyCentroid would previously raise `testLib.ExceptionName`
rather than (e.g.) `measBase.ExceptionName`; it would not therefore be caught
by our standard exception handling mechanisms.
These algorithms should report errors, but currently don't so there's no point
allocating space for them. See DM-2368 & -2369.
The PeakCentroid algorithm is implemented in Python, therefore it requires a
Python-based transform.

Separate measurement implementations are used for single frame and forced
algorithms, but only a single transform is required.
@jdswinbank
Copy link
Contributor

@TallJimbo -- branch updated to take account of your suggestions. Currently waiting for buildbot; once that runs successfully, I'll merge to master unless you indicate you'd like to take a further look.

@jdswinbank jdswinbank merged commit 39d2b46 into master Apr 7, 2015
@ktlim ktlim deleted the tickets/DM-2306 branch August 25, 2018 06:50
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