
    R1i^                         d Z ddlZddlZddlmZ ddlZddlZej                  dk(  Z	ej                  Z
 G d dej                        ZddZd Z G d	 d
e      Zy)z)Helpers for making Skyfield tests stable.    N)earthlibic                        e Zd ZdZed        Zy)datetimeNc                  "    t         j                  S N)r   	_fake_now     X/home/cursorai/projects/iching/venv/lib/python3.12/site-packages/skyfield/tests/fixes.pynowzdatetime.now   s    !!!r
   )__name__
__module____qualname__r   staticmethodr   r	   r
   r   r   r      s    I" "r
   r   c                     t        d       t        j                  |  t        j                  j                  dd      t        j                  _        fdt        j                  j                  _
        t        _        t        t        _        y )Npandas.F)verbosec                     S r   r	   )selffake_nows    r   <lambda>zsetup.<locals>.<lambda>   s    hr
   )
__import__dtr   skyfieldiokitLoaderapiloadtimelib	Timescale_utcnowr   )utcr   s    @r   setupr$      s^     x{{C H --c5-AHLL)>H&!HBKr
   c                      t         j                  j                  d      t         j                  _        t
        j                  j                  t         j                  j                  _
        t        t
        _        y )Nr   )r   r   r   r   r   r   r   utcnowr    r!   r"   _real_datetime_classr	   r
   r   teardownr(      sB     --c2HLL)+););H&&BKr
   c                   "    e Zd ZdZd Zd Zd Zy)low_precision_ERAa9  Compute the Earth rotation angle with only a single float for UT1.

    Skyfield now uses two floats ``t.whole`` and ``t.ut1_fraction`` to
    represent the UT1 Julian date, supplying an additional 16 digits of
    precision.  For the Earth rotation angle, which moves very quickly
    per unit time compared to most other astronomical quantities, this
    knocks Skyfield out of agreement with other libraries like NOVAS and
    SOFA that round UT1 to a single float.  Various tests use this
    context manager to make Skyfield match the lower-precision output.

    c                 X    t         j                  | _        | j                  t         _        y r   )r   earth_rotation_anglesavedera)r   s    r   	__enter__zlow_precision_ERA.__enter__/   s    22
(,%r
   c                 .    | j                   t        _        y r   )r-   r   r,   )r   argss     r   __exit__zlow_precision_ERA.__exit__2   s    (,

%r
   c                 .    ||z   }| j                  |      S r   )r-   )r   wholefractionrounded_single_floats       r   r.   zlow_precision_ERA.era4   s    $x/zz.//r
   N)r   r   r   __doc__r/   r2   r.   r	   r
   r   r*   r*   #   s    
130r
   r*   ))i  
      r8   )r7   r   r   sysr   r   skyfield.apiskyfield.timelibmaxsize	IS_32_BITr'   r$   r(   objectr*   r	   r
   r   <module>r@      sU    /  
   [[J&	{{ "r{{ "	'
0 0r
   