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

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

    Details

    • Type: Bug
    • Status: To Do
    • Resolution: Unresolved
    • Fix Version/s: None
    • Component/s: afw
    • Labels:
      None
    • Templates:
    • 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

              People

              • Assignee:
                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:

                  Summary Panel