Project: datamanagement
Issue DM-4923: want to see locations in trace when butler raises because multiple locations were found
daf_persistence 11.0-2-g56eb0a1+1 gives the unhelpful error message: {code} > RuntimeError: Unable to retrieve bias for {'category': 'A', 'taiObs': '2015-12-22', 'visit': 7292, 'site': 'S', 'dateObs': '2015-12-22', 'filter': 'PFS-M', 'field': 'DARK', 'spectrograph': 2, 'ccd': 5}: No unique lookup for ['calibDate', 'calibVersion'] from {'category': 'A', 'taiObs': '2015-12-22', 'visit': 7292, 'site': 'S', 'dateObs': '2015-12-22', 'filter': 'PFS-M', 'field': 'DARK', 'spectrograph': 2, 'ccd': 5}: 2 matches {code} (the old butler did this too). The user wants to know what the 2 matches were -- it's user error, but the user needs help and printing the first few options (nicely formatted) is very useful. I think I did this on the HSC side. The butler code in question is actually in butlerUtils/python/lsst/daf/butlerUtils/mapping.py and my post-doc gave me the wrong package. It's in need(): {code} > if len(lookups) != 1: > raise RuntimeError, "No unique lookup for %s from %s: %d matches" % (newProps, newId, len(lookups)) {code}
Story points: 1