Uploaded image for project: '1D Redmine '
  1. 1D Redmine
  2. REDMINE1D-340

[RM-8427] [swing bindings] remove the std::vector -> numpy array wrapper

    XMLWordPrintable

    Details

    • Type: Task
    • Status: Done (View Workflow)
    • Priority: Normal
    • Resolution: Done
    • Labels:
      None

      Description

      Created on 2023-10-19 14:15:44 by Didier Vibert. % Done: 100

      The wrapper (pyconv.h) was written to be able to bind std::vector to numpy arrays. This wrapper has a drawback since it returns a raw pointer to the std::vector data buffer without having the property of this vector. Thus it is not controlling the life-time of the buffer which may not survive the use of the returned pointer that seems to be directly bind by swig to the numpy array buffer.

      we can remove all these wrappers, since swig is able to bind a std::vector to a python list, and then we can convert the list to a numpy array in the python API code.

      we should also check if swig 4 is able to bind a std::vector to a numpy array without any wrapper... If I am correct I think it can !

      MR: https://gitlab.lam.fr/CPF/cpf-redshift/-/merge_requests/561

        Attachments

          Activity

            People

            • Assignee:
              r2j.migrate Redmine-Jira Migtation
              Reporter:
              r2j.migrate Redmine-Jira Migtation
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: