Repository navigation
v0.2.0
kamui now works with NumPy 2. Version 0.1.2 fails on import under NumPy 2 (AttributeError: np.float_ was removed in the NumPy 2.0 release), and a fresh pip install kamui pulls in NumPy 2, so everyone should upgrade.
pip install -U kamui # or kamui[extra] for the PUMA solverRequirements changed
kamui now requires Python ≥ 3.10, NumPy ≥ 2 and SciPy ≥ 1.13. Version 0.1.2 declared Python ≥ 3.6 and set no NumPy or SciPy minimum. If your environment has to stay on NumPy 1.x, pip keeps resolving kamui 0.1.2, which still works there.
Tested on Python 3.10 to 3.14 on Linux, macOS and Windows. PyMaxflow, the optional dependency behind PUMA, has no Python 3.14 wheels yet, so on 3.14 pip install kamui[extra] builds it from source and needs a C++ compiler.
Fixes and behavior changes
unwrap_arbitraryandunwrap_dimensionalnow returnNonewhen the ILP solver reports the problem as infeasible, as documented. Previously the default simplex-based path raisedTypeError.- Importing kamui without PyMaxflow no longer prints a warning. Calling
puma(ormethod="gc") without it now raises anImportErrorthat namespip install kamui[extra], instead of aNameError. prepare_weightsrejects an unknownmerging_methodwith a message that lists the allowed values (min, max, mean). Previously the message spelled out the letters of the rejected value.kamui.__version__reports the installed version.- The solvers and helpers (
calculate_k,calculate_m,integrate,puma,get_2d_edges_and_simplices,get_3d_edges_and_simplices,prepare_weights,wrap_difference) are now listed inkamui.__all__, sofrom kamui import *includes them. All public functions have numpydoc docstrings.
Known issue
unwrap_dimensional(x, method="gc") raises TypeError: puma() got an unexpected keyword argument 'weights'. It has been broken since 0.1.2; the fix is in #19 and will ship in 0.2.1. Until then, call PUMA through unwrap_arbitrary:
edges, _ = kamui.get_2d_edges_and_simplices(x.shape)
result = kamui.unwrap_arbitrary(x.ravel(), edges, method="gc").reshape(x.shape)For 3-D data, use get_3d_edges_and_simplices instead.
Packaging
- Built with Hatchling, and the version now comes from the git tag.
- Published from GitHub Actions through PyPI trusted publishing, with provenance attestations for the wheel and the sdist.
What's Changed
- Numpy 2 compatibility by @mahmud1 in #16
- Modernize packaging and CI: Pixi, Ruff, hatch-vcs tag versioning by @hctah in #18
New Contributors
Full Changelog: v0.1.2...v0.2.0