Skip to content

v0.2.0

Choose a tag to compare

@yoyolicoris yoyolicoris released this 01 Oct 15:19
· 10 commits to dev since this release
bbc6bab

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 solver

Requirements 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_arbitrary and unwrap_dimensional now return None when the ILP solver reports the problem as infeasible, as documented. Previously the default simplex-based path raised TypeError.
  • Importing kamui without PyMaxflow no longer prints a warning. Calling puma (or method="gc") without it now raises an ImportError that names pip install kamui[extra], instead of a NameError.
  • prepare_weights rejects an unknown merging_method with 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 in kamui.__all__, so from 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