File: NumpyPortingNotes.txt

package info (click to toggle)
python-cogent 1.4.1-1.2
  • links: PTS, VCS
  • area: non-free
  • in suites: squeeze
  • size: 13,260 kB
  • ctags: 20,087
  • sloc: python: 116,163; ansic: 732; makefile: 74; sh: 9
file content (6 lines) | stat: -rw-r--r-- 504 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
These notes are issues that were encountered in switching Cogent from Numeric to Numpy.

- When numpy returns a 1d array but Numeric returns a nd array, this is frequently due to a different default in axis. Resolved typically by setting axis=0.
- numpy.nonzero returns a tuple, Numeric.nonzero doesn't
- sum returns a numpy.scalar, not a standard float or int and the scalar has a length so code that relied on a try/except clause for len can fail.
- different error types can be set using numpy.seterr