
    h                     8    S r SSKrSSKrSSKJr   " S S5      rg)zUnitDbl module.    N)_apic            	          \ rS rSrSrSSSSSSS	S
S.rSSSS.rS rS rS r	S r
S rS r\R                  " \\R                   5      r\R                  " \\R$                  5      r\R                  " \\R(                  5      r\R                  " \\R,                  5      r\R                  " \\R0                  5      r\R                  " \\R4                  5      rS r\R                  " \\R:                  5      r\R                  " \\R>                  5      r S r!\R                  " \!\RD                  5      r#\R                  " \!\RD                  5      r$S r%S r&S r'\(SS j5       r)S r*Sr+g) UnitDbl	   zClass UnitDbl in development.)gMbP?km)   r   )g8~߿?r   )r   rad)g:RFߑ?r	   )r   sec)g      N@r
   )i  r
   )mr   miler	   degr
   minhourdistanceangletime)r   r	   r
   c                     [         R                  " U R                  US9n[        XS   -  5      U l        US   U l        g)a  
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       V/var/www/html/env/lib/python3.13/site-packages/matplotlib/testing/jpl_units/UnitDbl.py__init__UnitDbl.__init__#   s7    " !!$,,e<EGO,1g    c                     U R                   U:X  a  U R                  $ [        R                  " U R                  US9nU R                   US   :w  a  [        SU  SU S35      eU R                  U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   convertUnitDbl.convert8   s}     ;;%;;!!$,,e<;;$q'!  --1F 3--2G27 8 8 {{T!W$$r!   c                 T    [        [        U R                  5      U R                  5      $ )z*Return the absolute value of this UnitDbl.)r   absr   r   r   s    r   __abs__UnitDbl.__abs__P   s    s4;;'55r!   c                 D    [        U R                  * U R                  5      $ )z*Return the negative value of this UnitDbl.r   r   r   r)   s    r   __neg__UnitDbl.__neg__T   s    |T[[11r!   c                 ,    [        U R                  5      $ )z$Return the truth value of a UnitDbl.)boolr   r)   s    r   __bool__UnitDbl.__bool__X   s    DKK  r!   c                 `    U R                  US5        U" U R                  UR                  5      $ )zACheck that *self* and *rhs* share units; compare them using *op*.compare)checkSameUnitsr   r   oprhss      r   _cmpUnitDbl._cmp\   s'    C+$++szz**r!   c                     U R                  X!R                  5        [        U" U R                  UR                  5      U R                  5      $ )zACheck that *self* and *rhs* share units; combine them using *op*.)r6   __name__r   r   r   r7   s      r   _binop_unit_unitUnitDbl._binop_unit_unith   s4    C-r$++szz2DKK@@r!   c                 P    [        U" U R                  U5      U R                  5      $ )z'Combine *self* and *scalar* using *op*.r-   )r   r8   scalars      r   _binop_unit_scalarUnitDbl._binop_unit_scalarp   s    r$++v.<<r!   c                 :    U R                   S SU R                   3$ )Print the UnitDbl.gz *r   r   r)   s    r   __str__UnitDbl.__str__w   s    ++a4;;-00r!   c                 >    SU R                   S SU R                   S3$ )rE   zUnitDbl(rF   z, 'z')rG   r)   s    r   __repr__UnitDbl.__repr__{   s!    $++aDKK=;;r!   c                 4    U R                   U R                     $ )z Return the type of UnitDbl data.)_typesr   r)   s    r   typeUnitDbl.type   s    {{4;;''r!   Nc                     Uc  [        SU R                  5      n/ nSn XU-  -   nXQ:  a   U$ UR                  U5        US-  nM'  )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   rangeUnitDbl.range   s\    $ <1ell+DD Ay
  LLOFA r!   c                     U R                   UR                   :w  a(  [        SU SU R                    SUR                    35      eg)a	  
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   r9   funcs      r   r6   UnitDbl.checkSameUnits   sM     ;;#**$wtf -%%)[[M 2%%(ZZL2 3 3 %r!   )r   r   )N),r=   
__module____qualname____firstlineno____doc__r   rN   r   r%   r*   r.   r2   r:   	functoolspartialmethodoperatoreq__eq__ne__ne__lt__lt__le__le__gt__gt__ge__ge__r>   add__add__sub__sub__rB   mul__mul____rmul__rH   rK   rO   staticmethodrY   r6   __static_attributes__ r!   r   r   r   	   sp   '  -
G 
F*%062!+
 $$T8;;7F$$T8;;7F$$T8;;7F$$T8;;7F$$T8;;7F$$T8;;7FA
 %%&6EG%%&6EG= %%&8(,,GG&&'98<<HH1<(  B3r!   r   )ra   rb   rd   
matplotlibr   r   rz   r!   r   <module>r|      s       k3 k3r!   