[C++-sig] Combining Boost Serialization with Boost Python

2012-03-14 Thread James Amundson
I have a use case involving Boost Serialization and Boost Python. I have a (mostly) C++ library wrapped with Python. The C++ code uses Boost Serialization to periodically create checkpoints from which the user can resume later. Getting the serialization and python libraries to work together did

Re: [C++-sig] How can I pass derived Python instances to C++?

2011-09-08 Thread James Amundson
On 09/08/2011 12:17 PM, Stefan Seefeld wrote: On 2011-09-08 13:01, James Amundson wrote: I would like to be able to create a Python class derived from a C++ class, then pass a instance of the Python class back to C++. It isn't clear to me if there is an easy way to do this. import foo

[C++-sig] How can I pass derived Python instances to C++?

2011-09-08 Thread James Amundson
I would like to be able to create a Python class derived from a C++ class, then pass a instance of the Python class back to C++. It isn't clear to me if there is an easy way to do this. Here is a simple example of what I wish worked, but doesn't: C++ side: #include #include class Foo { publ

Re: [C++-sig] group meeting today

2011-04-21 Thread James Amundson
I apologize for my clumsy fingers. This message was meant for a different mailing list. On 04/21/2011 11:04 AM, James Amundson wrote: Today we will have another technical group meeting. Alex and I will discuss approaches to canonical transformations and Lorentz boosts in space charge

[C++-sig] group meeting today

2011-04-21 Thread James Amundson
Today we will have another technical group meeting. Alex and I will discuss approaches to canonical transformations and Lorentz boosts in space charge calculations. --Jim ___ Cplusplus-sig mailing list Cplusplus-sig@python.org http://mail.python.org/

Re: [C++-sig] Generating API documentation when using boost::python

2010-04-15 Thread James Amundson
On 04/15/2010 03:53 AM, Murray Cumming wrote: (If anyone can suggest a better alternative to nasty pydoc, I'd be glad.) Well, Sphinx, , is the new standard for Python documentation, but I don't think it has any way to extract documentation from your boost python

Re: [C++-sig] Boost python exception translation failure on BlueGene/P

2010-02-24 Thread James Amundson
On 02/18/2010 04:24 PM, James Amundson wrote: Boost Python seems to be failing to catch and translate C++ exceptions for me on a BlueGene/P installation. I really don't know what to do next in debugging the problem, so I would appreciate any advice. I have finally solved this problem m

Re: [C++-sig] Boost python exception translation failure on BlueGene/P

2010-02-18 Thread James Amundson
On 02/18/2010 05:19 PM, Ralf W. Grosse-Kunstleve wrote: Your problem may be that an exception thrown in one .so isn't correctly caught in another .so. Hmmm. I only have one module in my test -- pyexcept. Is the fact that it has to link to libboost_python enough to cause that problem? In th

[C++-sig] Boost python exception translation failure on BlueGene/P

2010-02-18 Thread James Amundson
Boost Python seems to be failing to catch and translate C++ exceptions for me on a BlueGene/P installation. I really don't know what to do next in debugging the problem, so I would appreciate any advice. I have a simple test module, pyexcept -

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

2009-11-04 Thread James Amundson
On 10/30/2009 10:43 PM, Ravi wrote: Use class_.staticmethod(...) as shown below: Thanks. That's what I needed. Best, Jim Amundson ___ Cplusplus-sig mailing list Cplusplus-sig@python.org http://mail.python.org/mailman/listinfo/cplusplus-sig

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

2009-10-30 Thread James Amundson
Hi, I have the following code: --- #include #include class Foo { public: Foo() {} ; static void doit(const char * message) { std::cout << "doing it statically: " << message << "\n"; }; void non

Re: [C++-sig] boost python to/from python type conversion

2009-10-01 Thread James Amundson
On 10/01/2009 01:22 AM, Austin Bingham wrote: If it's any help, I wrote a small bit on the details of writing converters. It might help clarify some of the mechanics which, I agree, are a bit mysterious: http://misspent.wordpress.com/2009/09/27/how-to-write-boost-python-converters/ Wond

Re: [C++-sig] boost python to/from python type conversion

2009-10-01 Thread James Amundson
On 09/30/2009 11:48 PM, Ralf W. Grosse-Kunstleve wrote: lvalue_from_pytype only works for passing by value or const references/pointers, but that seems to match your case, since you MPI_Comm is passed by value to your sayhello(). However, wrapping extern "C" isn't portable, AFAIK. You'll need a

[C++-sig] boost python to/from python type conversion

2009-09-30 Thread James Amundson
Hi, I'm trying to write to/from type converters for my code, and I'm stuck. My case doesn't map well to any of those in the boost python documentation. I'm trying to pass objects of type MPI_Comm (really a C type!) back and forth with mpi4py (which uses cython internally.) The mpi4py author h