Releases: virgesmith/itrx
Releases · virgesmith/itrx
Release list
v0.4.0
Breaking changes
value_countsnow behaves like pandas'value_counts: results are ordered most-common-first (ties by first appearance) instead of sorted by key. Items now only need to be hashable rather than orderable, and counting is O(n) rather than O(n log n).teenow raisesValueErrorwhenn < 1, as its docstring has always stated (previouslytee(0)silently discarded the iterator and returned an empty tuple).repeat(1)now returns a newItrand leaves the original exhausted, consistent with every other value ofn(previously it returnedself, so consuming the result also consumed the original in that case only).
New features
next_if(predicate): consume and return the next item only if it satisfies the predicate, otherwise leave it in place and returnNone(like Rust'sPeekable::next_if).sum()/prod(): terminal aggregations over the remaining items.dedup(): lazily remove consecutive duplicates, keeping the first of each run (like Rust'sdedup); works on infinite iterators.zip_longest(other, fillvalue=...): likezip, but continues to the end of the longer input, padding withfillvalue.sorted_by(key, reverse=...): eager stable sort by a key function.
Bug fixes
- Removed the broken
apidocconsole script from the distribution: the wheel does not package thescriptsmodule, so the installed command always failed withModuleNotFoundError. It is a dev-only tool, now run directly from the source tree.
v0.3.0
Breaking changes
nthis now 0-based, consistent with Rust'sIterator::nthand Python's indexing conventions:nth(0)returns the first item (previously this raisedValueErrorandnth(1)returned the first item). Update callers by dropping the+ 1.interleavenow yields the remaining elements of the longer iterable once the shorter one is exhausted, matching Rust'sinterleave(previously it stopped at the shorter input, silently dropping the tail).
New features
chunk_by: lazily group consecutive elements sharing a key (the semantics ofitertools.groupby/ Rust'schunk_by). Unlikegroupbyit does not sort, so it preserves order and works on infinite iterators.
Documentation
- Clarified that
groupby(andvalue_counts, which builds on it) is eager: it sorts the entire input up front, so it reorders output, requires mutually-orderable keys, and must not be used on infinite sources. Corrected the lazy/eager categorisation in the README. - Corrected the
nthdocstring, which previously claimed it returnedNonewhen out of range (it raisesStopIteration).
v0.2.3
What's Changed
- Fix review issues: typing, return types, and minor correctness fixes
- CI tweaks
Full Changelog: v0.2.2...v0.2.3
v0.2.2
- Documentation updates
- updates to CI , linting
v0.2.1
- New methods:
teeandmap_dict - Examples: how to use
mapwith methods or properties
v0.2.0
- corrects
flat_map(map->flatten not flatten->map) using a direct implementation
v0.1.7
- Adds
consumemethod that exhausts the iterator without producing output. Useful when only side-effects are required.