LALInferencePipe inconsistent trigtime behavior with python version
I was just hit by this bug. When running LALInference pipe with a trigtime file (-g option) with e.g trigtime
1340404040.195
The dag is created with
macrotrigtime="1340404040.19"
which is off by 5ms.
This happen with the system-wide install
lalinference_version LAL: 6.22.0 (CLEAN 38829b72bfb5f26391b9866d286dd77db7942dd1) LALFrame: 1.5.0 (CLEAN 82e1cff967a898f805d0af3b087d1ebbc26fa1d6) LALMetaIO: 1.6.0 (CLEAN 3de8e9fe57276784741965e5abcccae4d9db7fed) LALSimulation: 2.0.0 (CLEAN 3176b3dd6bc5d223fed469d7c5bc6b0a5832ad30) LALBurst: 1.5.4 (CLEAN b6000e54e1fa33e59d56a3fa9dd49339d3bfd71d) LALInspiral: 1.10.0 (CLEAN 3a61bfc5f48b8a103b123dea65c48332d7b6f778) LALPulsar: 1.18.2 (CLEAN bea116d381802e4a208f6e548a2be7d3c5030762) LALInference: 2.0.0 (CLEAN b79963b3f9cbd9784e1e8dc9195dc003eb57e908)
I have isolated the problem to be the cast to string in
def set_trig_time(self,time): """ Set the end time of the signal for the centre of the prior in time """ self.__trigtime=float(time) self.add_var_opt('trigtime',str(time))
in pipe utils.
This problem does not arise when using python3 igwn-py3, which makes me think the issue is a difference in the way python 2 and 3 deals with cast to string.
Notice that the python3 version is doing the right thing. However, we should probably still fix this since it affects the system wide install versions in all clusters. The most obvious negative effect is that dags created with the same identical init files and same identical lalinference version will result in different noise evidences, depending on whether conda is used or not, and make bayes factors wrong.
I believe this might be fixed by changing str with repr in that line. That fixes the issue with python2, but I cannot check if it introduces other issues in python3, since I don't have a python3 install handy.