Ë
    G8¿c  ã                   ó8   — d Z ddlZddlZddlmZ  G d„ d«      Zy)zUnitDbl module.é    N)Ú_apic            	       óÐ  — e Zd ZdZdddddddd	d
œZddddœZd„ Zd„ Zd„ Zd„ Z	d„ Z
d„ Z ej                  eej                  «      Z ej                  eej"                  «      Z ej                  eej&                  «      Z ej                  eej*                  «      Z ej                  eej.                  «      Z ej                  eej2                  «      Zd„ Z ej                  eej8                  «      Z ej                  eej<                  «      Zd„ Z  ej                  e ejB                  «      Z" ej                  e ejB                  «      Z#d„ Z$d„ Z%d„ Z&e'dd„«       Z(d„ Z)y)ÚUnitDblzClass UnitDbl in development.)gü©ñÒMbP?Úkm)é   r   )g 8€~ß¿ù?r   )r   Úrad)g:R¢Fß‘?r   )r   Úsec)g      N@r	   )i  r	   )Úmr   Úmiler   Údegr	   ÚminÚhourÚdistanceÚangleÚtime)r   r   r	   c                 ó†   — t        j                  | j                  |¬«      }t        ||d   z  «      | _        |d   | _        y)aI  
        Create a new UnitDbl object.

        Units are internally converted to km, rad, and sec.  The only
        valid inputs for units are [m, km, mile, rad, deg, sec, min, hour].

        The field UnitDbl.value will contain the converted value.  Use
        the convert() method to get a specific type of units back.

        = ERROR CONDITIONS
        - If the input units are not in the allowed list, an error is thrown.

        = INPUT VARIABLES
        - value     The numeric value of the UnitDbl.
        - units     The string name of the units the value is in.
        ©Úunitsr   r   N)r   Úcheck_getitemÚallowedÚfloatÚ_valueÚ_units)ÚselfÚvaluer   Údatas       úF/usr/lib/python3/dist-packages/matplotlib/testing/jpl_units/UnitDbl.pyÚ__init__zUnitDbl.__init__#   s9   € ô" ×!Ñ! $§,¡,°eÔ<ˆÜ˜E D¨¡G™OÓ,ˆŒØ˜1‘gˆó    c                 óæ   — | j                   |k(  r| j                  S t        j                  | j                  |¬«      }| j                   |d   k7  rt        d| › d|› d«      ‚| j                  |d   z  S )a†  
        Convert the UnitDbl to a specific set of units.

        = ERROR CONDITIONS
        - If the input units are not in the allowed list, an error is thrown.

        = INPUT VARIABLES
        - units     The string name of the units to convert to.

        = RETURN VALUE
        - Returns the value of the UnitDbl in the requested units as a floating
          point number.
        r   r   z[Error trying to convert to different units.
    Invalid conversion requested.
    UnitDbl: z
    Units:   ú
r   )r   r   r   r   r   Ú
ValueError)r   r   r   s      r   ÚconvertzUnitDbl.convert8   s}   € ð ;‰;˜%ÒØ—;‘;ÐÜ×!Ñ! $§,¡,°eÔ<ˆØ;‰;˜$˜q™'Ò!Üð  -à-1¨Fð 3-Ø-2¨G°2ð7ó 8ð 8ð {‰{˜T !™WÑ$Ð$r   c                 óT   — t        t        | j                  «      | j                  «      S )z*Return the absolute value of this UnitDbl.)r   Úabsr   r   ©r   s    r   Ú__abs__zUnitDbl.__abs__P   s   € ä”s˜4Ÿ;™;Ó'¨¯©Ó5Ð5r   c                 óD   — t        | j                   | j                  «      S )z*Return the negative value of this UnitDbl.©r   r   r   r&   s    r   Ú__neg__zUnitDbl.__neg__T   s   € ä˜Ÿ™| T§[¡[Ó1Ð1r   c                 ó,   — t        | j                  «      S )z$Return the truth value of a UnitDbl.)Úboolr   r&   s    r   Ú__bool__zUnitDbl.__bool__X   s   € äD—K‘KÓ Ð r   c                 ó`   — | j                  |d«        || j                  |j                  «      S )zACheck that *self* and *rhs* share units; compare them using *op*.Úcompare)ÚcheckSameUnitsr   ©r   ÚopÚrhss      r   Ú_cmpzUnitDbl._cmp\   s'   € à×Ñ˜C Ô+Ù$—+‘+˜sŸz™zÓ*Ð*r   c                 óœ   — | j                  ||j                  «       t         || j                  |j                  «      | j                  «      S )zACheck that *self* and *rhs* share units; combine them using *op*.)r0   Ú__name__r   r   r   r1   s      r   Ú_binop_unit_unitzUnitDbl._binop_unit_unith   s6   € à×Ñ˜C §¡Ô-Ü‘r˜$Ÿ+™+ s§z¡zÓ2°D·K±KÓ@Ð@r   c                 óP   — t         || j                  |«      | j                  «      S )z'Combine *self* and *scalar* using *op*.r)   )r   r2   Úscalars      r   Ú_binop_unit_scalarzUnitDbl._binop_unit_scalarp   s   € ä‘r˜$Ÿ+™+ vÓ.°·±Ó<Ð<r   c                 ó8   — d| j                   | j                  fz  S )úPrint the UnitDbl.z%g *%s©r   r   r&   s    r   Ú__str__zUnitDbl.__str__w   s   € à˜4Ÿ;™;¨¯©Ð4Ñ4Ð4r   c                 ó8   — d| j                   | j                  fz  S )r<   zUnitDbl(%g, '%s')r=   r&   s    r   Ú__repr__zUnitDbl.__repr__{   s   € à" d§k¡k°4·;±;Ð%?Ñ?Ð?r   c                 ó4   — | j                   | j                     S )z Return the type of UnitDbl data.)Ú_typesr   r&   s    r   ÚtypezUnitDbl.type   s   € à{‰{˜4Ÿ;™;Ñ'Ð'r   Nc                 óŠ   — |€t        d| j                  «      }g }d}	 | ||z  z   }||k\  r	 |S |j                  |«       |dz  }Œ')a?  
        Generate a range of UnitDbl objects.

        Similar to the Python range() method.  Returns the range [
        start, stop) at the requested step.  Each element will be a
        UnitDbl object.

        = INPUT VARIABLES
        - start     The starting value of the range.
        - stop      The stop value of the range.
        - step      Optional step to use.  If set to None, then a UnitDbl of
                      value 1 w/ the units of the start is used.

        = RETURN VALUE
        - Returns a list containing the requested UnitDbl values.
        r   r   )r   r   Úappend)ÚstartÚstopÚstepÚelemsÚiÚds         r   ÚrangezUnitDbl.rangeƒ   s`   € ð$ ˆ<Ü˜1˜eŸl™lÓ+ˆDàˆàˆØØ˜˜D™Ñ ˆAØDŠyØð
 ˆð L‰L˜ŒOØ‰FˆAð r   c                 ó†   — | j                   |j                   k7  r(t        d|› d| j                   › d|j                   › «      ‚y)aI  
        Check to see if units are the same.

        = ERROR CONDITIONS
        - If the units of the rhs UnitDbl are not the same as our units,
          an error is thrown.

        = INPUT VARIABLES
        - rhs     The UnitDbl to check for the same units
        - func    The name of the function doing the check.
        zCannot z  units of different types.
