
    P/Ph~                     @    d Z ddlZddlZddlmZ  G d d          ZdS )zDuration module.    N)_apic                   t   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j                  Zd Zd Zd ZeZd Zd Z d Z!dS )DurationzClass Duration in development.ETUTCc                 X    t          j        | j        |           || _        || _        dS )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      e/var/www/html/test/jupyter/venv/lib/python3.11/site-packages/matplotlib/testing/jpl_units/Duration.py__init__zDuration.__init__   s.     	4<u5555    c                     | j         S )z$Return the frame the duration is in.)r   r   s    r   r	   zDuration.frame   s
    {r   c                 P    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%7888r   c                 8    t          | j        | j                   S )z+Return the negative value of this Duration.)r   r   r   r   s    r   __neg__zDuration.__neg__%   s    dm^4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k    S )Nr   r   r   s    r   __bool__zDuration.__bool__-   s    }!!r   c                 Z    |                      |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   s0     	C+++r$-...r   c                     ddl mc m} t          ||j                  r|| z   S |                     |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__>   sn     	100000000c17## 	:C'''T]S\%ABBBr   c                 r    |                      |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   s5     	C'''T]S\%ABBBr   c                 V    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]U3ZZ%?@@@r   c                 &    | j         dd| j         S )Print the Duration.g )r   r   r   s    r   __str__zDuration.__str__r   s    -111DK1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"    >DK>>DM>>>>>r   c                 j    | j         |j         k    r"t          d| d| j          d|j                    dS )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   s\     ;#*$$%$ % %% %
% %& & & %$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 9 95 5 5  " " "/ / / %Y$T8;77F$Y$T8;77F$Y$T8;77F$Y$T8;77F$Y$T8;77F$Y$T8;77FC C C,C C C 
A 
A 
A H2 2 2? ? ?& & & & &r   r   )rB   rC   rE   
matplotlibr   r   rS   r   r   <module>rU      sn                A& A& A& A& A& A& A& A& A& A&r   