
    zYHh~                     8    d Z ddlZddlZddlmZ  G d d      Zy)zDuration module.    N)_apic                      e Zd ZdZddgZ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d Zd ZeZd Zd Z d Z!y)DurationzClass Duration in development.ETUTCc                 b    t        j                  | j                  |       || _        || _        y)a3  
        Create a new Duration object.

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

        = INPUT VARIABLES
        - frame     The frame of the duration.  Must be 'ET' or 'UTC'
        - seconds  The number of seconds in the Duration.
        )frameN)r   check_in_listallowed_frame_seconds)selfr	   secondss      ^/var/www/html/planif/env/lib/python3.12/site-packages/matplotlib/testing/jpl_units/Duration.py__init__zDuration.__init__   s&     	4<<u5    c                     | j                   S )z$Return the frame the duration is in.)r   r   s    r   r	   zDuration.frame   s    {{r   c                 T    t        | j                  t        | j                              S )z*Return the absolute value of the duration.)r   r   absr   r   s    r   __abs__zDuration.__abs__!   s    S%788r   c                 D    t        | j                  | j                         S )z+Return the negative value of this Duration.)r   r   r   r   s    r   __neg__zDuration.__neg__%   s    dmm^44r   c                     | j                   S )z-Return the number of seconds in the Duration.r   r   s    r   r   zDuration.seconds)   s    }}r   c                      | j                   dk7  S )Nr   r   r   s    r   __bool__zDuration.__bool__-   s    }}!!r   c                 `    | j                  |d        || j                  |j                        S )zT
        Check that *self* and *rhs* share frames; compare them using *op*.
        compare)checkSameFramer   )r   oprhss      r   _cmpzDuration._cmp0   s)     	C+$--..r   c                     ddl mc m} t        ||j                        r|| z   S | j                  |d       t        | j                  | j                  |j                  z         S )a"  
        Add two Durations.

        = ERROR CONDITIONS
        - If the input rhs is not in the same frame, an error is thrown.

        = INPUT VARIABLES
        - rhs     The Duration to add.

        = RETURN VALUE
        - Returns the sum of ourselves and the input Duration.
        r   Nadd)	matplotlib.testing.jpl_unitstesting	jpl_units
isinstanceEpochr    r   r   r   )r   r"   Us      r   __add__zDuration.__add__>   sP     	10c177#:C'T]]S\\%ABBr   c                     | j                  |d       t        | j                  | j                  |j                  z
        S )a3  
        Subtract two Durations.

        = ERROR CONDITIONS
        - If the input rhs is not in the same frame, an error is thrown.

        = INPUT VARIABLES
        - rhs     The Duration to subtract.

        = RETURN VALUE
        - Returns the difference of ourselves and the input Duration.
        sub)r    r   r   r   r   r"   s     r   __sub__zDuration.__sub__T   s2     	C'T]]S\\%ABBr   c                 Z    t        | j                  | j                  t        |      z        S )z
        Scale a UnitDbl by a value.

        = INPUT VARIABLES
        - rhs     The scalar to multiply by.

        = RETURN VALUE
        - Returns the scaled Duration.
        )r   r   r   floatr/   s     r   __mul__zDuration.__mul__d   s"     T]]U3Z%?@@r   c                 :    | j                   dd| j                   S )Print the Duration.g )r   r   r   s    r   __str__zDuration.__str__r   s    --"!DKK=11r   c                 >    d| j                    d| j                  ddS )r5   z
Duration('z', r6   ))r   r   r   s    r   __repr__zDuration.__repr__v   s"    DKK=DMM!+<A>>r   c                     | j                   |j                   k7  r(t        d| d| j                    d|j                          y)aK  
        Check to see if frames are the same.

        = ERROR CONDITIONS
        - If the frame of the rhs Duration is not the same as our frame,
          an error is thrown.

        = INPUT VARIABLES
        - rhs     The Duration to check for the same frame
        - func    The name of the function doing the check.
        zCannot z' Durations with different frames.
LHS: z
RHS: N)r   
ValueError)r   r"   funcs      r   r    zDuration.checkSameFramez   sN     ;;#**$$  } %

|%& & %r   N)"__name__
__module____qualname____doc__r   r   r	   r   r   r   r   r#   	functoolspartialmethodoperatoreq__eq__ne__ne__lt__lt__le__le__gt__gt__ge__ge__r,   r0   r3   __rmul__r8   r;   r     r   r   r   r   	   s    (UmG 95"/ %Y$$T8;;7F$Y$$T8;;7F$Y$$T8;;7F$Y$$T8;;7F$Y$$T8;;7F$Y$$T8;;7FC,C 
A H2?&r   r   )rB   rC   rE   
matplotlibr   r   rS   r   r   <module>rU      s       A& A&r   