Skip to content

v0.4.0

Choose a tag to compare

@github-actions github-actions released this 22 Feb 05:39
· 1 commit to main since this release

Release Notes

This release adds Python 3.14 support and brings significant improvements to both the
Rust core and the Python API. Key highlights include a corrected second derivative
formula, proper handling of mixed LineString/LinearRing inputs, and better error
handling by returning Result instead of panicking. On the Rust side, two crate
dependencies (lazy_static and num_cpus) have been removed in favor of standard
library alternatives, and all major dependencies have been bumped. The Python API gains
__repr__ and __slots__ on CatmullRom, along with cleaner data passing to Rust by
using plain lists instead of numpy array intermediaries.

Added

  • Python 3.14 support.
  • __repr__ method on CatmullRom class for better debugging output.
  • __slots__ on CatmullRom class for reduced memory usage and prevention of dynamic
    attribute creation.
  • Length validation in linestrings_tangent_angles to raise an error when
    gaussian_sigmas length does not match the number of input lines.
  • grid property in _catsmoothing.pyi type stubs.

Fixed

  • Fixed second derivative formula in spline evaluation (was constant 6.0 instead of
    correct 6.0 * t).
  • In smooth_linestrings, if the input was a mix of LineString and LinearRing the
    output was either a LineString or a LinearRing depending on the type of the
    first input. Now, the output correctly is a mix of LineString and LinearRing
    depending on the type of each element in the input.
  • Fixed _catsmoothing.pyi type stubs to match the actual Rust API signatures.
  • Removed outdated scipy requirement mention from smooth_polygon docstring.

Changed

  • evaluate() and uniform_distances() now return Result instead of panicking on
    invalid input, propagating errors to Python as ValueError.
  • Replaced lazy_static with std::sync::LazyLock and num_cpus with
    std::thread::available_parallelism(), removing two crate dependencies.
  • Enforce valid polygon generation in smooth_polygon using shapely.make_valid
    function.
  • Vec2D now derives Copy for reduced heap allocations.
  • Improved spline evaluation by using partition_point for binary search and ordered
    tangent construction instead of insert(0, ...).
  • Pass bc_types as a plain list[str] to Rust instead of converting through a numpy
    string array.
  • Pass gaussian_sigmas as a plain list in linestrings_tangent_angles instead of
    converting through a numpy array.
  • Bumped Rust dependencies: ndarray 0.16 to 0.17, pyo3 0.24 to 0.28, numpy (crate)
    to 0.28, rand to 0.10, rand_distr to 0.6.