SciTools/iris — pull request #1016 by esc24 (2014-02-10 15:32:24+00:00)
Title: Changes to raise exceptions when comparing bounded datetime cells

This PR is in response to unexpected and highly undesirable behaviour identified by #984. The effect of this PR is to raise an exception when attempting to constrain bounded time coords with the new date time cell comparison feature. This is disappointing, but without calendar information it is not possible to determine whether a PartialDateTime (or any other calendar-agnostic datetime-like object) lies within a bounded region. As Iris currently stands you'll get the wrong answer when performing such constraints and absolutely no indication that something has gone awry. Note that point based datetime constraints (i.e. those in the docs) are fine.

Please also notice that I've put in some special behaviour around ```netcdftime.datetime``` objects as I can do:
```
>>> import netcdftime
>>> a = netcdftime.datetime(2000, 1, 1)
>>> b = netcdftime.datetime(1990, 1, 1)
>>> a > b
False
>>> a < b
True
```
This fallback to id-based comparison (I think) makes comparing netcdftime.datetime objects to anything other than PartialDateTimes unreliable. I'd rather not put this time-specific/netcdftime-specific logic in ```coords.py``` but I can't think of a better place without a lot of work.