Commit Graph

988 Commits

Author SHA1 Message Date
Brant Watson 0f9581cd85 Implment __len__ magic method 2016-10-24 07:19:32 -05:00
Brant Watson 5c45f57961 Use getvalue() when rolling files 2016-10-24 07:16:29 -05:00
Brant Watson fd12387d85 Improve accuracy of coverage report
- Removed 'pass' from several abstract properties
  functions, and staticmethods
2016-10-24 07:06:38 -05:00
Brant Watson c7fa81ccf5 Add more example documentation 2016-10-24 07:06:12 -05:00
Brant Watson 701a71b8d5 Replace __buffer with _buffer 2016-10-24 07:01:07 -05:00
Brant Watson 9b964c361c Added example documentation 2016-10-21 17:56:19 -05:00
Brant Watson a2065ef3ba Fix len to work with pypy 2016-10-21 17:42:33 -05:00
Brant Watson 4d95ea1031 Update tests to be python2.6 compatible 2016-10-21 17:03:30 -05:00
Brant Watson 359fdd0e5a Remove unused logger 2016-10-21 16:37:40 -05:00
Brant Watson 774ce34bd7 Remove six dependenct in ioutils 2016-10-21 16:35:22 -05:00
Brant Watson 580142da3b Add ioutils module
Spooled Temporary Files are file-like objects
that start out mapped to in-memory objects, but
automatically roll over to a temporary file once
they reach a certain (configurable) threshhold.
Unfortunately the built-in SpooledTemporaryFile
class in Python does not implement the exact API
that some common classes like StringIO do.
SpooledTemporaryFile also spools all of it's in-memory
files as cStringIO instances. cStringIO instances cannot
be deep-copied, and they don't work with the zip
library either. This along with the incompatible api makes
it useless for several use-cases.

To combat this but still gain the memory savings and
usefulness of a true spooled file-like-object, two custom
classes have been implemented which have a compatible API.

SpooledBytesIO is a spooled file-like-object that only
accepts bytes. On Python 2.x this means the 'str' type; on
Python 3.x this means the 'bytes' type. Bytes are written
in and retrieved exactly as given, but it will raise TypeErrors
if something other than bytes are written.

