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

Image object has no __idiv__ method

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: To Do
    • Resolution: Unresolved
    • Fix Version/s: None
    • Component/s: afw
    • Labels:
      None

      Description

      lsst.afw.image.image.image.ImageF has no __idiv__ method defined, so if one tries to do im \= value without having done from __future__ import division (which makes /= point to __itruediv__, then an AttributeError gets raised. Other undesired operators (e.g., __add__, __mul__) raise NotImplementedError, which seems more appropriate. Possible solutions would be to either have __idiv__ raise NotImplementedError (with a helpful message suggesting to please do the __future__ import) or to redirect __idiv__ to __itruediv__.

        Attachments

          Issue Links

            Activity

            Hide
            pschella Pim Schellart [X] (Inactive) added a comment -

            Not having __idiv__ was a deliberate design choice (although I forgot which RFC mandated that). I wonder why there is a difference in the raised error though. We should check what the standard behaviour should be and perhaps modify this upstream.

            Show
            pschella Pim Schellart [X] (Inactive) added a comment - Not having __idiv__ was a deliberate design choice (although I forgot which RFC mandated that). I wonder why there is a difference in the raised error though. We should check what the standard behaviour should be and perhaps modify this upstream.

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              tmorton Tim Morton [X] (Inactive)
              Watchers:
              John Swinbank, Paul Price, Pim Schellart [X] (Inactive), Tim Morton [X] (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:

                  Jenkins

                  No builds found.