Uploaded image for project: 'Data Management'
  1. Data Management
  2. DM-2347

(In)equality semantics of Coords are confusing

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Done
    • Resolution: Done
    • Fix Version/s: None
    • Component/s: afw
    • Labels:
      None

      Description

      Viz:

      In [1]: from lsst.afw.coord import Coord
      In [2]: c1 = Coord("11:11:11", "22:22:22")
      In [3]: c1 == c1, c1 != c1
      Out[3]: (True, False)
      In [4]: c2 = Coord("33:33:33", "44:44:44")
      In [5]: c1 == c2, c1 != c2
      Out[5]: (False, True)
      In [6]: c3 = Coord("11:11:11", "22:22:22")
      In [7]: c1 == c3, c1 != c3
      Out[7]: (True, True)

      c1 is simultaneously equal to and not equal to c3!

        Attachments

          Activity

          swinbank John Swinbank created issue -
          swinbank John Swinbank made changes -
          Field Original Value New Value
          Description Viz:

          {code}
          In [1]: from lsst.afw.coord import Coord
          In [2]: c1 = Coord("11:11:11", "22:22:22")
          In [3]: c1 == c1, c1 != c1
          Out[3]: (True, False)
          In [4]: c2 = Coord("33:33:33", "44:44:44")
          In [5]: c1 == c2, c1 != c2
          Out[5]: (False, True)
          In [6]: c3 = Coord("11:11:11", "22:22:22")
          In [7]: c1 == c3, c1 != c3
          Out[7]: (True, True)
          {code}

          `c1` is simultaneously equal to *and* not equal to `c3`!
          Viz:

          {code}
          In [1]: from lsst.afw.coord import Coord
          In [2]: c1 = Coord("11:11:11", "22:22:22")
          In [3]: c1 == c1, c1 != c1
          Out[3]: (True, False)
          In [4]: c2 = Coord("33:33:33", "44:44:44")
          In [5]: c1 == c2, c1 != c2
          Out[5]: (False, True)
          In [6]: c3 = Coord("11:11:11", "22:22:22")
          In [7]: c1 == c3, c1 != c3
          Out[7]: (True, True)
          {code}

          {{c1}} is simultaneously equal to *and* not equal to {{c3}}!
          swinbank John Swinbank made changes -
          Epic Link DM-1910 [ 15942 ]
          swinbank John Swinbank made changes -
          Story Points 1
          swinbank John Swinbank made changes -
          Reviewers Jim Bosch [ jbosch ]
          Status To Do [ 10001 ] In Review [ 10004 ]
          jbosch Jim Bosch made changes -
          Status In Review [ 10004 ] Reviewed [ 10101 ]
          swinbank John Swinbank made changes -
          Resolution Done [ 10000 ]
          Status Reviewed [ 10101 ] Done [ 10002 ]

            People

            Assignee:
            swinbank John Swinbank
            Reporter:
            swinbank John Swinbank
            Reviewers:
            Jim Bosch
            Watchers:
            Jim Bosch, John Swinbank, Paul Price
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Jenkins Builds

                No builds found.