{"id":34707375,"url":"https://github.com/navis-org/fastcore","last_synced_at":"2026-05-27T05:35:58.849Z","repository":{"id":46659786,"uuid":"410204081","full_name":"navis-org/fastcore","owner":"navis-org","description":"[WIP] Fast core functions for navis re-implemented in Cython.","archived":false,"fork":false,"pushed_at":"2024-09-16T16:44:48.000Z","size":256,"stargazers_count":1,"open_issues_count":4,"forks_count":2,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-12-26T11:31:00.671Z","etag":null,"topics":["connectivity","connectome","similarity","vertex"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/navis-org.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-09-25T07:16:40.000Z","updated_at":"2024-09-16T16:44:51.000Z","dependencies_parsed_at":"2024-09-16T20:17:56.742Z","dependency_job_id":"d6b753fe-e414-4fd2-80a0-5c5abf61f292","html_url":"https://github.com/navis-org/fastcore","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/navis-org/fastcore","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/navis-org%2Ffastcore","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/navis-org%2Ffastcore/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/navis-org%2Ffastcore/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/navis-org%2Ffastcore/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/navis-org","download_url":"https://codeload.github.com/navis-org/fastcore/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/navis-org%2Ffastcore/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33553127,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-27T02:00:06.184Z","response_time":53,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["connectivity","connectome","similarity","vertex"],"created_at":"2025-12-24T23:30:17.864Z","updated_at":"2026-05-27T05:35:58.839Z","avatar_url":"https://github.com/navis-org.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Tests](https://github.com/navis-org/fastcore/actions/workflows/tests.yaml/badge.svg)](https://github.com/navis-org/fastcore/actions/workflows/tests.yaml) [![CI](https://github.com/navis-org/fastcore/actions/workflows/ci.yaml/badge.svg)](https://github.com/navis-org/fastcore/actions/workflows/ci.yaml)\n\n\u003e [!IMPORTANT]  \n\u003e This project has been superseded by [`fastcore-rs`](https://github.com/schlegelp/fastcore-rs) which is based on Rust and is now actively used in `navis`.\n\n# navis-fastcore\nFast core functions for [`navis`](https://github.com/navis-org/navis)\nre-implemented in Cython.\n\nThe idea is that `navis` will use `fastcore` if installed and fall back to\nthe pure-Python / numpy implementation if not.\n\nCurrently implemented:\n- vertex similarity (Jarrell et al., 2012)\n- shortest path from source to target (~40x faster than iGraph)\n- geodesic distance matrix (up to 100x faster than scipy)\n\nSee further down for details.\n\n## Installation\nI'm still figuring out the best way for building and packaging pre-compiled\nbinaries (i.e. wheels). For now, you will need to compile it yourself during\nsetup. This requires a C-compiler to be present (see\n[here](https://cython.readthedocs.io/en/latest/src/quickstart/install.html) for\na very brief explanation).\n\n```bash\n$ pip3 install git+git://github.com/navis-org/fastcore@main\n```\n\n## Examples\n\n```python\n\u003e\u003e\u003e import numpy as np\n\u003e\u003e\u003e import navis\n\u003e\u003e\u003e import fastcore\n\u003e\u003e\u003e # Grab an example skeleton\n\u003e\u003e\u003e n = navis.example_neurons(1)\n\u003e\u003e\u003e # Time navis' scipy-based function for all-by-all geodesic distances\n\u003e\u003e\u003e %time m1 = navis.geodesic_matrix(n, weights=None)\nCPU times: user 4.58 s, sys: 153 ms, total: 4.73 s\nWall time: 4.73 s\n\u003e\u003e\u003e # Time the analogous function in fastcore\n\u003e\u003e\u003e %time m2 = fastcore.geodesic_matrix(n.nodes.node_id.values, n.nodes.parent_id.values)\nCPU times: user 2.17 s, sys: 173 ms, total: 2.35 s\nWall time: 258 ms\n\u003e\u003e\u003e # Make sure results are the same\n\u003e\u003e\u003e np.all(m1 == m2)\nTrue\n```\n\n### Troubleshooting\n\n#### Compiler does not support openmp\n\nWe need `openmp` for threaded processing. Without it, this is not much faster\nthan the pure numpy implementations. If your compiler does not support\n`openmp`, you will get an error along the lines of `-fopenmp  not supported`.\nThis happens e.g. on OSX if you use the clang bundled with XCode. In my case,\nI was able to work around it by installing `llvm` with homebrew and then\nadding a couple flags to my `~/.bash_profile` to make sure the homebrew llvm\nis actually used:\n\n```\nexport PATH=\"/usr/local/opt/llvm/bin:$PATH\"\nexport LDFLAGS=\"-L/usr/local/opt/llvm/lib -Wl,-rpath,/usr/local/opt/llvm/lib\"\nexport CPPFLAGS=\"-I/usr/local/opt/llvm/include\"\n```\n\n### Develop\n\nTo compile the extensions in place:\n\n```bash\n$ python setup.py build_ext --inplace\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnavis-org%2Ffastcore","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnavis-org%2Ffastcore","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnavis-org%2Ffastcore/lists"}