ANN: np_utils 0.4

David N. Mashburn david.n.mashburn at gmail.com
Mon Nov 2 12:22:22 EST 2015


Announcing np_utils version 0.4

Github: https://github.com/davidmashburn/np_utils
Bitbucket: https://bitbucket.org/davidmashburn/np_utils
PyPI: https://pypi.python.org/pypi/np_utils

np_utils is a growing collection of succinct but powerful utility functions
focused around extending numpy in important ways, but also includes a 
number
of useful list, functional, and general purpose utilities.

Small set of highlights (there are many, many more):
* *NEW in 0.4* A succinct but fast and flexible groupby implementation
   (np_groupby)
* A wrapper around np_groupby specifically tailored to common operations on
   record arrays (rec_groupby)
* A function to partition an array into n-sized chunks (partitionNumpy)
* A function to easily build a centered grid with a certain number of 
steps in
   each dimension (build_grid)
* A simple n-dimensional interpolation system for arrays that lines up with
   standard indexing when integers are passed (interpNumpy)
* A one-liner to make a new nd-array and paste in values from an existing
   nd-array with an offset (shapeShift)
* A function to add a border to an array (addBorder)
* A function to scale an nd-array by integer multiples, like an image 
up-scale
   (shape_multiply)
* A utility to enable numpy-like fancy indexing to regular lists, including
   jagged nested lists (fancyIndexingList, fL for short)
* A "flatten" function for nested lists (flatten)
* A "deletecases" function for lists
* A groupby for regular lists (groupByFunction)
* Tools for analyzing connections and connection chains in lists
   (getElementConnections, getChainsFromConnections)
* An interpolation function for lists (interp)
* Functions for deep operations on nested lists (listAdd, listMul, etc)
* A generic slice generator supporting every option imaginable: 0- and 1-
   based indexing, optional end point inclusion, strict/liberal bounds 
checking
* Functional utilities like compose, identity, docAppend, conversion 
between
   splat and non-splat (convertToSingleArgFun & convertToMultiArgFun), 
and even
   an implementation of Jsoftware's "fork"
* "Drawing" functions for ND-arrays:
   - Hyper-rectangles (NDRectangle)
   - ND Bresenham lines -lines to ND-arrays (BresenhamFunction)
   - Circles and Spheres (ImageCircle, ImageSphere)
   - A novel ND-Bresenham *triangular-plane*-drawing algorithm
     (BresenhamTriangle) supporting one of my other projects, SWS4D
* Many others!

Documentation is handled at the docstring level and is thorough with 
included
examples, but there is little in the way of over-arching docs. The only
dependency is numpy itself, and functions are meant to be relatively
independent so that other projects can cherry-pick them as needed.
The API is always subject to change, but has remained fairly stable --
mostly due to my own heavy dependence on the module

A unit test suite is in progress, thoroughly covering a small but important
set of the functions (notably groupby, build_grid, partitionNumpy).

A number of functions have been inspired or taken verbatim from excellent
examples on StackOverflow -- in these cases, links are provided.

Suggestions are welcome and encouraged! (algorithms, style, code 
organization,
documentation, projects that could benefit from some/ all of these 
functions,
inclusions, mergers, etc)

This project supports work that I did at Vanderbilt University and am doing
at Pluralsight, LLC.

Cheers!
-David Mashburn

<P><A HREF="https://github.com/davidmashburn/np_utils">np_utils 0.4</A> 
- a growing collection of succinct but powerful utility functions 
focused around extending numpy in important ways, but also includes a 
number of useful list, functional, and general purpose utilities. 
(02-Nov-15)


More information about the Python-announce-list mailing list