[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [igraph] Using iGraph API in Python C module
From: |
Tamas Nepusz |
Subject: |
Re: [igraph] Using iGraph API in Python C module |
Date: |
Fri, 5 Jun 2015 23:36:04 +0200 |
User-agent: |
Mutt/1.5.23 (2014-03-12) |
Dear Chris -
I have added igraph.get_include() in the following commit:
https://github.com/igraph/python-igraph/commit/e50191d6f96b48b2885f425b8c725f0768443245
This will probably make it into python-igraph 0.7.1.post7, 0.7.2 or 0.8,
whichever will come first. Let me know if it's urgent for you to get this in an
official release -- in that case, I can probably push out 0.7.1.post7 next
week.
All the best,
Tamas
On 05/22, Chris Cameron wrote:
> Dear Tamas -
>
> Thanks for the reply. I got a basic sample working that sends the result of
> g.__graph_as_cobject() from Python to C and casts that pointer it an
> igraph_t*. I think this means the pointer reference is borrowed and that I
> can avoid managing de-referencing in the C code but I still need to test for
> memory leaks. I don’t understand the relative advantages of raw_pointer() vs
> graph_as_cobject().
>
> If PyIGraph_ToCGraph() is the preferred method, I wish the igraphmodule_api.h
> was distributed with the iGraph C library so it would be in a standard
> location <igraph/igraphmodule_api.h> . An alternative would be to provide a
> function like numpy.distutils.misc_util.get_numpy_include_dirs() that returns
> the install path for python iGraph. I think this would make the setup.py for
> iGraph-based extensions more portable.
>
> The linked git shows a way to use C-iGraph functions on a graph created in
> Python and how to return computation results as both floats and numpy arrays.
> The numpy arrays are created in Python and filled by the C code. It is rough
> code, pieced together from many sources, and the sample computations are
> trivial examples. I would welcome feedback that improves code quality or
> implements better practices.
>
> https://github.com/chrisjcameron/python_igraph_numpy_c_ext
> <https://github.com/chrisjcameron/python_igraph_numpy_c_ext>
>
> Thanks,
> Chris
> _______________________________________________
> igraph-help mailing list
> address@hidden
> https://lists.nongnu.org/mailman/listinfo/igraph-help
--
T.