iris icon indicating copy to clipboard operation
iris copied to clipboard

Implemented constraint equality.

Open pp-mo opened this issue 5 years ago • 2 comments

Aiming to address #3616

pp-mo avatar Jul 02 '20 20:07 pp-mo

Although this is technically in progress, it isn't necessarily going to go into Iris 3.2. So to avoid it cluttering the "in progress" column, I will move it to to do. We can then pick it up if we time.

lbdreyer avatar Jan 12 '22 12:01 lbdreyer

If we do get to it then we'll need a rebase onto main before it can be reviewed I think

wjbenfold avatar Jan 12 '22 12:01 wjbenfold

@pp-mo are you able to finish this one off before getting back into #5016? Sounds like this is pretty close.

trexfeathers avatar Nov 10 '22 16:11 trexfeathers

Rebased. but N.B. put in draft temporarily

It is not good to go, since the auto-merged result is still using Coord._as_defn() And we now want to use common metadata instead.

pp-mo avatar Nov 11 '22 15:11 pp-mo

Code now simplified ... On closer inspection, I conclude that the 'coord_name' of a _CoordConstraint is only ever intended to be a string. The only way it can be otherwise is if you construct Constraint(coord_values={something:value}). But whereas my earlier code suggested that 'something' could be a CoordDefn (or, now, a metadata), it actually can't since that is not a hashable type, so cannot act as a dict key. It is still just about "possible" that you could pass a Coord instance as the identifier in this case, but we have no tests for it.
I simply don't believe it is useful, so I'm no longer supporting it as a special case.

pp-mo avatar Nov 11 '22 16:11 pp-mo

@trexfeathers I think this is good to go. Stephen's comment with change request is outstanding, but I think you can dismiss that if you think it is now OK.

pp-mo avatar Nov 11 '22 17:11 pp-mo

Thanks @pp-mo! I'll let @stephenworsley take it over the line.

trexfeathers avatar Nov 11 '22 17:11 trexfeathers

Thanks @stephenworsley I hope this latest addresses all the points raised. Sorry for the delay !

pp-mo avatar Nov 16 '22 16:11 pp-mo

Thanks @stephenworsley I think I've now fixed them all to be the same.

pp-mo avatar Nov 16 '22 17:11 pp-mo

I forgot to mention before, but this still needs a whatsnew entry.

Whoops sorry forgot. Doing it now ...

pp-mo avatar Nov 16 '22 17:11 pp-mo

Hang on now I need to rebase/resolve...

pp-mo avatar Nov 16 '22 17:11 pp-mo

Ok, rebased with added whatsnew

  • please see if that suits, @stephenworsley

pp-mo avatar Nov 16 '22 17:11 pp-mo

Thanks @stephenworsley for going the distance !

pp-mo avatar Nov 17 '22 10:11 pp-mo

Thanks guys! 😀

rcomer avatar Nov 17 '22 19:11 rcomer