Skip to content

Releases: Techcable/orderedset.py

Fix broken wheel

22 Jun 02:23
dcb1fe8
Compare
Choose a tag to compare

After I published v0.1.7 to PyPI, I realized it was missing necessary source files. The only python file included was _version.py, which is not sufficient to run the library.

This version v0.1.8 has only a single commit fixing the issue (dcb1fe8).

This issue was caused by the transition from setuptools to hatch. Now that the configuration is fixed, it should not happen again.

Document `OrderedSet.remove` has linear complexity

22 Jun 01:48
f8071c3
Compare
Choose a tag to compare

Document that OrderedSet.remove method has linear complexity, unlike set.remove which takes O(1) time. This can potentially cause quadratic blow up if called inside a loop.

To work around this, use OrderedSet.__isub__ to remove items in bulk.

Full Changes

  • Document the fact OrderedSet.remove takes linear time
    • Add test to check for this behavior (currently failing, since it takes linear instead of constant time)
    • Explicitly implement in-place bulk methods __ior__, __iand__ to avoid quadratic blow up
  • Explicitly implement OrderedSet.remove (previously implemented by superclass)
  • Switch build from setuptools to hatchling

Add OrderedSet.of constructor and improve docs

16 Jun 07:33
7fdfb6e
Compare
Choose a tag to compare

Adds the OrderedSet.of factory method. This is a convenient shorthand for OrderedSet([1,2,3]) while avoiding an extra pair of brackets.

Significantly improve docstrings and readme, although the API documentation is still not published. See PR #4 for ongoing work.

Changes

  • OrderedSet.sort now require key and reverse to be keyword arguments. This is consistent with the (new) behavior of list.sort.
  • This is (potentially) breaking, but the old behavior was never intended
  • Change format of OrderedSet.__repr__ to use the new OrderedSet.of factory method.
  • Configure ruff more agressively, adding lints well beyond the defaults.

More efficient pickling

08 Jun 21:55
be76e78
Compare
Choose a tag to compare

This avoids serializing each element twice. Because pickling preserves object identity, the behavior was still correct before, it was just less efficient.

The new version is fully backwards compatible, and can still deserialize data from v0.1.4.
There is a test to make sure this is true.

Implement OrderedSet.dedup

26 May 03:22
v0.1.4
0722933
Compare
Choose a tag to compare

This is an iterator combinator that removes duplicate elements while preserving ordering.
Because it is implemented as a generator, it does not need to wait for the entire input before yielding values.

Add a corresponding OrderedSet.dedup_async method for AsyncIterator

Support pydantic serialization and validation

11 May 08:28
v0.1.3
c244015
Compare
Choose a tag to compare

This resolves issue #1 - The depenency is optional and the library still works fine without it.

Full Changes

  • Support pydantic serialization
    • Optional dependency
  • Change __repr__ to use list literal notation:
    • Now is OrderedSet([1, 2, 3]) instead of OrderedSet((1, 2, 3))
    • The str representation is still {1, 2, 3}
  • Use PEP 639 license metadata

Drop cython build dependency

11 May 08:21
v0.1.2
639ae76
Compare
Choose a tag to compare

Not currently being used.

Use 'techcable' as a namespace, not a package

14 Mar 19:43
v0.1.1
5b5fc2a
Compare
Choose a tag to compare

Avoids conflicts with my other libraries that use 'techcable'.
Namespace packages are described in PEP 420.

Initial Release

10 Mar 23:39
v0.1.0
71574e8
Compare
Choose a tag to compare
v0.1.0

Initial release