The changes to test_functions.py are left-over linting from a previous PR.
The changes to cf.FIeld._binary_operation look scarier than they are :). We've essentailly just moved from 2 cases (axis defined by dim coord, or axis defined by aux coord) to 3 cases (axis defined by dim coord, or axis defined by aux coord, or discrete axis), and the rest is largely just a bit code reorganisation around that (this is old and horrible code!)
This doesn't do what we might hope for in the DSG discrete axis case, but that's not a fault of this code. In this case, it's doing the right thing with the discrete axes, but is the non-discrete axes that unexpected broadcasting, because these axes have no identifying coordinates - that a sperate issue to be dealt with elsewhere.
Fixes #784
Notes
The changes to
test_functions.py
are left-over linting from a previous PR.The changes to
cf.FIeld._binary_operation
look scarier than they are :). We've essentailly just moved from 2 cases (axis defined by dim coord, or axis defined by aux coord) to 3 cases (axis defined by dim coord, or axis defined by aux coord, or discrete axis), and the rest is largely just a bit code reorganisation around that (this is old and horrible code!)This doesn't do what we might hope for in the DSG discrete axis case, but that's not a fault of this code. In this case, it's doing the right thing with the discrete axes, but is the non-discrete axes that unexpected broadcasting, because these axes have no identifying coordinates - that a sperate issue to be dealt with elsewhere.