why not just :

```
if (time < tmin) or (times > tmax):
    err = ("time = %s lies outside of the time axis "
              "[%s, %s]" % (time, tmin, tmax))
    raise ValueError(err)
```