LHS: z
RHS: N)r   r"   )r   r3   Úfuncs      r   r0   zUnitDbl.checkSameUnits¥   sM   € ð ;‰;˜#Ÿ*™*Ò$Ü˜w t fð -%Ø%)§[¡[ Mð 2%Ø%(§Z¡Z Lð2ó 3ð 3ð %r   )N)*r6   Ú
__module__Ú__qualname__Ú__doc__r   rB   r   r#   r'   r*   r-   r4   Ú	functoolsÚpartialmethodÚoperatorÚeqÚ__eq__ÚneÚ__ne__ÚltÚ__lt__ÚleÚ__le__ÚgtÚ__gt__ÚgeÚ__ge__r7   ÚaddÚ__add__ÚsubÚ__sub__r:   ÚmulÚ__mul__Ú__rmul__r>   r@   rC   ÚstaticmethodrL   r0   © r   r   r   r   	   s…  „ Ù'ð ØØ àØ-àØØñ
€Gð ØØñ
€Fòò*%ò06ò2ò!ò+ð
 %ˆY×$Ñ$ T¨8¯;©;Ó7€FØ$ˆY×$Ñ$ T¨8¯;©;Ó7€FØ$ˆY×$Ñ$ T¨8¯;©;Ó7€FØ$ˆY×$Ñ$ T¨8¯;©;Ó7€FØ$ˆY×$Ñ$ T¨8¯;©;Ó7€FØ$ˆY×$Ñ$ T¨8¯;©;Ó7€FòAð
 &ˆi×%Ñ%Ð&6¸¿¹ÓE€GØ%ˆi×%Ñ%Ð&6¸¿¹ÓE€Gò=ð &ˆi×%Ñ%Ð&8¸(¿,¹,ÓG€GØ&ˆy×&Ñ&Ð'9¸8¿<¹<ÓH€Hò5ò@ò(ð òó ðóB3r   r   )rQ   rR   rT   Ú
matplotlibr   r   ri   r   r   ú<module>rk      s   ðÙ ã Û å ÷k3ò k3r   