Re: [C++-sig] create boost array from a Numpy PyArray without copying data?

2009-01-19 Thread Ravi
, see the following class: template struct ublas_vector_from_numpy Regards, Ravi ___ Cplusplus-sig mailing list Cplusplus-sig@python.org http://mail.python.org/mailman/listinfo/cplusplus-sig

Re: [C++-sig] create boost array from a Numpy PyArray without copying data?

2009-01-20 Thread Ravi
ay is deleted? The array must be deleted from either the python side (via numpy) or from the C++ side (by yourself). Handling this problem is the cause for much of my code (which may still be too heavyweight for you). Regards, Ravi ___ Cplusplus-sig ma

Re: [C++-sig] create boost array from a Numpy PyArray without copying data?

2009-01-21 Thread Ravi
tp://blog.enthought.com/?p=62 for information on fixing this issue. The code I pointed out earlier encapsulates this using a custom deleter in C++ which can be used independently of ublas. Regards, Ravi ___ Cplusplus-sig mailing list

Re: [C++-sig] create boost array from a Numpy PyArray witho ut copying data?

2009-01-22 Thread Ravi
tor of A and a decref in the destructor of A. > And is there a way to get the refcount of an object within Python? I'd > like to test if the refcount is correct. sys.getrefcount(obj) Regards, Ravi ___ Cplusplus-sig mailing list Cplusplu

Re: [C++-sig] create boost array from a Numpy PyArray without copying data?

2009-01-23 Thread Ravi
etrefcount(a)= 2 > sys.getrefcount(a.my_array)= 2 > > --- end output > > Ermm, is that good? > I expected that the refcount would be 1 and not 2. I don't know. I generally avoid these issues by writing custom converters and letting boost.python handle refere

Re: [C++-sig] [boost] [Python] GSoC and Python 3.0 Support

2009-03-11 Thread Ravi
- Stefan Seefeld - Ralf Grosse-Kunstleve - Roman Yakovenko You might try contacting them off list or on c++-sig (cc'ed on this email). > Also thanks Ravi for a list of features that may be candidates for > this project. I will dive into Boost.Python source code to see more > about the

Re: [C++-sig] Question regarding importing libraries to weave

2009-05-15 Thread Ravi
things > up? This is not a boost.python question; I doubt we have very many users of weave here. You may have better luck asking on the numpy lists (numpy- discuss...@scipy.org). Regards, Ravi ___ Cplusplus-sig mailing list Cplusplus-sig@python.or

Re: [C++-sig] Details of Boost.Python Py_Finalize issue?

2009-08-04 Thread Ravi
sts for you to try. Regards, Ravi ___ Cplusplus-sig mailing list Cplusplus-sig@python.org http://mail.python.org/mailman/listinfo/cplusplus-sig

Re: [C++-sig] Details of Boost.Python Py_Finalize issue?

2009-08-06 Thread Ravi
fundamental PyTypeObject used by boost.python but nothing popped out on a cursory look, but then I doubt anyone can find bugs in Dave's code upon cursory examination :-) I am not sure that I can spend enough time on this prior to the end of your GSOC period. Apologies. Regards, Ravi

[C++-sig] [python] Function objects in place of member functions

2009-10-10 Thread Ravi
of X as seen by python; for example, the functor would have an argument type 'double' and would then internally convert the received 'double' argument from the python side into some custom type prior to passing it to the member function of X. In other words, the functor would

Re: [C++-sig] [python] Function objects in place of member functions

2009-10-11 Thread Ravi
internals of boost.python, and only just now got > this working... Do you see problems with this, specifically the > conversion of get_signature from function to metafunction? I don't see any problems with the conversion of get_signature to a metafunction. Do compile times get an

Re: [C++-sig] [python] Function objects in place of member functions

2009-10-12 Thread Ravi
lems with the conversion of get_signature to a > > metafunction. Do compile times get any longer? > > I haven't checked this yet. I have other concerns re typechecking and > automatic conversions... Care to elaborate? Regards, Ravi ___ Cplusplus-sig mailing list Cplusplus-sig@python.org http://mail.python.org/mailman/listinfo/cplusplus-sig

Re: [C++-sig] Numpy ndarray as argument or return value using boost python

2009-10-12 Thread Ravi
8-October/013825.html which supports numpy arrays with and without copying, along with pass by reference and pass by value. Regards, Ravi ___ Cplusplus-sig mailing list Cplusplus-sig@python.org http://mail.python.org/mailman/listinfo/cplusplus-sig

Re: [C++-sig] How do I wrap a static member function?

2009-10-30 Thread Ravi
> .def("nonstatic_doit", &Foo::nonstatic_doit) > ; > } Regards, Ravi ___ Cplusplus-sig mailing list Cplusplus-sig@python.org http://mail.python.org/mailman/listinfo/cplusplus-sig

