GSoC 2020 Report: Upgrade and Fix tvb-gdist C++ Library

August 26, 2020

Thank You Note

It was a pleasure working under my mentors Lia and Paula. Thank you for the constant guidance and valuable feedback whenever I was stuck. I express my heartfelt gratitude to Lia, Paula, the whole The Virual Brain and INCF team and, Google for making the last four months such a rewarding experience!

About

While running simulation on cortical surfaces we need to calculate geodesic distance as opposed to euclidean distance due to the shape of the cortical surface. The virtual brain uses geodesic_library for this calculation. The library implements the original paper in C++. The original source code can be found in Google Code Archive: https://code.google.com/archive/p/geodesic. tvb_geodesic repository implements a cython wrapper on top of the C++ code which then is released to Pypi (tvb-gdist) and conda-forge (Tvb Gdist).

However, the code is now outdated and users have reported various issues. In this project, we aim to update the code and fix those issues.

In this project, we fixed the 5 existing issues. Along with that, we fixed issues reported by users during the GSoC period (excessive memory usage, issue #51), added new API (issue #52), added a documentation (issue #43) so that users do not need to go through the code and made the code more maintainable by adding tests, implementing coverage reporting (issue #57) and following lint conventions (issue #60). A detailed descriptions of work done is mentioned below.

Usage

The package exposes 3 APIs which can be used for various purposes: compute_gdist, local_gdist_matrix and distance_matrix_of_selected_points. Examples and detailed instructions can be found in the project readme page.

Project Status

  • Completed Work

    • Fixing an issue where numpy requirement is causing installation problems using pyproject.toml
    • Lint fixes, the codebase is now PEP8 compliant
    • Adding coverge report functionality
    • Updating the travis CI configuration
    • Fixing memory leak issue for compute_gdist
    • Adding a new API for pairwise distance computation
    • Adding documentation in the README file
    • Running different versions of Python on Windows
    • Enabing users to specify if a the faces vertices’ are 1-indexed
    • Adding googletest to test and measure coverage of the c++ library
    • Adding parallelism using OpenMP
  • Incomplete Work

    • Using ctypes instead of cython

Links

  • Link to the project in GitHub
  • Link to the project in PyPI
  • Link to the list of commits
  • Link to the pull requests
  • Link to the weekly reports
  • Link to Jira story

List of Commits

Commit SHADateCommit Message
2d3505f Aug 26Add parallelism using OpenMP
69aef68 Aug 24Merge multiple codecov reports
553ea7d Aug 24Checking why pyx is no longer reported
0d585f2 Aug 24On top of master
c452208 Aug 24Ignore tests/*
3d8f501 Aug 24Add googletest set-up
0f400ad Aug 10Add reasons for ignores
d8b792b Aug 7 Add flake8 rules comment
3f5893c Aug 5 Enable linting for cython file
fc8aed9 Aug 5 Enable linting for cython file
206df7c Aug 4 lint: Use same convention everywhere
0ed985e Aug 4 Fix Python 3.6
e965f57 Aug 4 .travis.yml: Test on multiple versions of python
9960f57 Jul 31Add 100% test coverage
2a0d166 Jul 31Add 100% test coverage
cc71328 Aug 1 Simplify setup.py
7c2839f Jul 31.travis.yml: Only install pytest-cov in linux
f777c27 Jul 31setup.py: Improve
24af912 Jul 31Add coverage report functionality
649123a Jul 29Remove 2 files
314e014 Jul 25gdist.pyx: New API distance_matrix_of_selected_points
e809fc0 Jul 24gdist.pyx: Offload compute_gdist to c++
7ca0c9d Jul 20Improve documentation
ff850c6 Jul 17Add ability to specify if faces' vertices are 1-indexed
b4049d3 Jul 2 macOS fix
4e22195 Jul 2 macOS fix
1453e1f Jul 2 Include numpy
326f64a Jul 2 Add macOS job
92f13b0 Jul 2 Test equality with stable
1835d6e Jun 8 pyproject.toml: Set up minimun build system
c0d52c2 Jun 8 pyproject.toml: Set up minimun build system
7db0ce1 Jun 8 pyproject.toml: Set up minimun build system
557bbe9 Jun 8 Use same epsilon everywhere
f893905 Jun 7 Add local_gdist_matrix tests
3fbcbd1 Jun 1 Use language_level=3
8ddb6d8 Jun 1 Fix local variable referenced before assignment
6a68fc3 Jun 1 .travis.yml: Include build_ext
e0ffe26 Jun 1 Move similar code to a function
38a6291 May 20Use same convention everywhere
862dc80 May 19Add another test
4f77f16 May 19Remove coverage for now
486e0a5 May 19Remove coverage for now
01f710a May 19Add a gdist test
ee47a56 May 18Drop python 2 from CI configuration
78ca2e3 May 18Install C++ MSVS 2017
dcf6c81 May 18Use c++14 setup.py
56c7a8d May 17Use unique_ptr instead of auto_ptr
cdb2afb May 11Fix travis badge link
f626539 May 11Fix the lint stage
b61943f May 11Test on windows as well
da94954 Mar 14Fix flake8 reported errors
ec15b2f Mar 13Downsize .gitignore
062a446 Mar 13Restore License text

Profile picture

Written by Ayan Banerjee who is a Software Developer. You should follow them on Twitter

© 2018 - 2022, Built with Gatsby