Release 1.0.1 is a stable release of NumPy.
Version Number explanation:
- 1.0.X will be maintainence releases (modules will not need
- recompilation)
- 1.X will be major stable releases which might contain
- changes to the C-API and therefore might require re-compilation of extension modules
- 1.0.1.dev3432 indicates SVN version 3432 of the development release
- leading up to 1.0.1
- 1.1.dev3532 indicates SVN version 3532 of the development release
- leading up to 1.1
- 1.0b2.dev2952 indicates SVN version 2952 of the development release
- leading up to the second beta release of version 1.0
Important changes are denoted with a NOTE: (ie. changes denoted with a NOTE: might break code from a previous release version 0.9.8 and above)
Changes from 1.0.3 ==> 1.0.3.1
NOTE: NumPy 1.0.3.1 fixes a bug that prevented building numpy.distutils based packages (e.g. scipy), please use this release to build other packages.
- Add back get_path to numpy.distutils.misc_utils
- Fix 64-bit zgeqrf
- Add parenthesis around GETPTR macros
Changes from 1.0.2 ==> 1.0.3
BUG NOTE: NumPy 1.0.3 contains a bug that prevents building numpy.distutils based packages (e.g. scipy), use NumPy from SVN to build other packages.
- iinfo (to parallel ffinfo) added for determining max and min values of integer data-types.
- .pprint method added to record objects for printing all fields
NOTE: restore invariant (x == (x/y)*y + (x%y)) by making integer division with mixed-sign operands match Python. This could cause problems if you were relying on the old "C-like" behavior for integer division.
NOTE: the data attribute of array returns a buffer that is 'as large as it needs to be'. This means that on repr of the buffer the size is reported as -1.
- extensive SWIG typemap improvements contained in the doc directory of the source distribution
- improvements to numpy.distutils including compiler support
- improvements to f2py
- improvements to separator handling in fromfile and fromstring
- many bug fixes
Changes from 1.0.1 ==> 1.0.2
NOTE: 0-d arrays with a record data-type now return a 0-d array (instead of an array scalar) when a field is selected.
- boolean mask is now allowed for indexing 0-d arrays. Previously an error occurred.
- the array scalars can be sub-classed.
- matrix multiply now raises an error when shapes are not compatible.
- memmap arrays now have a close method
- random.dirichlet added for generating random numbers with the dirichlet distribution
- byte_bounds and may_share_memory functions added to allow simple checking to see if two arrays use over-lapping memory.
- interp function from Numeric's arrayfns module added for simple piece-wise linear interpolation.
- oldnumeric.arrayfns compatibility module added to hold all of those functions. Most (but not all) have been implemented.
- clipping with scalar max and min has been sped up significantly
- the indices function is about 5-10x faster
- random number generators are faster for scalar parameters
- reduce problem with non-commutative binary operators is fixed
- mixed-kind scalar and array operations work correctly now
- several segfaults cleared up
- string representation only truncates trailing NULLs but does not stop on interior NULLs
- swig macros improved
- many other bugs squashed
Changes from 1.0 ==> 1.0.1
- Make ones work for compound types
- Allow argsort and sort functions to take None as argument
- Allow argsort method to take None as axis argument
- Add order keyword to sort and argsort
- Allow array_descriptor format to also use alignment.
- Force objects with _fields_ attribute to use alignment
- Support for recognize ctypes types as data-types.
- Speed up Assign_Array dramatically using numarray-adapted code
- Add a flags attribute to the dtype
Make the hasobject member of the PyArray_Descr structure a bit-flag so that behaviors of data-types can be controlled.
- New features in f2py continued development.
- Record arrays can now set field values using attribute access.
- Allow user-defined data-types to use getitem and setitem instead of array scalar. Now, a data-type does not need a corresponding array scalar.
- Remove usage of 'as' variable.
Fix setting arrays when mixing slice objects and index arrays for >2-d
- Fix call of mmap with array scalars
- Fixes in polysub and polyadd.
- Fixes to name-space issues in compatibility layers
- Fix startswith method on character arrays
- Fix problem when fft called with invalid number of data-points
- Fix reference count with ufuncs causing vectorize to behave poorly
- Reference count fixes (for dtype objects and in f2py).
- Fix problem if dgesdd does not compute optimal work size correctly
- Fix OBJECT_argmax problem.
- Added more tests and docstrings
Changes from 1.0rc3 ==> 1.0
- Allow arrays with fields to be sorted by improving VOID_compare. Now, lexicographic ordering is used based on field-order. First field is compared followed by second field, if equal, and so forth until inequality is found.
- Add .A1 property to matrices to automatically produce 1-d array from matrix.
- check added so that built-in data-types are never deallocated. Instead a reference count warning is printed to stderr.
- Support for floating-point error flags on AIX improved.
- Improved check for when copies are necessary in reshape (thanks A.M. Archibald).
- Bug-fixes and test fixes.
Changes from 1.0rc2 ==> 1.0rc3
Added tensorsolve and tensorinv to allow solving linear equations that involve sums over more than one index: i.e. solve a_{ijkl} x_{kl} = b_{ij} for the 2-d array x. It handles the row-mapping to a 2-d array commonly done manually.
- Fixed many bugs
- Improved handling of record data-types
NOTE: Changed so that array(a, dtype=) enforces the dtype request instead of raising an error. This is the behavior of numarray but Numeric raised an error if the conversion was not safe. Previous versions of numpy allowed the conversion only if a copy was going to be made (this was a bug as it was difficult to predict).
- Added ability to give keyword arguments to ufuncs. This required a bump in the C-API version number and re-compilation of extension modules (very sorry, but it also allows us to catch-up with some C-APIs added).
- Added sig= and extobj= keyword arguments to allow specification of 1) the actual 1-d loop to use instead of guessing from the types of the input arrays and 2) the [bufsize, errormask, errorobj] list to use instead of looking it up in the thread-specific dictionary. Using this keyword, could save time in a loop with ufuncs on small arrays by not repeating the lookup multiple times.
- Change the way C-flags print to C_CONTIGUOUS and F_CONTIGUOUS instead of CONTIGUOUS and FORTRAN. The old names are still valid, but the new ones can also be used. Thus, the flags object also has a f_contiguous and c_contiguous attribute.
- Added 'print', and 'log' to ufunc and array scalar error handling options. The 'print' option prints a warning message to stderr (for a long-running ufunc it only does this once). The 'log' option writes a warning message to the log specified in the third argument of the errorobj (seterrcall for an easy interface to specifying it). The log object must have a write method.
- Changed the default error mode to divide='print', invalid='print', over='print', under='ignore'
Changes from 1.0rc1 ==> 1.0rc2
NOTE: Remove putmask as a method of the ndarray. It is still a function as always.
NOTE: Swap the order of the .put method arguments so that it matches the order of arguments in the function. This only affects you if you used the .put method.
NOTE: The default axis of the .take method was finally changed to None (which it was assumed to have all along).
NOTE: The repmat function was moved to matlib.py. The function tile was added which works in arbitrary dimensions and takes a tuple for the repeat information. tile(a,[M,N]) is equivalent to repmat(a,M,N)
Changes from 1.0b5 ==> 1.0rc1
- Improve ufuncs for user-defined types so that multiple 1-d loops can be registered for a particular user-defined type
- Fix many bugs
allow .item(i) or .item(i,j,k,...) to extract a standard Python scalar from an array with .item() working only on 0-d arrays and arrays with 1 element. This should allow code that uses a lot of scalar math and does not care about NumPy error handling to work more quickly. self.item(*args) is equivalent to self[args].item() but faster.
- add .itemset(*args, item) method that is equivalent to self[args] = item or self.flat[args] but is optimized for setting a single scalar object into an array location.
add PyArray_DescrAlignConverter and PyArray_DescrAlignConverter2 to the C-API (does not require rebuilding of extensions that don't use the API) to allow conversion of objects to data-types with alignment the same as an aligned C-struct on the platform.
NOTE: changed r_[] so that any string directives must be at the front. Added ability to use string directives to change 1) the axis along which concatenation occurs, 2) the minimum number of dimensions to push entries to, and 3) how 1's should be added to the shape to create an array with the minimum number of dimensions. Changed c_[...] to be equivalent to r_['-1,2,0',...]. This should only affect users of c_ who were using c_ as a substitute for r_ in the 1-d case.
Fixed column_stack so it doesn't transpose inputs > 1-d.
- Added histogramdd and fixed histogram2d.
- Added rollaxis function (generalizes the _move_axis_to_0 function).
For dtype objects with no fields or subarrays that are in correct byte order, the __str__ method returns the same thing as the name method and the __repr__ method returns "dtype(str(obj)". This should be more understandable for new-comers. This has a remote possibility of breaking code that relied on the exact form of the __str__ method. Use the .str attribute of the dtype object instead.
- numpy.info(arr) where arr is an ndarray now prints interesting output
NOTE: .astype() and .transpose() now do not convert to array scalars if given a 0-d array. These methods always return ndarrays. Remember, the equivalent of PyArray_Return can be achieved in Python using [()]
- .mean(), .std(), and .var() reduce over a c-double type if self is of integer or bool type and no other reducing data-type is given.
Removed dft stub and UserArray.py stubs.
Changes 1.0b4 ==> 1.0b5:
Revert object array creation to previous behavior {array([],dtype=object) has shape (0,)} except that any errors encountered will trigger an attempt to use the new rules for object-array creation so that array(1,2],[1,2,3,dtype=object) will work.
Add a module/script (numpy.oldnumeric.fix_default_axis) to fix code that was converted to NumPy before the default axis change of several functions in 1.0b2. This script works in one of 2 ways:
- a) add the old default axis argument to select functions that are missing it --- works on function name and can get confused by similarly named functions from other modules b) change the imports to use numpy.oldnumeric whenever the functions whose default axis changed appears in the script after being imported by numpy
- Add tensordot function for general purpose summation over indices and sets of indicies for N-dimensional array inputs.
NOTE: insert => place, deletefrom => delete, insertinto ==> insert, appendonto ==> append (Normally changing function names this late in the game is not going to happen. These functions, were recently added, however (except for insert which was added in an early NumPy release). numpy.oldnumeric.insert added as another name for numpy.place. The extra prepositions on the end of the function names was a bad dream from which an early wakeup was required and because insert has little widespread use (except in SciPy), changing it's name to place was not seen as too onerous. So, don't let this fact deter you from downloading and trying the 1.0b4 release.
Changes 1.0b3 ==> 1.0b4:
- Fixed behavior of advanced-indexing setitem so that the values object must be broadcastable to the array it is being placed into. This makes it consistent with other notions of setitem.
NOTE: (nansum, nanmin, nanmax, manargmax, nanargmin) changed so that default axis argument is None for consistency with non-nan versions of the functions.
- Add functions deletefrom, insertinto, and appendonto which delete, insert, and append n-1 dimensional sub-portions of an array. The default axis is None for these functions.
- Fixed coercion rules for array functions like choose and concatenate on mixed data-types so that all arrays are upcast to the first data-type that all can be safely cast to.
Added very simple (i.e. not thread-safe and doesn't work on some platforms) macros for allowing interrupts during calculations. Surround the code that can be interrupted with NPY_SIGINT_ON and NPY_SIGINT_OFF. This will not work with multiple threads. You can poll the interrupt with PyOS_InterruptOccurred() to get interrupt support in applications that don't support siglongjmp or where you don't want to risk such rude interruption.
- Fixes to compilation for windows
Changes 1.0b2 ==> 1.0b3:
Fixed linspace to return the value of stop at the -1 entry (if >1 points) when endpoint is True.
Changed the (little-used) shape attribute of data-type objects to return an empty tuple when no sub-array is defined.
Removed use of Py_FatalError in module initialization and replaced it with setting the ImportError. NOTE: this changes the semantics of import_array() a bit so that it must be used only in a module initialization function. If you want the old behavior (where errrors are ignored) you need to include "numpy/oldnumeric.h". There are also import_array1(ret) and import_array2(msg, ret) which let you alter what is returned on error and what the message reported on error is.
Added PyUFunc_ReplaceLoopBySignature function at the end of the ufunc C-API (this means that recompilation is not necessary). This adds the ability to swap out a low-level function pointer at the C-level with one of your own construction.
- In the C-API, you can now get the "no-prefix option" (i.e. intp instead of npy_intp) by defining NPY_NO_PREFIX prior to including "numpy/arrayobject.h". (Including numpy/noprefix.h still works as well).
- Default names for un-defined fields are always 'f0', 'f1', 'f2' (there was a difference depending on whether or not you initialized from a comma separated string).
- Scalar types now are named according to the standard approach where the module name is the precursor to the object name. They are named so that when "evaluated" the string corresponds to the actual type object (the "scalar" suffix was eliminated).
- The "title" object of the field tuple can now hold any object (i.e. meta-data for the field). If it is a string or unicode object then it will still be inserted in the fields dictionary as a key.
NOTE: When creating data-type objects from lists, the list must be in array descriptor format. The "list of data-type objects" approach is no longer supported due to its ambiguity with the very common array descriptor approach. You can still get this behavior using a comma-separated string or changing your list to an array_descriptor: [('', x) for x in oldlist]
- Added compare_chararrays function which allows control over whether or not white-space stripping is done during comparision operations on string and unicode arrays This is now used for comparisons in the chararray class.
- Fixed chararray clas so that it won't strip all the way to an empty string on item retrieval.
- Fix ndpointer to accept flags object and add tests.
- Fixed error on .reduce method of ufuncs when an output variable was provided.
ndpointer and ctypes_load_library moved to separate numpy.ctypeslib module and ctype_load_library --> load_library
- updated to work with Python 2.5b3
Changes 1.0b1 ==> 1.0b2:
NOTE: The default axis argument to all functions that match methods now matches the method call. Several functions were changed from axis=0 to axis=None to coincide with the method call. Functions altered in this way are: take, repeat, sum, product, sometrue, cumsum, cumproduct, ptp, amax, amin, prod, cumprod, mean, std, var, alltrue. Because of its similarity to the mean function, the average function call was also changed to default of axis=None. Versions of the functions that have the old axis values as the default are in numpy.oldnumeric.
- the convertcode script was renamed to alter_code1 and an additional alter_code2 script was started. The first conversion uses the compatibility layer, the second conversion attempts to remove dependence on the compatibilty layer. This scheme for backwards-compatibilty is the same for both Numeric and Numarray.
- numpy.oldnumeric will only import the names that used to be in Numeric when using the 'import *' syntax.
numpy.oldnumeric only contains the names from Numeric in its __all__ variable. Therefore, only those names will be imported when from numpy.oldnumeric import * is used. However, all the additional names from numpy will be available still when the package is imported without the 'import *' syntax (e.g. import numpy.oldnumeric as N)
The old Numeric routine names and behavior for functions in the add-on packages UserArray, Matrix, MLab, LinearAlgebra, FFT, RandomArray, RNG and RNG.Statistics have been moved to numpy.oldnumeric.<pkg> where <pkg> is user_array, matrix, mlab, linear_algebra, fft, random_array, rng, and rng_stats respectively
NOTE: The dft sub-package as been renamed to fft and a backwards compatible dft name created. The dft stub will be removed by 1.0 final release.
NOTE: The lib.UserArray module is renamed lib.user_array and its UserArray class is renamed container. There is a compatibility stub warning about the name deprecation. This compatibility file will be removed by 1.0 final release.
NOTE: The nonzero function is now the same as the nonzero method. In particular this returns a tuple and works for N-d arrays. There is a new function named flatnonzero that works the same as before. Also numpy.oldnumeric contains the nonzero function the way it used to work.
- flatnonzero function added to returns an array of nonzero elements in the raveled version of the object. This can replace old usage of the nonzero function
- source, info, and who moved from scipy to numpy
- array_equiv, and array_equal added
- qr decomposition added to numpy.linalg
- take, put, and choose now take mode arguments to determine what should be done with out-of-bounds indices ('raise', 'wrap', or 'clip')
- take, argmax, argmin, max, min, ptp, choose, mean, std, var, sum, cumsum, prod, cumprod, any, all, compress, conj (conjugate), trace, clip, and round methods (and equivalent functions) now take an optional output argument.
- the ufunc methods reduce, accumulate, and reduceat also take an optional output argument
equivalent C-API for the functions mentioned in the previous 2 bullets were changed to take extra input arguments except old PyArray_Take and PyArray_Put are Numeric functions and retain their old behavior. PyArray_TakeFrom and PyArray_PutTo have the new arguments and behavior.
PyArray_OutputConverter and PyArray_ClipmodeConverter added to the C-API along with the enumerated NPY_CLIPMODE type with elements NPY_RAISE, NPY_WRAP, and NPY_CLIP
- numpy.numarray compatibility layer added along with converter code numpy.numarray.alter_code1 and a stub for numpy.numarray.alter_code2
the numarray modules numarray.convolve, numarray.image, and numarray.nd_image are available as numpy.numarray.<name> as long as you have SciPy intalled (or at least the ndimage and stsci sub-packages)
- chararrays now strip whitespace from the end on retrieval of individual strings as numarray did.
- the _as_parameter_ method has been moved to .ctypes._as_parameter_ which now works even when ctypes is not installed. The class factory ndpointer was created to produce array-checking classes with the from_param method. These can be used as entries in the argtypes methods of ctypes functions.
Changes 0.9.8 ==> 1.0b1:
NOTE: several changes involve deprecated names being moved. Backward compatibility with Numeric is now maintained by using numpy.oldnumeric which is a bit different than the previous method of including everything in the numpy name-space. So, if you have transitioned to numpy using numpy.oldnumeric you may need to change a few things for 1.0
NOTE: The default array data-type is now float64 (c double precision) instead of c integer for all functions where it is not clear from context what the data-type should be. The zeros, ones, and empty functions are the most obvious cases which now return floating-point arrays if no data-type is specified. Notice that the numpy.oldnumeric name-space still contains functions with the old default values so old code just needs to use that module and things should work the same.
NOTE: The old capitalized type-names (Float64, etc.) are now only in numpy.oldnumeric. Only lower-case names are in numpy itself.
NOTE: rand, randn, fft, and ifft moved from top-level name-space (they can be found in the random and fft sub-packages).
- add names member (which contains a list of ordered field names) to the dtype object to get rid of hackish usage of -1 in the fields dictionary
- .squeeze() on arrays no longer returns array scalars when a 0-d array is encountered
- .var() and .std() now divide by N instead of N-1
- .ctypes and ._as_parameter_ attribute added for use with ctypes
- Add the .T attribute to the array (== .transpose())
- The numpy.matlib package contains array creation routines (like ones, zeros, and so forth that return matrices by default).
refft --> rfft with old names deprecated
- allow object-dtype as data-type of a field in a compound data-type (i.e. a record)
- mtrand random-number generators updated to take arrays for shape arguments. Broadcasting is used to create the result.
- functions added
- diagflat -- 2-d array (or sub-class) from flattened array
- histogram2d
- row_stack -- alias to vstack to complement column_stack
- issubdtype -- are the scalars associated with data-types sub-types
- require -- make sure an array as certain flags and data-type
- ctypes_load_library -- make it easy to load a shared library
- meshgrid -- like mgrid but takes sequences as inputs
- argwhere
flatiter object (returned by a.flat) now have rich comparisons so that a.flat > b.flat works
- Compatibility with Numeric character arrays improved
- f2py can read f77 compiler flags from the source. Other improvements to the f2py Fortran parser.
- Work around Python bug in complex_number new for subtypes of complex
- Deprecation Warnings added to old functions
- Version number added to pickles of ndarray and dtype in backward-compatible manner
Python-side array interface updated to version 3 where one dictionary-returning attribute (__array_interface__) is used. NOTE: Version 2 of the interface is no longer supported on the Python side (it is on the C-side).
- copying and casting arrays now uses broadcasting instead of flat copying(except when copying back from an array with the PY_UPDATEIFCOPY set).
- void-type scalars can be sequences if they have fields defined
- linalg will now return single-precision arrays if given single precision but all calculations are still done with double precision
- support for == and != comparisons of void-type arrays added
- optimize simple indexing on N-d arrays
- added the dtype= keyword to record array constructors
GIL-releasing calls added for Python > 2.4.2 (NUMPY_NOSMP environment variable can be used to disable threads)
fromfile and tofile now call the file object to open files instead of using PyFile_FromString
- improve unique function
- numpy.pxi in mtrand improved
- dependency on _internal.py removed from pickles
- Added better docstrings and moved many docstrings to the add_newdocs module which does not add docs when python -OO is run.
- More tests added
- Memory leaks and bugs fixed
C-API changes:
NOTE: All C-API constants now have the NPY_, npy_, or PyArray_ prefix to avoid name conflicts with other libraries.
- NPY_ -- used for capitalized constants (e.g. NPY_LONG)
- npy_ -- used for new types (e.g. npy_intp)
PyArray_ -- used for C-API functions (or function-like macros).
The types PyArray_LONG, PyArray_DOUBLE are still defined
Include numpy/noprefix.h instead of numpy/arrayobject.h to get the old names for code written to numpy.__version__ < 1.0
- There is a numarray C-API compatibility module that can be used by including numpy/libnumarray.h and being sure the directories returned by numpy.get_numarray_include(True) are included in the list of includes for compilation (use the single directory returned by numpy.get_numarray_include() if you are using numpy.distutils because the numpy directory is included by default).
- Obsolete Numeric C-API moved to numpy/oldnumeric.h. Thus, for fullest compatibility with Numeric use #include numpy/oldnumeric.h instead of #include Numeric/arrayobject.h
PyArray_ToString added to C-API
- Broken tMIN and tMAX macros removed
PyArray_DECREF_ERR added to improve recovery on error condition for arrays with the UPDATEIFCOPY flag set
- registering new data-types (in C) is made easier
- registered data-types can also register casting functions and information about which types it can be safely cast to
Added PyArray_RegisterCastFunc
f->copyswapn updated to take strides
- builtin data-types can also have casting functions registered
user-defined data-types can participate in casting infrastructure by using PyArray_RegisterCanCast
C-version of fromiter (PyArray_FromIter) added
- import_array and import_ufunc are now MACROS (as in Numeric)
PyArray_MoveInto and PyArray_CopyInto variants added. PyArray_CopyObject added to the C-API. PyArray_CopyAnyInto and PyArray_CastAnyInto also added.
- Added INTP_FMT in more places
- Changed usages of longlong to Py_ssize_t and added NPY_SSIZE_T_PYFMT to be the correct letter based on Python version number