[DAMD-56] Change pfsVisitHash formatting from %08x to 0x%016x Created: 07/May/19 Updated: 24/May/19 Resolved: 24/May/19 |
|
| Status: | Done |
| Project: | Data Model |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Story | Priority: | Normal |
| Reporter: | hassan | Assignee: | hassan |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Attachments: |
|
||||||||||||||||||||||||
| Issue Links: |
|
||||||||||||||||||||||||
| Story Points: | 1 | ||||||||||||||||||||||||
| Description |
|
Currently the above hash is truncated to 8 hex digits, zero-padded. Please correct to 16 hex digits, zero-padded. As mentioned by @rhl in a comment in |
| Comments |
| Comment by hassan [ 08/May/19 ] |
|
With the version of the LSST slack used by the PFS (v16), there is a problem supplying 64 bit hashes to the butler. See attached log file run033.log . The problem can be reduced to the example below. import lsst.daf.base as dafBase ps = dafBase.PropertySet() ps.set('aa', 0x7fffffffffffffff) ps.set('bb', 0xffffffffffffffff) The second set call leads to the following error: Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/Users/hassans/LSST/stack/v16/stack/miniconda3-4.3.21-10a4fa6/DarwinX86/daf_base/16.0/python/lsst/daf/base/propertyContainer/propertyContainerContinued.py", line 193, in set return _propertyContainerSet(self, name, value, self._typeMenu) File "/Users/hassans/LSST/stack/v16/stack/miniconda3-4.3.21-10a4fa6/DarwinX86/daf_base/16.0/python/lsst/daf/base/propertyContainer/propertyContainerContinued.py", line 130, in _propertyContainerSet return getattr(container, "set" + setType)(name, value, *args) TypeError: setLongLong(): incompatible function arguments. The following argument types are supported: 1. (self: lsst.daf.base.propertyContainer.propertySet.PropertySet, name: str, value: int) -> None 2. (self: lsst.daf.base.propertyContainer.propertySet.PropertySet, name: str, value: List[int]) -> None Invoked with: <lsst.daf.base.propertyContainer.propertySet.PropertySet object at 0x101cce3b0>, 'bb', 18446744073709551615 The conclusion of this is that we will proceed with 63 bits instead of 64 bits for the hash. |
| Comment by rhl [ 08/May/19 ] |
|
This isn't a butler problem, it's a lsst.daf.base.PropertySet problem. The fix should be made in python/pfs/datamodel/utils.py and python/pfs/datamodel/target.py (or probably we should refactor this to put the truncation in only one place) |
| Comment by hassan [ 24/May/19 ] |
|
Merged to master (commit 470907c). |