§
    ‡Ûg  ã                   ó@   — d Z ddlZddlZddlmZ  G d„ d¦  «        ZdS )zUnitDbl module.é    N)Ú_apic            	       óL  — 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j        ¦  «        Zd„ Z ej        eej        ¦  «        Z ej        eej        ¦  «        Zd„ Z  ej        e ej!        ¦  «        Z" ej        e ej!        ¦  «        Z#d„ Z$d„ Z%d„ Z&e'dd„¦   «         Z(d„ Z)dS )Ú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         | _        dS )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       úZ/granary/edev/quantum/lib/python3.11/site-packages/matplotlib/testing/jpl_units/UnitDbl.pyÚ__init__zUnitDbl.__init__#   sA   € õ" Ô! $¤,°eÐ<Ñ<Ô<ˆÝ˜E D¨¤G™OÑ,Ô,ˆŒØ˜1”gˆŒˆˆó    c                 óÊ   — | j         |k    r| j        S t          j        | j        |¬¦  «        }| j         |d         k    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œ'Ò!Ð!Ýð 7à-1ð7ð 7ð .3ð7ð 7ð 7ñ 8ô 8ð 8ð Œ{˜T !œWÑ$Ð$r   c                 óP   — 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Ô5Ð5r   c                 ó8   — 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Ô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Ñ Ô Ð r   c                 óZ   — |                       |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 Ñ+Ô+Ð+Øˆr�$”+˜sœzÑ*Ô*Ð*r   c                 óŠ   — |                       ||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   s<   € à×Ò˜C ¤Ñ-Ô-Ð-Ý�r�r˜$œ+ s¤zÑ2Ô2°D´KÑ@Ô@Ð@r   c                 óJ   — 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�r˜$œ+ vÑ.Ô.°´Ñ<Ô<Ð<r   c                 ó$   — 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                 ó$   — d| j         | j        fz  S )r<   zUnitDbl(%g, '%s')r=   r&   s    r   Ú__repr__zUnitDbl.__repr__{   s   € à" d¤k°4´;Ð%?Ñ?Ð?r   c                 ó&   — | 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n|                     |¦  «         |dz  }Œ*|S )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.
        Nr   r   )r   r   Úappend)ÚstartÚstopÚstepÚelemsÚiÚds         r   ÚrangezUnitDbl.rangeƒ   sg   € ð$ ˆ<Ý˜1˜eœlÑ+Ô+ˆDàˆàˆð	Ø˜˜D™Ñ ˆAØ�DŠyˆyØà�LŠL˜‰OŒOˆOØ�‰FˆAð	ð ˆr   c                 ój   — | j         |j         k    r"t          d|› d| j         › d|j         › �¦  «        ‚dS )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¥   s\   € ð Œ;˜#œ*Ò$Ð$Ýð 2 tð 2ð 2Ø%)¤[ð2ð 2à%(¤Zð2ð 2ñ 3ô 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ð 6ð 6ð2ð 2ð 2ð!ð !ð !ð+ð +ð +ð
 %ˆYÔ$ T¨8¬;Ñ7Ô7€FØ$ˆYÔ$ T¨8¬;Ñ7Ô7€FØ$ˆYÔ$ T¨8¬;Ñ7Ô7€FØ$ˆYÔ$ T¨8¬;Ñ7Ô7€FØ$ˆYÔ$ T¨8¬;Ñ7Ô7€FØ$ˆYÔ$ T¨8¬;Ñ7Ô7€FðAð Að Að
 &ˆiÔ%Ð&6¸¼ÑEÔE€GØ%ˆiÔ%Ð&6¸¼ÑEÔE€Gð=ð =ð =ð &ˆiÔ%Ð&8¸(¼,ÑGÔG€GØ&ˆyÔ&Ð'9¸8¼<ÑHÔH€Hð5ð 5ð 5ð@ð @ð @ð(ð (ð (ð ðð ð ñ „\ððB3ð 3ð 3ð 3ð 3r   r   )rQ   rR   rT   Ú
matplotlibr   r   ri   r   r   ú<module>rk      sn   ðØ Ð à Ð Ð Ð Ø €€€à Ð Ð Ð Ð Ð ðk3ð k3ð k3ð k3ð k3ñ k3ô k3ð k3ð k3ð k3r   