Skip to content

Draft PR: Functional Tree Operations#77

Draft
audy wants to merge 4 commits intomasterfrom
audy/aggregation-api
Draft

Draft PR: Functional Tree Operations#77
audy wants to merge 4 commits intomasterfrom
audy/aggregation-api

Conversation

@audy
Copy link
Contributor

@audy audy commented Mar 18, 2026

For #76

Note: this does not add functionality to the Rust library, only the Python module.

Also, tax.data["a"] returns a copy of the data as a python dict. So node.data["a"] = 5 doesn't actually update anything. This is a footgun IMO and we should either get rid of __getitem__ or return a writeable reference.

audy and others added 4 commits March 13, 2026 15:18
…n API

- set_data(node_id, key, value): write arbitrary data onto a node in-place
- TaxonomyNode.get(key, default=None): safe read with fallback
- TaxonomyNode.data: property returning all node data as a Python dict
- reduce_up(node_id, output_key, fn): post-order catamorphism; fn(node, child_results) -> result
- map_down(node_id, output_key, initial, fn): pre-order propagation; fn(parent_result, node) -> result
- Fix bug in GeneralTaxonomy::remove() where data vec was not removed alongside other arrays

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…t/data docs

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The old constraint caused uv build to pull maturin 0.14.x as the build
backend, which predates PyO3 0.18 and produced wheels missing all Python
bindings.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant