An Efficient Scalar Class in Python

uymqlp502 at sneakemail.com uymqlp502 at sneakemail.com
Thu Mar 23 07:06:11 CET 2006


My previous announcement on this was only nine days ago, but in
retrospect I think that release was premature. I have made substantial
simplifications and improvements since then. Here is the abstract from
the three-page user guide (which is in PDF):

A Python class was designed to represent physical scalars and to
eliminate errors involving implied physical units (e.g., confusing
angular degrees and radians). The standard arithmetic operators are
overloaded to provide syntax identical to that for built-in numerical
types. The scalar class allows the user to easily define a set of
appropriate physical units for any particular application or domain.
Once an application has been developed and tested, the units can easily
be switched off, if desired, to achieve the execution efficiency of
operations on built-in numerical types (which can be two orders of
magnitude faster). The scalar class can also be used for discrete units
to enforce type checking of integer counts, thereby enhancing the
built-in dynamic type checking of Python.

Give it a try. If you do scientific or engineering computation, I bet
you'll like it!

http://RussP.org/scalar.htm



More information about the Python-announce-list mailing list