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

ds9.py error code not working as intended

    Details

    • Type: Bug
    • Status: Done
    • Resolution: Done
    • Fix Version/s: None
    • Component/s: afw
    • Story Points:
      0.5
    • Epic Link:
    • Sprint:
      Alert Production S17 - 2
    • Team:
      Alert Production

      Description

      The following code in afw's display/ds9.py appears to not function as intended:

          except Exception as e:
              # No usable version of display_ds9.
              # Let's define a version of getDisplay() which will throw an exception.
              e.args = ["%s (is display_ds9 setup?)" % e]
       
              def getDisplay(*args, **kwargs):
                  raise e
       
              class DisplayImpl(object):
                  def __init__(self, *args, **kwargs):
                      raise e
      

      To see this run examples/estimateBackground.py with display_ds9 not set up. What I see is:

      Traceback (most recent call last):
        File "examples/estimateBackground.py", line 109, in <module>
          main()
        File "examples/estimateBackground.py", line 89, in main
          ds9.mtv(image, frame=0)
        File "/Users/rowen/UW/LSST/lsstsw3/build/afw/python/lsst/afw/display/ds9.py", line 84, in mtv
          return getDisplay(frame, create=True).mtv(data, title, wcs, *args, **kwargs)
        File "/Users/rowen/UW/LSST/lsstsw3/build/afw/python/lsst/afw/display/ds9.py", line 46, in getDisplay
          raise e
      NameError: name 'e' is not defined
      

      I confess to some surprise. I am not an expert on Python's binding rules, but I expected the code to work.

        Attachments

          Issue Links

            Activity

            rowen Russell Owen created issue -
            rowen Russell Owen made changes -
            Field Original Value New Value
            Assignee Russell Owen [ rowen ]
            rowen Russell Owen made changes -
            Sprint Alert Production S17 - 2 [ 361 ]
            Story Points 0.5
            Team Data Release Production [ 10301 ] Alert Production [ 10300 ]
            rowen Russell Owen made changes -
            Reviewers Tim Jenness [ tjenness ]
            Status To Do [ 10001 ] In Review [ 10004 ]
            rowen Russell Owen made changes -
            Epic Link DM-8472 [ 28104 ]
            tjenness Tim Jenness made changes -
            Status In Review [ 10004 ] Reviewed [ 10101 ]
            rowen Russell Owen made changes -
            Resolution Done [ 10000 ]
            Status Reviewed [ 10101 ] Done [ 10002 ]
            tjenness Tim Jenness made changes -
            Link This issue is triggering DM-9504 [ DM-9504 ]
            tjenness Tim Jenness made changes -
            Link This issue relates to DM-6372 [ DM-6372 ]

              People

              • Assignee:
                rowen Russell Owen
                Reporter:
                rowen Russell Owen
                Reviewers:
                Tim Jenness
                Watchers:
                Russell Owen, Tim Jenness
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Summary Panel