Re: [C++-sig] Python converters for raw pointers: request for help

2009-10-30 Thread Ravi
rap the raw pointer in a struct and then expose converters to it: struct Mat { struct _p_Mat *ptr; }; If you come up with a better way, I'd be interested. Regards, Ravi ___ Cplusplus-sig mailing list Cplusplus-sig@python.org http://mail.python

Re: [C++-sig] [python] python + phoenix

2009-10-30 Thread Ravi
s safer than > >def("foo", (void(*)(int)) foo); > > and just as safe as, and less verbose than > >void(*fooint)(int) = foo; >def("foo", fooint); > > So that's where I'm at... what do you make of that interface? This is very co

Re: [C++-sig] [python] python + phoenix

2009-11-01 Thread Ravi
; // my_converter uses the components typedef typedef typename my_converter::type Q; Q q; class_( "Obj" ) .def( "my_func", q ) ; Regards, Ravi ___ Cplusplus-sig mailing list Cplusplus-sig@python.org http://mail.python.org/mailman/listinfo/cplusplus-sig

Re: [C++-sig] function types as user-defined converters

2009-12-28 Thread Ravi
e > return type. I'm going to have to think about that one a bit more. Did you have any ideas on this, Troy? This is the last bit I think I'd need in order to replace my code with yours. Regards, Ravi ___ Cplusplus-sig mailing list Cplusplus-sig@python.org http://mail.python.org/mailman/listinfo/cplusplus-sig

Re: [C++-sig] boost python calling conventions support patch submission (__stdcall, __cdecl, __fastcall)

2010-01-10 Thread Ravi
On Tuesday 05 January 2010 12:26:27 Nicolas Lelong wrote: > Is this mailing list the best route to submit this patch, what more work > should be done to get it accepted into trunk ? Please file a trac ticket at svn.boost.org so that this does not get lost.

Re: [C++-sig] Conversion of python files to C++ ostreams

2010-04-04 Thread Ravi
now. > I was only playing with your use case, tossing my results out there. > Ravi and I discussed the as<...> interface at length on this list some > time ago, and I've recently resumed playing with it. I am quite concerned about the divergence. How could I help integrate yo

Re: [C++-sig] Advice sought on making a large C++ application a Python extension

2010-09-06 Thread Ravi
ries as your core code since the coupling will be hard to undo while gaining nothing. Regards, Ravi ___ Cplusplus-sig mailing list Cplusplus-sig@python.org http://mail.python.org/mailman/listinfo/cplusplus-sig

Re: [C++-sig] wrap C++ function with private copy constructor

2011-07-23 Thread Ravi
ocumentation: http://www.boost.org/doc/libs/1_47_0/libs/python/doc/tutorial/doc/html/python/exposing.html#python.virtual_functions_with_default_implementations Regards, Ravi ___ Cplusplus-sig mailing list Cplusplus-sig@python.org http://mail.python.org/mailman/listinfo/cplusplus-sig

Re: [C++-sig] [Boost.Python v3] Features and Scope

2011-09-18 Thread Ravi
t email. It's a very nice separation, though after bad experiences > using SWIG I am a little wary about trying to build a one-size-fits-all > front-end for different languages. Is code for boost.langbinding available anywhere? Or is it currently only