Google Summer of Code 2023 w/ OpenStreetMap
Develop Python bindings to the OSRM (Open Source Routing Machine) C++ library using nanobind, with the end goal of publishing the package to PyPI. This would allow OSRM to function as a Python library, as well as increase ease of use via the availability of PyPI packages.
In this project, I developed Python bindings for the Open Source Routing Machine C++ backend - using nanobind. Appropriate adaptations were also made for user-friendliness, such that the user is not required to remember specific objects for certain parameter types.
As the project involved the creation of a new repository and package, documentation and appropriate CI workflows and tests for automated tests were also developed - for integration into cibuildwheel, and hence, for easier compilation and deployment of packages.
cibuildwheel
- py-osrm #23: Add push, publish workflows
- py-osrm #21: Add CmakeLists adjustments
- Add remaining CI workflows (push, publish), as well as adjustments to include osrm executables into the wheel.
This allows the Python package to call osrm executables via
python -m osrm <arguments>
for convenience.
- Add remaining CI workflows (push, publish), as well as adjustments to include osrm executables into the wheel.
This allows the Python package to call osrm executables via
- py-osrm #19: Adjust MacOS CI Workflow
- Addressed a bug where CI runs would randomly fail for the MacOS builds, due to a variation in CMake versions between Github Actions assigned runners. This also resulted in a significant decrease in time taken by MacOS CI runs (~2-3 minute reduction).
- py-osrm #15: Add osrm-backend workflow
- py-osrm #13: Add MacOS support to cibuildwheels
- Inclusion of MacOS support to the cibuildwheels workflow, as well as an artifact-building osrm-backend workflow. The goal of this approach was to speed up MacOS CI runs by having a stored artifact that had osrm-backend prebuilt - rather than having to build it every run.
- py-osrm #12: Add cibuildwheels support
- Integration of a cibuildwheels workflow (via Github Actions) - for the creation of Python wheels, and CI based testing.
- py-osrm #9: Add tests, usability adjustments and test data
- Added tests and test data for pytest - for testing of wheels generated by cibuildwheels.
- manylinux #4: Modify to install osrm-backend dependencies
- Customization of a manylinux image to have a custom manylinux image to be used in the py-osrm cibuildwheels workflow, which speeds up CI runs significantly by having osrm-backend dependencies pre-installed.
Documentation
- py-osrm #22: Adjust docs CI & add LICENSE
- py-osrm #18: Add docstrings & mkdocs support
- Addition of documentation via the form of Python docstrings, and implemented mkdocs support, for the creation of a project documentation page served via Github Pages.
Bindings
- py-osrm #9: Add tests, usability adjustments and test data
- Added usability improvements to the bindings, which removes the requirement for the user to remember object types for certain parameter types, and instead, use strings. Added functionality to return expected string values when an invalid string is provided, generating an error message based on a string-type map.
- py-osrm #6: Adding further engine bindings
- py-osrm #4: Adding basic type bindings & lay groundwork for JSON
- py-osrm #3: Adjust OSRM constructors & add RouteParameters
- Added bindings to the osrm-backend project using nanobind, and few abstractions to remove unnecessarily complex initializations for certain parameter types.
- py-osrm #2: Add install/build related files
- Added install/build related files for the bindings, such as CMakeLists, as well as basic bindings groundwork.
There are some issues in the current state of the project:
High Priority:
- Windows support is missing
Medium Priority:
- Some object types do not get abstracted (ie.
Approach
is not instantiable as a string, and hence inaccessible) - The bindings for the
boost::optional
type are awkward, and causes types like optional arrays to be unable to accept "None" - Output of
boost::optional
is not "tangible" (ie. it outputs an object of False type, rather than Python's False)
Low Priority:
- Linter & formatter needs to be added
I'll work on addressing many of these issues soon, as these remaining issues are not something I'm happy about leaving in.
I'm very grateful to my mentors, Nils Nolde and Siarhei Fedartsou for their guidance over the course of GSoC 2023. They helped me learn as a developer, and identify areas of improvement, while also making my GSoC 2023 experience a positive one.
Overall, I've had a very positive experience participating in the Google Summer of Code program, and am grateful for this learning opportunity that was provided by Google.
hello I am a open source beginner who wants to contribute in GSOC this year how can I get started with this organisation