-
Notifications
You must be signed in to change notification settings - Fork 300
Badmaths tests and fixes #2498
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Badmaths tests and fixes #2498
Conversation
|
The user who reported this bug requested that iris catch the case of reversed coordinates and work out that the coordinates match up, but one array is reversed, and simply deals with this accordingly. I believe that this is not what iris should be doing, so I have opted to catch the case and raise an error instead, letting the user adjust the cube themself. |
|
@marqh Default test on last run timed out. Apart from that, everything seems to pass OK. |
|
@corinnebosley this looks good, thank you |
|
It has been reported that this is causing issues with user code. Is it worth releasing 1.13.1 with this change taken out? |
|
Hi @rcomer, thanks for your feedback, I have raised an issue (see this ticket) regarding the behaviour of math ops. I agree that the current behaviour is not quite right, but I also think that it should be consistent between add/subtract and multiply/divide, so we need to decide as a team what the behaviour should be. I have added this to the current project so that we discuss this issue within the dev team and make sure that it gets addressed very soon. In the meantime, you can use What would be really useful is if you could put together a few small use cases for us (like the gravity one in this comment) that we can use to make a decision on behaviour and implementation. I will make sure that you are notified about any changes in this area so that we can get your opinion and suggestions. Thanks! |
When two cubes have coordinates which do not match, an error should be raised if a user tries to perform arithmetic operations on them. These cases are caught by the add and subtract operators, but not the multiply and divide operators.
This PR contains tests for all the operators on a) a pair of cubes with totally non-matching coordinates and b) a pair of cubes with one coordinate array reversed.
It also extends the behaviour of add and subtract to apply to multiply and divide.