Thanks Greg,
Based on the links, I will try option 3, cause my number of matrixes is a
parameter of my function.
BR,
Guillaume
De : Greg Landrum <greg.land...@gmail.com>
Date : mardi, 8 mai 2018 à 15:30
À : Guillaume GODIN <guillaume.go...@firmenich.com>
Cc : RDKit Discuss <rdkit-discuss@lists.sourceforge.net>
Objet : Re: [Rdkit-discuss] returning multiples matrixes in python
Hi Guillaume,
I don't think I have any specific example for this, but there's some sample
code here on how to return a numpy array using boost::python (which is what the
RDKit uses for the wrappers):
https://stackoverflow.com/a/34023333
If you know how many elements the tuple will have when you're writing the code,
you can use python::make_tuple:
https://github.com/rdkit/rdkit/blob/f4529c910e546af590c56eba01f96e9015c269a6/Code/Geometry/Wrap/Point.cpp#L20
or you can just create a python::list in C++ and return it as a tuple. Here's
an example:
https://github.com/rdkit/rdkit/blob/020024ee5cb612781239e4ca152a4a51f6ff1b1d/Code/GraphMol/MolInterchange/Wrap/rdMolInterchange.cpp#L29
-greg
On Tue, May 8, 2018 at 6:57 AM Guillaume GODIN
<guillaume.go...@firmenich.com<mailto:guillaume.go...@firmenich.com>> wrote:
Dear All,
I’m working on a c++ reimplementation of random Coulomb matrix generator via
RDKit. I was able to generate one matrix per conformer but how to pass
multiples matrixes per conformer ? At the end I need a list of matrixes in
numpy for each conformer.
Best regards,
Guillaume
***********************************************************************************
DISCLAIMER
This email and any files transmitted with it, including replies and forwarded
copies (which may contain alterations) subsequently transmitted from Firmenich,
are confidential and solely for the use of the intended recipient. The contents
do not represent the opinion of Firmenich except to the extent that it relates
to their official business.
***********************************************************************************
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org!
http://sdm.link/slashdot_______________________________________________
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net<mailto:Rdkit-discuss@lists.sourceforge.net>
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
***********************************************************************************
DISCLAIMER
This email and any files transmitted with it, including replies and forwarded
copies (which may contain alterations) subsequently transmitted from Firmenich,
are confidential and solely for the use of the intended recipient. The contents
do not represent the opinion of Firmenich except to the extent that it relates
to their official business.
***********************************************************************************
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss