;ò
ÎÑAHc           @   s    d  Z  d k l Z d e i d Z e i Z d k l Z d k	 Z	 d f  d „  ƒ  YZ
 d e f d	 „  ƒ  YZ e
 d
 ƒ Z e
 d ƒ Z e
 d ƒ Z e
 d ƒ Z d S(   sj  Modify the PhysicalQuantities class for more convenient interactive use.

Also redefine some math functions to operate on PhysQties with no need for
special method syntax. This just means moving them out to the global
namespace.

This module should always be loaded *after* math or Numeric, so it can
overwrite math functions with the versions that handle units.(   s   Releases   %s <%s>s   Fernando(   s   PhysicalQuantityNs   PhysicalQuantityFunctionc           B   s    t  Z d  Z d „  Z d „  Z RS(   s`  Generic function wrapper for PhysicalQuantity instances.

    Calls functions from either the math library or the instance's methods as
    required.  Allows using sin(theta) or sqrt(v**2) syntax irrespective of
    whether theta is a pure number or a PhysicalQuantity.

    This is *slow*. It's meant for convenient interactive use, not for
    speed.c         C   s   | |  _  d  S(   N(   s   names   self(   s   selfs   name(    (    sX   /u/d/b/dbachman/=/lib/python2.3/site-packages/IPython/Extensions/PhysicalQInteractive.pys   __init__+   s    c         C   s@   t  | t ƒ o t i |  i | ƒ Sn t i |  i | ƒ Sd  S(   N(   s
   isinstances   xs   PhysicalQuantitys   __dict__s   selfs   names   math(   s   selfs   x(    (    sX   /u/d/b/dbachman/=/lib/python2.3/site-packages/IPython/Extensions/PhysicalQInteractive.pys   __call__.   s    (   s   __name__s
   __module__s   __doc__s   __init__s   __call__(    (    (    sX   /u/d/b/dbachman/=/lib/python2.3/site-packages/IPython/Extensions/PhysicalQInteractive.pys   PhysicalQuantityFunction!   s    	s   PhysicalQuantityInteractivec           B   s2   t  Z d  Z e i Z e i Z d „  Z d „  Z	 RS(   sÕ  Physical quantity with units - modified for Interactive use.

    Basically, the __str__ and __repr__ methods have been swapped for more
    convenient interactive use. Powers are shown as ^ instead of ** and only 4
    significant figures are shown.

    Also adds the following aliases for commonly used methods:
      b = PhysicalQuantity.inBaseUnits
      u = PhysicalQuantity.inUnitsOf
      
    These are useful when doing a lot of interactive calculations.
    c         C   s   t  i |  ƒ Sd  S(   N(   s   PhysicalQuantitys   __repr__s   self(   s   self(    (    sX   /u/d/b/dbachman/=/lib/python2.3/site-packages/IPython/Extensions/PhysicalQInteractive.pys   __str__L   s    c         C   s8   d |  i } |  i i ƒ  i d d ƒ } | d | Sd  S(   Ns   %.4Gs   **s   ^s    (   s   selfs   values   units   names   replaces   units(   s   selfs   unitss   value(    (    sX   /u/d/b/dbachman/=/lib/python2.3/site-packages/IPython/Extensions/PhysicalQInteractive.pys   __repr__O   s    (
   s   __name__s
   __module__s   __doc__s   PhysicalQuantitys   inBaseUnitss   bs	   inUnitsOfs   us   __str__s   __repr__(    (    (    sX   /u/d/b/dbachman/=/lib/python2.3/site-packages/IPython/Extensions/PhysicalQInteractive.pys   PhysicalQuantityInteractive4   s
    			s   sins   coss   tans   sqrt(   s   __doc__s   IPythons   Releases   authorss
   __author__s   licenses   __license__s%   Scientific.Physics.PhysicalQuantitiess   PhysicalQuantitys   maths   PhysicalQuantityFunctions   PhysicalQuantityInteractives   sins   coss   tans   sqrt(   s   coss   __license__s   PhysicalQuantitys   sqrts
   __author__s   PhysicalQuantityFunctions   PhysicalQuantityInteractives   Releases   tans   sins   math(    (    sX   /u/d/b/dbachman/=/lib/python2.3/site-packages/IPython/Extensions/PhysicalQInteractive.pys   ?	   s   			!