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

Background::getImage<T> works only if T=float

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: To Do
    • Resolution: Unresolved
    • Fix Version/s: None
    • Component/s: afw
    • Labels:
      None
    • Story Points:
      1
    • Team:
      Data Release Production

      Description

      lsst.afw.math.Background originally supported retrieval of float, double, and int images. As part of DM-2778, the double and int overloads were disabled because Approximate did not "yet" support values other than float. However, the templated form of Background::getImage<T> was kept, even though it now only compiles if T = float. This causes surprising compilation errors in new code that is unaware of the implementation details.

      Possible solutions:

      • Try to re-enable double and int support. This will likely require work on Approximate.
      • Replace getImage<T> with ordinary methods. This will break (or at least require a deprecation period for) both C++ and Python code, but leads to a cleaner API in the end.
      • Document and/or static_assert that T must be float, so that at least users who run into this issue don't have to hunt down the cause.

      I don't know which of these solutions is the best, given the current state of the code (and the apparently never-finished RFC-58).

        Attachments

          Issue Links

            Activity

            Hide
            price Paul Price added a comment -

            Background needs a redesign. I suggest closing this WONTFIX.

            Show
            price Paul Price added a comment - Background needs a redesign. I suggest closing this WONTFIX.
            Hide
            krzys Krzysztof Findeisen added a comment -

            My understanding is that Background has needed a redesign for at least four years, but that nobody has gotten around to it or is likely to do so. In that case, I suggest my third option, as it's very cheap (1 story point).

            Show
            krzys Krzysztof Findeisen added a comment - My understanding is that Background has needed a redesign for at least four years, but that nobody has gotten around to it or is likely to do so. In that case, I suggest my third option, as it's very cheap (1 story point).
            Hide
            price Paul Price added a comment -

            Good idea.

            Show
            price Paul Price added a comment - Good idea.

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              krzys Krzysztof Findeisen
              Watchers:
              John Swinbank, Krzysztof Findeisen, Lauren MacArthur, Paul Price
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated: