{"id":34027707,"url":"https://github.com/chaobrain/brainevent","last_synced_at":"2026-04-02T01:45:41.995Z","repository":{"id":289108972,"uuid":"921610544","full_name":"chaobrain/brainevent","owner":"chaobrain","description":"Event-driven Computation for Brain Dynamics.","archived":false,"fork":false,"pushed_at":"2026-03-25T08:09:20.000Z","size":4490,"stargazers_count":8,"open_issues_count":1,"forks_count":3,"subscribers_count":3,"default_branch":"main","last_synced_at":"2026-03-26T09:29:43.901Z","etag":null,"topics":["brain-dynamics-modeling","brain-inspired-computing","dynamic-sparsity","event-driven-computation","sparse-matrix"],"latest_commit_sha":null,"homepage":"https://brainevent.readthedocs.io/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/chaobrain.png","metadata":{"files":{"readme":"README.md","changelog":"changelog.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-01-24T09:21:55.000Z","updated_at":"2026-03-19T13:18:39.000Z","dependencies_parsed_at":null,"dependency_job_id":"5c410019-578f-4c20-b10f-ef873bf18f1c","html_url":"https://github.com/chaobrain/brainevent","commit_stats":null,"previous_names":["chaobrain/brainevent"],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/chaobrain/brainevent","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chaobrain%2Fbrainevent","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chaobrain%2Fbrainevent/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chaobrain%2Fbrainevent/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chaobrain%2Fbrainevent/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chaobrain","download_url":"https://codeload.github.com/chaobrain/brainevent/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chaobrain%2Fbrainevent/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31294124,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-02T01:43:37.129Z","status":"ssl_error","status_checked_at":"2026-04-02T01:43:36.474Z","response_time":53,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["brain-dynamics-modeling","brain-inspired-computing","dynamic-sparsity","event-driven-computation","sparse-matrix"],"created_at":"2025-12-13T17:01:24.428Z","updated_at":"2026-04-02T01:45:41.988Z","avatar_url":"https://github.com/chaobrain.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Enabling Event-driven Computation in CPU/GPU/TPU\n\n\u003cp align=\"center\"\u003e\n  \t\u003cimg alt=\"Header image of brainevent.\" src=\"https://raw.githubusercontent.com/chaobrain/brainevent/main/docs/_static/brainevent.png\" width=50%\u003e\n\u003c/p\u003e \n\n\u003cp align=\"center\"\u003e\n\t\u003ca href=\"https://pypi.org/project/brainevent/\"\u003e\u003cimg alt=\"Supported Python Version\" src=\"https://img.shields.io/pypi/pyversions/brainevent\"\u003e\u003c/a\u003e\n\t\u003ca href=\"https://github.com/chaobrain/brainevent/blob/main/LICENSE\"\u003e\u003cimg alt=\"LICENSE\" src=\"https://img.shields.io/badge/License-Apache%202.0-blue.svg\"\u003e\u003c/a\u003e\n  \t\u003ca href='https://brainevent.readthedocs.io/en/latest/?badge=latest'\u003e\n        \u003cimg src='https://readthedocs.org/projects/brainevent/badge/?version=latest' alt='Documentation Status' /\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://badge.fury.io/py/brainevent\"\u003e\u003cimg alt=\"PyPI version\" src=\"https://badge.fury.io/py/brainevent.svg\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://github.com/chaobrain/brainevent/actions/workflows/CI.yml\"\u003e\u003cimg alt=\"Continuous Integration\" src=\"https://github.com/chaobrain/brainevent/actions/workflows/CI.yml/badge.svg\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://github.com/chaobrain/brainevent/actions/workflows/CI-daily.yml\"\u003e\u003cimg alt=\"Daily CI Tests\" src=\"https://github.com/chaobrain/brainevent/actions/workflows/CI-daily.yml/badge.svg\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://pepy.tech/projects/brainevent\"\u003e\u003cimg src=\"https://static.pepy.tech/badge/brainevent\" alt=\"PyPI Downloads\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://doi.org/10.5281/zenodo.15324450\"\u003e\u003cimg src=\"https://zenodo.org/badge/921610544.svg\" alt=\"DOI\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n\nBrain is characterized by the discrete spiking events, which are the fundamental units of computation in the brain.\n\n`BrainEvent` provides a set of data structures and algorithms for such event-driven computation on\n**CPUs**, **GPUs**, **TPUs**, and maybe more, which can be used to model the brain dynamics in an\nefficient and biologically plausible way.\n\nParticularly, it provides the following class to represent binary events in the brain:\n\n- ``BinaryArray``: representing array with a vector/matrix of events.\n\nFurthermore, it implements the following commonly used data structures for event-driven computation\nof the above class:\n\n- ``COO``: a sparse matrix in COO format for sparse and event-driven computation.\n- ``CSR``: a sparse matrix in CSR format for sparse and event-driven computation.\n- ``CSC``: a sparse matrix in CSC format for sparse and event-driven computation.\n- ``JITCHomoR``: a just-in-time connectivity matrix with homogenous weight for sparse and event-driven computation.\n- ``JITCNormalR``: a just-in-time connectivity matrix with normal distribution weight for sparse and event-driven\n  computation.\n- ``JITCUniformR``: a just-in-time connectivity matrix with uniform distribution weight for sparse and event-driven\n  computation.\n- ``FixedPreNumConn``: a fixed number of pre-synaptic connections for sparse and event-driven computation.\n- ``FixedPostNumConn``: a fixed number of post-synaptic connections for sparse and event-driven computation.\n- ...\n\n`BrainEvent` is fully compatible with physical units and unit-aware computations provided\nin [BrainUnit](https://github.com/chaobrain/brainunit).\n\n## Usage\n\nIf you want to take advantage of event-driven computations, you must warp your data with ``brainevent.BinaryArray``:\n\n```python\nimport brainevent\n\n# wrap your array with BinaryArray\nevent_array = brainevent.BinaryArray(your_array)\n```\n\nThen, the matrix multiplication with the following data structures, $\\mathrm{event\\ array} @ \\mathrm{data}$,\nwill take advantage of event-driven computations:\n\n- Sparse data structures provided by ``brainevent``, like:\n    - ``brainevent.CSR``\n    - ``brainevent.JITCHomoR``\n    - ``brainevent.FixedPostNumConn``\n    - ...\n- Dense data structures provided by JAX/NumPy, like:\n    - ``jax.numpy.ndarray``\n    - ``numpy.ndarray``\n\n```python\ndata = jax.random.rand(...)  # normal dense array\ndata = brainevent.CSR(...)  # CSR structure\ndata = brainevent.JITCScalarR(...)  # JIT connectivity\ndata = brainevent.FixedPostNumConn(...)  # fixed number of post-synaptic connections\n\n# event-driven matrix multiplication\nr = event_array @ data\nr = data @ event_array\n```\n\n## Installation\n\nYou can install ``brainevent`` via pip:\n\n```bash\npip install brainevent -U\n```\n\nAlternatively, you can install `BrainX`, which bundles `brainevent` with other compatible packages for a comprehensive brain modeling ecosystem:\n\n```bash\npip install BrainX -U\n```\n\n\n## Documentation\n\nThe official documentation is hosted on Read the Docs: [https://brainevent.readthedocs.io/](https://brainevent.readthedocs.io/)\n\n\n## See also the ecosystem\n\n``brainevent`` is one part of our brain modeling ecosystem: https://brainmodeling.readthedocs.io/\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchaobrain%2Fbrainevent","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchaobrain%2Fbrainevent","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchaobrain%2Fbrainevent/lists"}