[PATCH] Instructions to customize the python bindings.

Willi Richert w.richert at gmx.net
Sat Mar 21 10:19:24 UTC 2009


Signed-off-by: Willi Richert <w.richert at gmx.net>
---
 README.Python |   17 +++++++++++++++++
 1 files changed, 17 insertions(+), 0 deletions(-)

diff --git a/README.Python b/README.Python
index 3e1d7da..7c2fa89 100644
--- a/README.Python
+++ b/README.Python
@@ -10,3 +10,20 @@ Please examine the test files to get a grip to the usage.
 To run the tests, type:
 python py-kdtree_test.py
 
+You can customize the data types to create bindings for in the file
+python-bindings/gen-swig-hpp.py:
+
+TREE_TYPES = [(dim, "int", "unsigned long long", "i", "L") for dim in range(2,7)] + \
+             [(dim, "float", "unsigned long long", "f", "L") for dim in range(2,7)]    
+
+This default setup creates 12 bindings. For both int and float
+coordinate data types it creates all versions from 2 to 6
+dimensions. Each point in the space is identified by one unsigned long
+long. This should not be changed. Each tuple in the TREE_TYPES list has the following semantics:
+
+(dimension,
+ C coordinate data type,
+ C payload data type,
+ PyArg_ParseTuple format character to convert the C coordinate data type to Python,
+ PyArg_ParseTuple format character to convert the C payload data type to Python
+)
\ No newline at end of file
-- 
1.5.6.3




More information about the libkdtree-devel mailing list