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

str() method failure on lsst.ip.isr.Defects class

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Done
    • Resolution: Done
    • Fix Version/s: None
    • Component/s: ip_isr
    • Labels:
      None
    • Story Points:
      1
    • Epic Link:
    • Team:
      Data Release Production
    • Urgent?:
      No

      Description

      Attempt to print an instance of lsst.ip.isr.Defects instance fails with an exception:

      TypeError: __str__() takes 1 positional argument but 2 were given
      

      This comes from a line:

              baseStr = super().__str__(self)
      

      where self is not supposed to be used as an argument.

      This happens in a standalone application, full traceback just in case:

      Traceback (most recent call last):
        File "/project/salnikov/gen3-middleware/daf_butler_tui/python/lsst/daf/butler_tui/app_base.py", line 191, in keypress
          key = child.keypress(size, key)
        File "/home/salnikov/.local/lib/python3.8/site-packages/urwid/container.py", line 1626, in keypress
          key = self.focus.keypress(tsize, key)
        File "/home/salnikov/.local/lib/python3.8/site-packages/urwid/container.py", line 2316, in keypress
          key = w.keypress((mc,) + size[1:], key)
        File "/home/salnikov/.local/lib/python3.8/site-packages/urwid/container.py", line 1135, in keypress
          return self.body.keypress( (maxcol, remaining), key )
        File "/project/salnikov/gen3-middleware/daf_butler_tui/python/lsst/daf/butler_tui/ui/listbox.py", line 51, in keypress
          key = urwid.ListBox.keypress(self, size, key)
        File "/home/salnikov/.local/lib/python3.8/site-packages/urwid/listbox.py", line 968, in keypress
          key = focus_widget.keypress((maxcol,),key)
        File "/project/salnikov/gen3-middleware/daf_butler_tui/python/lsst/daf/butler_tui/ui/columns.py", line 91, in keypress
          self._emit('activated')
        File "/home/salnikov/.local/lib/python3.8/site-packages/urwid/widget.py", line 461, in _emit
          signals.emit_signal(self, name, self, *args)
        File "/home/salnikov/.local/lib/python3.8/site-packages/urwid/signals.py", line 265, in emit
          result |= self._call_callback(callback, user_arg, user_args, args)
        File "/home/salnikov/.local/lib/python3.8/site-packages/urwid/signals.py", line 295, in _call_callback
          return bool(callback(*args_to_pass))
        File "/project/salnikov/gen3-middleware/daf_butler_tui/python/lsst/daf/butler_tui/datasets.py", line 94, in _itemActivated
          self._emit('selected', ref)
        File "/home/salnikov/.local/lib/python3.8/site-packages/urwid/widget.py", line 461, in _emit
          signals.emit_signal(self, name, self, *args)
        File "/home/salnikov/.local/lib/python3.8/site-packages/urwid/signals.py", line 265, in emit
          result |= self._call_callback(callback, user_arg, user_args, args)
        File "/home/salnikov/.local/lib/python3.8/site-packages/urwid/signals.py", line 295, in _call_callback
          return bool(callback(*args_to_pass))
        File "/project/salnikov/gen3-middleware/daf_butler_tui/python/lsst/daf/butler_tui/butler_tui.py", line 91, in datasetSelected
          os.write(fd, str(data).encode())
        File "/software/lsstsw/stack_20210520/stack/miniconda3-py38_4.9.2-0.6.0/Linux64/ip_isr/22.0.0-12-ga88477b+b46bb635de/python/lsst/ip/isr/defects.py", line 171, in __str__
          baseStr = super().__str__(self)
      TypeError: __str__() takes 1 positional argument but 2 were given
      

       

        Attachments

          Activity

          Hide
          salnikov Andy Salnikov added a comment -

          Christopher Waters, assigning this to you, I believe you were the last person who touched that line.

          Show
          salnikov Andy Salnikov added a comment - Christopher Waters , assigning this to you, I believe you were the last person who touched that line.
          Hide
          czw Christopher Waters added a comment -

          After the quick one line fix:

          >>> import lsst.daf.butler as dB
          >>> calibType = 'defects'
          >>> cameraName = 'LATISS'
          >>> verifyCollection = 'u/czw/DM-28920/verifyDefect.20210720a'
          >>> butler = dB.Butler("/repo/main/", collections=[verifyCollection])
          >>> calib = butler.get(calibType, instrument=cameraName, detector=0)
          >>> print(calib)
          Defects(obstype=defects, detector=RXX_S00, )(minimum=(3921, 72), maximum=(3923, 73))...

          Show
          czw Christopher Waters added a comment - After the quick one line fix: >>> import lsst.daf.butler as dB >>> calibType = 'defects' >>> cameraName = 'LATISS' >>> verifyCollection = 'u/czw/DM-28920/verifyDefect.20210720a' >>> butler = dB.Butler( "/repo/main/" , collections=[verifyCollection]) >>> calib = butler.get(calibType, instrument=cameraName, detector= 0 ) >>> print(calib) Defects(obstype=defects, detector=RXX_S00, )(minimum=( 3921 , 72 ), maximum=( 3923 , 73 ))...
          Hide
          salnikov Andy Salnikov added a comment -

          Thanks for a quick fix!

          Show
          salnikov Andy Salnikov added a comment - Thanks for a quick fix!

            People

            Assignee:
            czw Christopher Waters
            Reporter:
            salnikov Andy Salnikov
            Reviewers:
            Andy Salnikov
            Watchers:
            Andy Salnikov, Christopher Waters
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Jenkins

                No builds found.