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

Implement Point2DList

    XMLWordPrintable

    Details

    • Type: Story
    • Status: Won't Fix
    • Resolution: Done
    • Fix Version/s: None
    • Component/s: afw
    • Story Points:
      12
    • Sprint:
      Alert Production F16 - 10, Alert Production F16 - 11, Alert Production F16 - 11b, Alert Production S17 - 1, Alert Production S17 - 2
    • Team:
      Alert Production

      Description

      Create an ordered container of Point2D objects.

      The container must interoperate easily with C code. It is recommended, but not required, that it have a view as an array of floating-point coordinates. If a view is not implemented, a fast copy into such a format should be available.

        Attachments

          Issue Links

            Activity

            Hide
            krzys Krzysztof Findeisen added a comment - - edited

            Proposed interface: this class shall be fully mutable, in order to support use cases where the number of points is not known in advance (e.g., data being read directly from disk).

            The interface shall include:

            • All API elements common to std::list and std::vector, including public type aliases, comparison operators, and support for std::swap. These elements will make it easier to use Point2DList with generic container code.
            • std::vector-like methods for adjusting the capacity of internal storage. These will help prevent unnecessary memory allocations, particularly if a view method data is used to access storage (see below).
            • Access methods that convert between a list of N Point2D and an N×2 Array2D. There are two possible approaches:
              • a method, toNdarray, that copies the data into ndarray format, and a constructor and/or assignment operator that accepts an ndarray as an argument.
              • a single method, data, that presents an mutable ndarray view of the object.

            I strongly prefer the copy approach because I don't think it's possible to implement the view in a compiler-independent manner, but I will test the performance of both approaches before making a final decision.

            Show
            krzys Krzysztof Findeisen added a comment - - edited Proposed interface: this class shall be fully mutable, in order to support use cases where the number of points is not known in advance (e.g., data being read directly from disk). The interface shall include: All API elements common to std::list and std::vector , including public type aliases, comparison operators, and support for std::swap . These elements will make it easier to use Point2DList with generic container code. std::vector -like methods for adjusting the capacity of internal storage. These will help prevent unnecessary memory allocations, particularly if a view method data is used to access storage (see below). Access methods that convert between a list of N Point2D and an N×2 Array2D . There are two possible approaches: a method, toNdarray , that copies the data into ndarray format, and a constructor and/or assignment operator that accepts an ndarray as an argument. a single method, data , that presents an mutable ndarray view of the object. I strongly prefer the copy approach because I don't think it's possible to implement the view in a compiler-independent manner, but I will test the performance of both approaches before making a final decision.
            Hide
            krzys Krzysztof Findeisen added a comment - - edited

            Following discussion with Russell Owen, a view-based interface shall be used to provide an ndarray version.

            This ticket shall produce a single container class that holds Point2D but not other types of Point. The code shall be written so that it will be easy to templatize in the future, in particular so that making Point2DList an alias of PointList<double, 2> will not break client code.

            As this class has a very complex (and very C++-ish) interface, creation of a Python interface shall be deferred until Pybind11 is available. The Python interface shall resemble that of the standard library list as closely as possible.

            Show
            krzys Krzysztof Findeisen added a comment - - edited Following discussion with Russell Owen, a view-based interface shall be used to provide an ndarray version. This ticket shall produce a single container class that holds Point2D but not other types of Point . The code shall be written so that it will be easy to templatize in the future, in particular so that making Point2DList an alias of PointList<double, 2> will not break client code. As this class has a very complex (and very C++-ish) interface, creation of a Python interface shall be deferred until Pybind11 is available. The Python interface shall resemble that of the standard library list as closely as possible.
            Hide
            krzys Krzysztof Findeisen added a comment -

            The final design for the LSST-facing WCS interface uses standard vectors of Point and SpherePoint, with conversions to and from lower-level types being implemented as part of DM-8439. Therefore, this issue is no longer necessary.

            Show
            krzys Krzysztof Findeisen added a comment - The final design for the LSST-facing WCS interface uses standard vectors of Point and SpherePoint , with conversions to and from lower-level types being implemented as part of DM-8439 . Therefore, this issue is no longer necessary.

              People

              Assignee:
              krzys Krzysztof Findeisen
              Reporter:
              krzys Krzysztof Findeisen
              Watchers:
              Krzysztof Findeisen
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: