DerThorsten/nifty

pybind11 prints numpy array if signature is not matching

DerThorsten opened this issue · 4 comments

If we use a PyView<float, 1>
and pass a 2D numpy array the whole array is printed.... literally the whole array, every element....
this is super annoying...

This needs to be fixed asap!

If I remember correctly, the same thing happens if you pass a graph if the signature is not matching.
So for a nifty::graph::UndirectedGraph all nodes and uv-ids are printed.

Maybe it was just the repr method in the graph.
I removed this method.

I guess changes are high that this will fix the issue

still active...for instance, if one calls

solver.optimize(startSol,visitor)

instead of

solver.optimize(visitor, startSol)

the whole startSol array is printed

This is fixed in a PR from me in the pybind11 repo ( pybind/pybind11#901 )
Lets see if this is merged