Re: [Numpy-discussion] Extending C with Python

2018-02-06 Thread Jialin Liu
With PyObject_CallMethod(pInstance, method_name, "O", py_dims); Can I pass in a reference and modify its content in python? Best, Jialin On Sat, Feb 3, 2018 at 10:29 AM, Jialin Liu wrote: > Thank you guys. > > Best, > Jialin > > Sent from my iPhone > > O

Re: [Numpy-discussion] Extending C with Python

2018-02-03 Thread Jialin Liu
Thank you guys. Best, Jialin Sent from my iPhone > On Feb 3, 2018, at 8:11 AM, Sylvain Corlay wrote: > > You can also check out pybind11, xtensor, and xtensor-python > > The latter enables a high-level numpy-like API on the C++ side. > > You can check out the numpy to xtensor cheat sheet: >

Re: [Numpy-discussion] Extending C with Python

2018-01-30 Thread Jialin Liu
Amazing! It works! Thank you Robert. I've been stuck with this many days. Best, Jialin LBNL/NERSC On Tue, Jan 30, 2018 at 10:52 PM, Robert Kern wrote: > On Wed, Jan 31, 2018 at 3:25 PM, Jialin Liu wrote: > >> Hello, >> I'm extending C with python (which is opposit

[Numpy-discussion] Extending C with Python

2018-01-30 Thread Jialin Liu
Hello, I'm extending C with python (which is opposite way of what people usually do, extending python with C), I'm currently stuck in passing a C array to python layer, could anyone plz advise? I have a C buffer in my C code and want to pass it to a python function. In the C code, I have: npy_int