[PYTHON MATRIX-SIG] New array pretty printer
Konrad HINSEN
hinsenk@ere.umontreal.ca
Wed, 13 Mar 1996 12:23:51 -0500
I have added two new features to the array printer, and I will send
the new version to everyone in a separate message. Since the last
NumericPython distribution did not contain the most recent version
(there were still a few minor bugs), I recommend the current update
to everyone, even those who are not interested in the new features.
The first new feature is support for general object arrays. This is
rather elementary (str() is called on each element, and the resulting
strings are printed in a neat arrangement), but it is very useful and
also sufficient for any general array with reasonable elements. Of
course in extreme cases (e.g. when str() for one element returns a
multi-line string) the array output will be a complete mess.
The second new feature is an additional optional parameter
suppress_small that defaults to "false". If set to true (1), then
elements with a very small absolute value in float arrays will not
cause a switch to exponential format (they will be printed as
zeros). This results in a much neater output if these elements are in
fact "numerical zeros", but of course some information is lost.
I'd also like to propose to change the name of the module
"PrettyPrinter" to "ArrayPrinter". After someone sent me
another module called "PrettyPrinter" (which prints
lists etc. in a nice way), I had some problems for a while
until I found out what went wrong. To avoid such problems it
makes sense to choose a very specific name for this module,
and "ArrayPrinter" is certainly much more specific than
"PrettyPrinter".
-------------------------------------------------------------------------------
Konrad Hinsen | E-Mail: hinsenk@ere.umontreal.ca
Departement de chimie | Tel.: +1-514-343-6111 ext. 3953
Universite de Montreal | Fax: +1-514-343-7586
C.P. 6128, succ. Centre-Ville | Deutsch/Esperanto/English/Nederlands/
Montreal (QC) H3C 3J7 | Francais (phase experimentale)
-------------------------------------------------------------------------------
=================
MATRIX-SIG - SIG on Matrix Math for Python
send messages to: matrix-sig@python.org
administrivia to: matrix-sig-request@python.org
=================