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

Raise descriptive error for broken display install (GitHub afw #516)

    Details

    • Type: Story
    • Status: In Review
    • Resolution: Unresolved
    • Fix Version/s: None
    • Component/s: afw
    • Labels:
      None
    • Templates:
    • Story Points:
      1
    • Team:
      Alert Production
    • Urgent?:
      No

      Description

      On GitHub afw #516, Brigitta Sipocz writes:

      Consider the following code and the scenario of the 'matplotlib' backend and a broken install where lsst.display is not available.
      https://github.com/lsst/afw/blob/master/python/lsst/afw/display/interface.py#L85-L106

      It raises the somewhat cryptic error message:

      RuntimeError: Unable to set backend to matplotlib: "module 'matplotlib' has no attribute 'DisplayImpl'"

      While the real underlying issue is that lsst.display is not available, matplotlib should never be expected to have a DisplayImpl attribute.

      My naive approach of shuffling the order of elements in the tuple probably makes no sense, adding another try/except might be enough to raise a more relevant error.

      Let me know if you would like a quick PR. (The install has since been fixed, so I won't have a good way to test it).

        Attachments

          Activity

            People

            • Assignee:
              swinbank John Swinbank
              Reporter:
              swinbank John Swinbank
              Reviewers:
              Robert Lupton
              Watchers:
              John Swinbank, Robert Lupton
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:

                Summary Panel