python conversion of std::pair and std::array
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 18k
- Forks
- 2.3k
- Avg merge
- 5d 17h
- Merged PRs (30d)
- 10
Description
I have C++ functions, one accept std::vector<std::pair<double,double>> and the other accept std::vector<std::array<double, 2>> as param.
I tried to call with numpy array, the first one will success while the second one will fail.
I look into the param type, there are some difference:
The first one has param type List[Tuple[float, float]]
The second one has param type List[List[float[2]]]
I'm wondering how this will affect the compatibility of numpy?
And if I do want std::vector<std::array<double, 2>> to accept numpy input, how should I do that ?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the reported conversions for C++ functions accepting std::vector<std::pair<double, double>> and std::vector<std::array<double, 2>> with NumPy input. Compare the resulting parameter types and conversion behavior; done means the std::array form's NumPy compatibility is explained and the appropriate behavior or limitation is covered.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp, numpy, python
- Domain
- devtools
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100