numpy/numpy — pull request #274 by mwiebe (2012-05-08 21:33:25+00:00)
Title: Dtype c_metadata for datetime64

This is something I would have liked to have done when I did the datetime64 changes, but with delays in the 1.7 release maybe it can get in now and so reduce future datetime64 ABI changes.

The main purposes of this patch are:
- Slightly increase performance when manipulating the datetime64 dtype
- Simplify datetime64 code by using C-style constructs instead of dynamic Python objects
- Provide a mechanism for future C dtype extensions to have C-style metadata

I've tested this on linux and windows, and against scipy 0.9.0 on linux.

With regards to ABI changes, this doesn't change any datetime64 ABI which wasn't already changed. The name of the key within the Python metadata dict was already different from 1.6. Moving this metadata out of that dict actually makes the Python metadata dict more consistent, since the datetime64 metadata had a number of special cases around accessors to the metadata.

This change also changes the datetime64 pickle output format to match the one used by numpy 1.6, so 1.6 can unpickle such objects from 1.7 where it makes sense.