DerThorsten / nifty

A nifty library for graph based image segmentation.
MIT License
43 stars 21 forks source link

pybind11 prints numpy array if signature is not matching #82

Open DerThorsten opened 7 years ago

DerThorsten commented 7 years ago

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!

constantinpape commented 7 years ago

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.

DerThorsten commented 7 years ago

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

DerThorsten commented 7 years ago

still active...for instance, if one calls

solver.optimize(startSol,visitor)

instead of

solver.optimize(visitor, startSol)

the whole startSol array is printed

DerThorsten commented 7 years ago

This is fixed in a PR from me in the pybind11 repo ( https://github.com/pybind/pybind11/pull/901 ) Lets see if this is merged