Details
-
Type:
Story
-
Status: Won't Fix
-
Resolution: Done
-
Fix Version/s: None
-
Component/s: afw
-
Labels:
-
Story Points:2
-
Team:Alert Production
Description
PhotoCalib is not hashable. As part of removing Calib, I've removed its hash function, but we now need one for PhotoCalib. It should probably delegate to the underlying BoundedField (so we'll need hash functions for those), and combine that with the hash of the mean and err.
To first order, one could also just combine the hash of the mean and error: for any two "interesting" PhotoCalibs, those should be different, whatever the underlying BoundedFields are.
Well, it's not clear to me that a PhotoCalib is really a value type rather than a utility class. In the former case, we should support hashability, just so that future developers don't have to waste time going "oh, it looks like I wasn't supposed to do that"; in the latter, it doesn't make sense. It sounds like John Parejko leans toward a PhotoCalib being a value.
The main problem is a purely technical one: the way C++ handles hashing works very poorly with polymorphism, and therefore BoundedField, so supporting hashing is a lot more work than supporting equality. So based on the expense I agree with John Swinbank that we shouldn't make it a priority.