mapping method with cython