v0.4.0
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 onCatmullRomclass for better debugging output.__slots__onCatmullRomclass for reduced memory usage and prevention of dynamic
attribute creation.- Length validation in
linestrings_tangent_anglesto raise an error when
gaussian_sigmaslength does not match the number of input lines. gridproperty in_catsmoothing.pyitype stubs.
Fixed
- Fixed second derivative formula in spline evaluation (was constant
6.0instead of
correct6.0 * t). - In
smooth_linestrings, if the input was a mix ofLineStringandLinearRingthe
output was either aLineStringor aLinearRingdepending on the type of the
first input. Now, the output correctly is a mix ofLineStringandLinearRing
depending on the type of each element in the input. - Fixed
_catsmoothing.pyitype stubs to match the actual Rust API signatures. - Removed outdated
scipyrequirement mention fromsmooth_polygondocstring.
Changed
evaluate()anduniform_distances()now returnResultinstead of panicking on
invalid input, propagating errors to Python asValueError.- Replaced
lazy_staticwithstd::sync::LazyLockandnum_cpuswith
std::thread::available_parallelism(), removing two crate dependencies. - Enforce valid polygon generation in
smooth_polygonusingshapely.make_valid
function. Vec2Dnow derivesCopyfor reduced heap allocations.- Improved spline evaluation by using
partition_pointfor binary search and ordered
tangent construction instead ofinsert(0, ...). - Pass
bc_typesas a plainlist[str]to Rust instead of converting through anumpy
string array. - Pass
gaussian_sigmasas a plainlistinlinestrings_tangent_anglesinstead of
converting through anumpyarray. - Bumped Rust dependencies:
ndarray0.16 to 0.17,pyo30.24 to 0.28,numpy(crate)
to 0.28,randto 0.10,rand_distrto 0.6.