Commit Graph

1318 Commits

Author SHA1 Message Date
Mahmoud Hashemi 71307e7db6 bump version onto 19.0.1dev 2019-02-10 23:20:53 -08:00
Mahmoud Hashemi 42d06507bd write initial version of 19.0.0 changelog 2019-02-10 23:20:27 -08:00
Mahmoud Hashemi 01e754f012 bump docs version to 19.0.0 2019-02-10 23:03:57 -08:00
Mahmoud Hashemi 2d9385880d bump for v19.0.0 release 2019-02-10 23:02:53 -08:00
Mahmoud Hashemi 2b3789948a
Merge pull request #152 from zeroSteiner/ipv6-with-ports
Correctly handle RFC2732 IPv6 address literals with ports
2019-02-10 22:56:31 -08:00
Mahmoud Hashemi 48b2411ecb add funcutils.wraps(expected=['a', 'b']), fixes #167 2019-02-10 22:42:59 -08:00
Mahmoud Hashemi 24da3d4623 wip version of expected, need to figure out a non-ordereddict way of doing argument ingestion 2019-02-10 22:16:27 -08:00
Mahmoud Hashemi 47c9c43826 hit one more uncovered branch in add_arg 2019-02-10 21:44:36 -08:00
Mahmoud Hashemi c6270994d9 initial FunctionBuilder.add_arg() 2019-02-10 17:21:53 -08:00
Mahmoud Hashemi 31a5b5d6df add an important docstring to FrozenDict 2019-02-10 11:22:19 -08:00
Mahmoud Hashemi 0975d9c67b more __all__ for dictutils 2019-02-10 11:12:30 -08:00
Mahmoud Hashemi 16bb8be5e0 fix a bit of windows funcutils flakiness 2019-02-10 11:10:58 -08:00
Mahmoud Hashemi 8541a5b37e
Merge pull request #195 from mahmoud/async-wraps
funcutils.wraps: Async coroutine support
2019-02-10 11:00:00 -08:00
Mahmoud Hashemi fd46fcb129
Merge pull request #202 from mahmoud/frozendict
FrozenDict
2019-02-10 10:59:09 -08:00
Mahmoud Hashemi 63275ddf2a fix frozendict api test 2019-02-10 10:47:20 -08:00
Mahmoud Hashemi 652dae9b80 add frozendict docstring 2019-02-10 10:46:16 -08:00
Mahmoud Hashemi 6b5b7f8476 frozendict: use slots and cache hash exceptions 2019-02-10 10:32:36 -08:00
Mahmoud Hashemi 9e525f85bf add some subdict tests, add ducktype construction to subdict 2019-02-09 22:50:56 -08:00
Mahmoud Hashemi 5145f14c53 first pass at dictutils.FrozenDict 2019-02-09 22:28:22 -08:00
Mahmoud Hashemi e182d788aa
Merge pull request #199 from kurtbrose/many-to-many
dictutils: Add ManyToMany to go along with OneToOne
2019-02-09 19:44:25 -08:00
Mahmoud Hashemi 8b4b5fdd87 bit of ManyToMany reorganization and test coverage with fixes (py26-compat repr). also got a bit more specific about update's dependence on keys(), even if it's not exactly dict.update's behavior 2019-02-09 18:21:18 -08:00
Mahmoud Hashemi d9e7f8fef1 clean up ManyToMany (add len, switch from tuple to frozenset, sync a bit with relativity), delete ManyToManySeq (just use relativity at that point) 2019-02-09 17:33:51 -08:00
Mahmoud Hashemi cf696809c5 cacheutils: remove unused deque import and fix debug method impl 2019-02-09 17:02:04 -08:00
Mahmoud Hashemi b2196bc0cd
Merge pull request #198 from kurtbrose/bits
adding Bits to mathutils
2019-02-09 01:34:06 -08:00
Mahmoud Hashemi b9a3042eca got Bits passing tox locally, had to make the hex be byte-resolution, not octet. need to document the destructive operation there. 2019-02-09 00:09:14 -08:00
Mahmoud Hashemi 3bd9dc7f4f
Merge pull request #200 from CameronCairns/master
Fix issues with LRI Cache #155
2019-02-07 20:02:35 -08:00
Cameron Cairns 6fbbc46da1 Updates cache size test for pypy 2019-02-07 19:23:49 -08:00
Cameron Cairns 83e3472610 Changes LRI be base class with LRU extending it
This is to improve the performance of the more performance sensitive LRI
cache
2019-02-07 19:15:51 -08:00
Cameron Cairns 425e43fb61 Replaces LRI with an inheriting version
The LRI implementation this replaces had a bug where upon multiple
inserts of the same key, cache eviction could result in a key error when
we try to delete a key that had already been evicted from the cache.
Furthermore, the original implementation had an issue where the size of
the cache was unbounded since eviction only looked at the number of keys
in the dictionary, not at the size of the underlying queue keeping track
of key insertion order. While the size of data structure may not be a
problem on all systems, the unbounded size of the cache could lead to
poor performance in cases where you have many stale keys you need to
evict before finding a key present in the current dictionary. The
problem encountered is similar to python's priority queue reference
implementation where it is expensive to rebalance the queue, so
instead you keep track of and noop on stale values that have since had
an insertion into the queue (
https://docs.python.org/3/library/heapq.html#priority-queue-implementation-notes)

This new version benefits from the work done on LRU (so now we get
things like thread safety) but implements the same algorithm as the old
version of LRI. This does come at a cost, testing locally (Intel Core
i5-8350U CPU @ 1.70GHz × 8) I found that the cache takes about 10^-7
seconds longer to access on average (sample of 1 million accesses of a
cache of size 100).  In addition, inserts are now 3 times as expensive
as the old version of this code. Given the bugs in the old code, this
solution, with it's slowdown, was deemed acceptable.  I'm not sure a
faster solution can be implemented without sacrificing some correctness,
so I am personally satisfied with this.

!NOTICE!
The new version of LRI is backward incompatible in the following ways:
- `__repr__` returns information about the cache in addition to the
values it stores. Before it returned the `__repr__` of `dict`
- The new version is thread safe
2019-02-05 08:15:00 -08:00
Cameron Cairns 19c7f5dfe3 Adds testing around LRI eviction 2019-02-05 07:56:36 -08:00
Cameron Cairns 5e27f333b6 Inheriting proof of concept 2019-02-02 15:44:38 -08:00
Cameron Cairns 05563d7adf Adds failing tests to exercise issues with LRI 2019-02-02 15:34:29 -08:00
Kurt Rose e6d484ac63 early work on many-to-many 2019-01-29 23:27:43 -08:00
Kurt Rose fa5452c383 adding Bits to mathutils 2019-01-29 23:22:38 -08:00
Mahmoud Hashemi 2c300e71c4
Merge pull request #196 from crazymerlyn/fix_warnings
Fix warnings in python3.7
2019-01-29 10:10:31 -08:00
Ankit Goel ed2f5dcad1 Fix warnings in python3.7 2019-01-28 13:11:53 +05:30
Mahmoud Hashemi 46435b66dd
Merge pull request #187 from kurtbrose/complement-set
complement set
2019-01-27 19:09:38 -08:00
Mahmoud Hashemi 79c501075a Merge branch 'complement-set' of github.com:kurtbrose/boltons into complement-set 2019-01-27 19:04:39 -08:00
Mahmoud Hashemi a04aa846b2 finish up complement api/docs 2019-01-27 18:28:43 -08:00
Mahmoud Hashemi f362ea97b2 switch to monotonic time 2019-01-24 22:58:08 -08:00
Kurt Rose 26a50729f4 fixing for 2.6 doctest 2019-01-18 13:13:17 -08:00
Kurt Rose ebe143ca22 added unit tests swizzled around doctests a little 2019-01-18 11:59:54 -08:00
Mahmoud Hashemi b70fa958ac remember to await on async functions, also is_coroutine -> is_async 2019-01-18 09:40:53 -08:00
Mahmoud Hashemi 8bba6ad829 work on setutils.complement() docstring a bit 2019-01-17 18:24:54 -08:00
Mahmoud Hashemi a5593c4091 correct version-specific test selection logic 2019-01-17 15:10:34 -08:00
Mahmoud Hashemi a844c1d476 add initial changes and tests for keeping coroutine functions async in functionbuilder, probably fixes #194 2019-01-17 15:05:11 -08:00
Mahmoud Hashemi c5360a0237 add ability to select specific python minor versions in test file names 2019-01-17 15:03:56 -08:00
Mahmoud Hashemi 4e5613d3d2 Merge branch 'master' of github.com:mahmoud/boltons into complement-set 2019-01-16 23:37:26 -08:00
Mahmoud Hashemi 172f8f6064 fix a couple typos 2019-01-16 23:37:16 -08:00
Kurt Rose dc948a4071 fixing doctest 2019-01-15 07:18:30 -08:00