SciTools/iris — pull request #881 by shoyer (2013-12-11 07:59:32+00:00)
Title: WIP: New binary operations for cubes

To begin, I refactored iris.analysis.maths to reduce redundant code. It should
be much more straightforward to write a new operation now. I believe all
related tests are still passing.

`iris.analysis.maths.exponentiate` can now take cubes or coordinates as
arguments for the exponent, as long as the units still make sense.

I also added comparison operations `>=`, `<=`, `>` and `<` to
iris.analysis.maths and to cubes. These operators do the cube equivalent of
the standard numpy operations, except with "cube aware" broadcasting.

I would like to change the cube operators `==` and `!=` to match my new
comparison operators but this would change the current API so it definitely
needs to be discussed.

I haven't added much in the way of new tests because the current tests for
numerical operations look very awkward to write, relying on separate test
data. I imagine new tests should go in tests/unit/analysis but I would
appreciate some guidance here.