diff options
author | Seth M Morton <seth.m.morton@gmail.com> | 2014-07-14 22:20:46 -0700 |
---|---|---|
committer | Seth M Morton <seth.m.morton@gmail.com> | 2014-07-16 22:16:07 -0700 |
commit | 0de0222fa23a6f2b2a553967d287dfc42e44d78a (patch) | |
tree | 1c38c5ea909ecb5e9584d67478c351e17290668d | |
parent | 26a5f6c89bbd6b01f5addbcfc4550a514cee0c6d (diff) | |
download | natsort-0de0222fa23a6f2b2a553967d287dfc42e44d78a.tar.gz |
Documented changes in README.
This includes changes that have not yet been made, but will be for the official
release.
Also uncommented all calls in profile code.
-rw-r--r-- | README.rst | 28 | ||||
-rw-r--r-- | test_natsort/profile_natsorted.py | 11 |
2 files changed, 34 insertions, 5 deletions
@@ -412,6 +412,34 @@ Seth M. Morton History ------- +XX-XX-2014 v. 3.4.0 +''''''''''''''''''' + + - Fixed a bug that caused user's options to the 'natsort_key' to not be + passed on to recursive calls of 'natsort_key'. + - Added a 'natsort_keygen' function that will generate a wrapped version + of 'natsort_key' that is easier to call. 'natsort_key' is now set to + depreciate at natsort version 4.0.0. + - Added an 'as_path' option to 'natsorted' and co. that will try to treat + input strings as filepaths. This will help yield correct results for + OS-generated inputs like + ``['/p/q/o.x', '/p/q (1)/o.x', '/p/q (10)/o.x', '/p/q/o (1).x']``. + - Massive performance enhancements for string input (1.8x-2.0x), at the expense + of reduction in speed for numeric input (~2.0x). + + - This is a good compromise because the most common input will be strings, + not numbers. If you are sorting only numbers, you would use 'sorted'. + - Sorting numbers still only takes 0.6x the time of sorting strings. + + - Added the 'order_by_index' function to help in using the output of + 'index_natsorted' and 'index_versorted'. + - Added the 'reverse' option to 'natsorted' and co. to make it's API more + similar to the builtin 'sorted'. + - Added more unit tests. + - Added auxillary test code that helps in profiling and stress-testing. + - Reworked the documentation, moving most of it to PyPI's hosting platform. + - Added support for coveralls.io. + 06-28-2014 v. 3.3.0 ''''''''''''''''''' diff --git a/test_natsort/profile_natsorted.py b/test_natsort/profile_natsorted.py index 7978c23..dc52bf8 100644 --- a/test_natsort/profile_natsorted.py +++ b/test_natsort/profile_natsorted.py @@ -3,6 +3,7 @@ import cProfile import random import sys +sys.path.insert(0, '.') from natsort import natsorted, index_natsorted @@ -13,7 +14,7 @@ astr = ['a'+x+'num' for x in map(str,random.sample(xrange(10000), 1000))] tstr = [['a'+x, 'a-'+x] for x in map(str,random.sample(xrange(10000), 1000))] cstr = ['a'+x+'-'+x for x in map(str,random.sample(xrange(10000), 1000))] -''' + def prof_nums(a): print('*** Basic Call, Numbers ***') for _ in xrange(1000): @@ -26,7 +27,7 @@ def prof_num_str(a): for _ in xrange(1000): natsorted(a) cProfile.run('prof_num_str(nstr)', sort='time') -''' + def prof_str(a): print('*** Basic Call, Strings ***') @@ -34,7 +35,7 @@ def prof_str(a): natsorted(a) cProfile.run('prof_str(astr)', sort='time') -''' + def prof_str_index(a): print('*** Basic Index Call ***') for _ in xrange(1000): @@ -82,14 +83,14 @@ def prof_str_asint_unsigned(a): for _ in xrange(1000): natsorted(a, number_type=int, signed=False) cProfile.run('prof_str_asint_unsigned(astr)', sort='time') -''' + def prof_str_key(a): print('*** Basic Call With Key ***') for _ in xrange(1000): natsorted(a, key=lambda x: x.upper()) cProfile.run('prof_str_key(astr)', sort='time') -sys.exit() + def prof_str_index_key(a): print('*** Basic Index Call With Key ***') |