SpooledStringIO is a spooled file-like-object that only accepts
unicode values. On Python 2.x this means the 'unicode' type and
on Python 3.x this means the 'str' type. Values are accepted as
unicode and then coerced into utf-8 encoded bytes for storage. On
retrieval, the values are returned as unicode.
2016-10-21 16:13:44 -05:00
Mahmoud Hashemi 11ebca45a6 Merge branch 'master' of github.com:mahmoud/boltons 2016-10-12 01:15:44 -07:00
Mahmoud Hashemi aba6fe24f0 docs for funcutils.wraps inject_to_varkw 2016-10-11 09:25:04 -07:00
Mahmoud Hashemi a2de02a947 funcutils.wraps: enable injection spillover into varkw (**kw) (used by lithoxyl for logger wrappers) 2016-10-10 18:33:04 -07:00
Mahmoud Hashemi 9d117706a3 Merge pull request #96 from coady/master
Simplified and optimized iterutils.first.
2016-09-27 08:53:44 -07:00
Aric Coady 3c973de488 Simplified and optimized iterutils.first. 2016-09-26 17:44:42 -07:00
Mahmoud Hashemi 81088a531f error check bounds on clamp 2016-08-04 23:40:24 -07:00
Mahmoud Hashemi 224acc8980 link to numpy.clip 2016-08-04 23:35:35 -07:00
Mahmoud Hashemi bc542e3ddb add mathutils.clamp 2016-08-04 23:30:40 -07:00
Mahmoud Hashemi a9e6024333 more docstring updates 2016-08-04 23:22:32 -07:00
Mahmoud Hashemi e99017e6b0 add statsutils.Stats.clear_cache docstring 2016-08-04 23:12:40 -07:00
Mahmoud Hashemi 4140386d1f improving and testing exceptions around classmethod and staticmethod for funcutils.wraps and FunctionBuilder, fixes #86 to the degree possible. wrapping classmethods simply does not make sense for the wraps API. 2016-08-03 02:11:02 -07:00
Mahmoud Hashemi 4f506cff3c add a bit of coverage utility stuff in case others would like to run it (though the py2/py3 stuff would make getting to 100 a big ole headache. need to look at tox + coverage combining for that at some point) 2016-07-31 19:03:15 -07:00
Mahmoud Hashemi f74b7e5a7d fix for default remap set support, fixes #84 2016-07-31 19:01:42 -07:00
Mahmoud Hashemi 51d2f7177d bump docs version 2016-07-19 00:44:34 -07:00
Mahmoud Hashemi faa5c9b877 add 16.5.0 changelog changes 2016-07-19 00:41:49 -07:00
Mahmoud Hashemi 0265af68a2 bumping version for 16.5.1 dev 2016-07-19 00:30:57 -07:00
Mahmoud Hashemi 5b91fe1281 bumping version for 16.5.0 release 2016-07-19 00:27:16 -07:00
Mahmoud Hashemi b1cd936409 cacheutils: (breaking change) adding the scoped argument to @cached and @cachedmethod (and removing selfish from cachedmethod). also fixed a bug in a cachedmethod test, as well as added docs for scoped and key arguments. all of this to fix #83. 2016-07-19 00:16:55 -07:00
Mahmoud Hashemi 573387ad5e make @cached suite's key function configurable (defaults to make_cache_key per usual) 2016-07-18 22:36:14 -07:00
Mahmoud Hashemi 3bd3cbd34c adding total_ordering backport for python 2.6 2016-07-18 22:11:47 -07:00
Mahmoud Hashemi 816feedf88 tableutils: enable html value customization 2016-07-17 15:19:59 -07:00
Mahmoud Hashemi e2cc7e551d couple of badges for the docs 2016-06-24 02:14:58 -07:00
Mahmoud Hashemi 074ddea676 add some badges, per @kdeldycke in #82, including the brand new, all-important CalVer badge 2016-06-24 01:12:12 -07:00
Mahmoud Hashemi a1f132039d add a wraps TODO 2016-06-14 04:30:49 -07:00
Mahmoud Hashemi 5ada677d80 make the FunctionBuilder filename that appears in tracebacks configurable 2016-06-14 04:29:31 -07:00
Mahmoud Hashemi 4adca279eb bumping version for 16.4.2dev 2016-06-12 15:14:45 -07:00
Mahmoud Hashemi dcb4608b43 adding 16.4.1 to the CHANGELOG 2016-06-12 15:13:32 -07:00
Mahmoud Hashemi 2438fcc8d4 bumping for 16.4.1 release 2016-06-12 15:07:05 -07:00
Mahmoud Hashemi 4f8490ac19 Stats.__init__ now has is_sorted argument (I think this was the original plan) 2016-06-11 20:01:42 -07:00
Mahmoud Hashemi f74044499c bin deduplication (readily happens with bin_digits=-1) 2016-06-11 19:58:15 -07:00
Mahmoud Hashemi f070cf38eb add mad to describe 2016-06-11 19:31:03 -07:00
Mahmoud Hashemi bde94f3fdb add mad alias for median_abs_dev, as well as iqr stats property 2016-06-11 19:25:10 -07:00
Mahmoud Hashemi 06bc1df00e docstrings and examples for statsutils histogram-related stuff 2016-06-11 18:44:43 -07:00
Mahmoud Hashemi 34ac99b6b8 adding statsutils histogram tests 2016-06-11 18:05:50 -07:00
Mahmoud Hashemi 3bd4c85ede py26 backporting for statsutils format_histogram 2016-06-11 18:05:38 -07:00
Mahmoud Hashemi 8cf9899f02 extract histogram logic into a global function (format_histogram_counts) in case someone has their own bin counts 2016-06-11 17:55:20 -07:00
Mahmoud Hashemi fc523245f6 split format_histogram into format_histogram and get_histogram_counts 2016-06-11 16:48:52 -07:00
Mahmoud Hashemi 4e34957662 remove edge_bin_size/trim from histogram logic 2016-06-11 16:22:13 -07:00
Mahmoud Hashemi 2adfa2778d adding initial version of statsutils.format_histogram. also fix error condition/message for trim_relative. 2016-06-11 16:09:57 -07:00