
Improving python function efficiency by translating to Cython
- or -
Post a project like this1329
€200(approx. $229)
- Posted:
- Proposals: 4
- Remote
- #3442033
- Awarded
Description
Experience Level: Entry
Estimated project duration: 1 day or less
We are a small company working with decision support tools developed in Python.
We want to test if we can reduce our computation time be introducing Cython functions where we have bottlenecks in our code.
This is an initial test with some simple functions to start (see the attachment), but we would want to expand this approach to a lot of areas if it successful.
The task is to write equivalent functions in Cyhton, compile them and create a benchmark script that shows significant improvements over the initial functions.
We have 4 functions we want rewritten:
linspace_latlon
linspace_leg_space
NumbaNearestIdx
NumbaNearestIdxInList
we have a reference function to compare NumbaNearestIdxInList with
Benchmark_NearestIdxInList, this is the function we want to beat with the Cython version of NumbaNearestIdxInList
The script has been uploaded as a txt file as .py files are not allowed.
The scripts consists of a section with the function definitions and a if __name__ == "__main__": section with the input data and the timing of the current functions.
By running this script you can see the times to beat.
We know that there are many ways to speed up this code, but for this specific project we want to explore the use of Cython.
We want to test if we can reduce our computation time be introducing Cython functions where we have bottlenecks in our code.
This is an initial test with some simple functions to start (see the attachment), but we would want to expand this approach to a lot of areas if it successful.
The task is to write equivalent functions in Cyhton, compile them and create a benchmark script that shows significant improvements over the initial functions.
We have 4 functions we want rewritten:
linspace_latlon
linspace_leg_space
NumbaNearestIdx
NumbaNearestIdxInList
we have a reference function to compare NumbaNearestIdxInList with
Benchmark_NearestIdxInList, this is the function we want to beat with the Cython version of NumbaNearestIdxInList
The script has been uploaded as a txt file as .py files are not allowed.
The scripts consists of a section with the function definitions and a if __name__ == "__main__": section with the input data and the timing of the current functions.
By running this script you can see the times to beat.
We know that there are many ways to speed up this code, but for this specific project we want to explore the use of Cython.

Thor A.
0% (0)Projects Completed
1
Freelancers worked with
1
Projects awarded
100%
Last project
16 Nov 2021
Denmark
New Proposal
Login to your account and send a proposal now to get this project.
Log inClarification Board Ask a Question
-
There are no clarification messages.
We collect cookies to enable the proper functioning and security of our website, and to enhance your experience. By clicking on 'Accept All Cookies', you consent to the use of these cookies. You can change your 'Cookies Settings' at any time. For more information, please read ourCookie Policy
Cookie Settings
Accept All Cookies