Bug: latency reported for an early-warning notice with negative latency
If an early-warning notice was issued with negative latency (as we hope will happen!), the latency of the skymap is being incorrectly described in the circular template as "about a day after the candidate event time." Example: https://gracedb-playground.ligo.org/api/superevents/S230516c/files/preliminary-circular.txt . Ideally, the circular would say something like "about 12 seconds before the candidate event time", but the code in initial_body.jinja2 always uses "after", and in fact the naturaldelta
code in the humanize module (https://python-humanize.readthedocs.io/en/latest/time/) assumes very deeply that the time delta is nonnegative; it simply wasn't written to be able to return something like "-12 seconds". The naturaltime
method, on the other hand, deals with either positive or negative time deltas, but it looks like it always produces a string with "__ from now" or "__ ago" in it; there isn't an option to change those words. So one way or another -- with naturaldelta
or naturaltime
-- some further hoop-jumping is needed to describe a negative latency in the circular. Probably can use code similar to the beforeafter
in RAVEN_circular.jinja2.