From aa6cca24149566eff9847f3cebd57b503274363d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nguy=E1=BB=85n=20Gia=20Phong?= Date: Sat, 14 Feb 2026 23:18:19 +0900 Subject: [PATCH] gnu: Add python-accumulation-tree. * gnu/packages/python-xyz.scm (python-accumulation-tree): New variable. Change-Id: I0e6d41342e49850587fa31f43ac535d98648691c Signed-off-by: Liliana Marie Prikler --- gnu/packages/python-xyz.scm | 44 +++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm index 55ff8fbccc..6321840077 100644 --- a/gnu/packages/python-xyz.scm +++ b/gnu/packages/python-xyz.scm @@ -330,6 +330,50 @@ #:use-module (srfi srfi-1) #:use-module (srfi srfi-26)) +(define-public python-accumulation-tree + ;; Only minor releases (0.x) are tagged, not patch versions. + (let ((commit "3617051f952ce12385c015be8e3d052d1883f17a") + (revision "0")) + (package + (name "python-accumulation-tree") + (version (git-version "0.6.4" revision commit)) + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/tkluck/accumulation_tree") + (commit commit))) + (file-name (git-file-name name version)) + (sha256 + (base32 "0bgqy07rpiyz60y8nfh8mha38l650x25l4bbbv6fx42czw7kzhbx")) + (modules '((guix build utils))) + (snippet ;use src layout for isolated tests + #~(let* ((src "src/") + (old "accumulation_tree/") + (new (string-append src old))) + (mkdir src) + (rename-file old new) + (substitute* "setup.py" + (("packages=" all) + (string-append "package_dir={'': '" src "'}, " all)) + ((old) + new)))))) + (build-system pyproject-build-system) + (arguments + (list #:test-backend #~'custom + #:test-flags #~'("-m" "doctest" "README.md" "tests.md"))) + (native-inputs (list python-cloudpickle python-cython python-setuptools)) + (home-page "https://github.com/tkluck/accumulation_tree") + (synopsis "Red-black tree with fast value accumulation in a key range") + (description + "This Python package implements a red-black tree which also stores +partial aggregations at each node, making getting aggregations +of key range slices an O(log(N)) operation. + +This data structure is very similar to a binary indexed tree, +with heap allocation instead of a flat array to represent a tree.") + (license license:expat)))) + (define-public python-anaconda-cli-base (package (name "python-anaconda-cli-base")