Oops. I see that you changed afw to add wcsNearlyEqualOverBBox. Sorry I missed that the first time. My initial reaction is that it's not really necessary and
DM-3347 might suffice with less clutter. However, others in RFC-28 did call for predicates so I may be in the minority in that opinion. My discomfort with predicates in situations where something is evaluated at many points (e.g. comparing WCSs) is as follows:
- A predicate in production code should probably short-circuit rather than testing at every point, whereas a unit test assert should test every point and report the worst behavior. Thus it is not trivial to implement the latter in terms of the former and the predicate should probably not produce the same detailed information as the assert.
- In this case your code would run faster with a short-circuiting predicate; I don't know if it's worth adding that.
In any case, I am against adding a predicate unless it short circuits (or can be made to do so). Being able to short circuit or not sounds a bit messy, as is being able to return information about the failure. Maybe one public function with a simple, clean interface can do it all, but if not, another option is to write an underlying implementation that has a messier interface and call that from the public predicate and public assert.
Finally...do you really need to call this assert/predicate at all? I thought the fitter returned some measure of success. Maybe it would suffice to use that?