
    qKg                        d dl Z d dlZd dlZd dlZd dlmZ ddlm	Z	  G d de	j                        Z G d de	j                        Z G d d	e	j                        Zd
 Z G d de	j                        Z G d de	j                        Z G d de	j                        Zej$                  j&                  d        Zej$                  j&                  ej$                  j+                   ej,                         dvd      d               Zy)    N   )utilc                   p    e Zd Z ej                  dddd      gZej                  j                  d        Z	y)TestIntentInOuttestssrc
regression	inout.f90c                 l   t        j                  dt         j                        d d d   }t        j                  t
        | j                  j                  |       t        j                  dt         j                        }| j                  j                  |       t        j                  |g d      sJ y )N   dtype      )r   r   r   )	nparangefloat32pytestraises
ValueErrormodulefooallclose)selfxs     d/home/alanp/www/video.onchill/myenv/lib/python3.12/site-packages/numpy/f2py/tests/test_regression.py
test_inoutzTestIntentInOut.test_inout   ss     IIarzz*3Q3/j$++//15 IIarzz*{{1i(((    N)
__name__
__module____qualname__r   getpathsourcesr   markslowr    r   r   r   r      s7    t||GUL+FGG[[) )r   r   c                   p    e Zd Z ej                  dddd      gZej                  j                  d        Z	y)TestNegativeBoundsr   r   negative_boundszissue_20853.f90c           
         t        j                  d      }d}d}d }| j                  j                  |||d  |||             }t        j                  dt         j                        }t        j
                  ||      sJ y )N   i   c                     || z
  dz   S )Nr   r&   )xlxhs     r   uboundz0TestNegativeBounds.test_negbound.<locals>.ubound&   s    7Q;r   )is_ie_arr   r   )r   r   r   r   r   r   )r   xvecxlowxhighr0   rvalexpvals          r   test_negboundz TestNegativeBounds.test_negbound   ss    yy}	{{4U !5&u"56  82rzz2{{4(((r   N)
r   r    r!   r   r"   r#   r   r$   r%   r:   r&   r   r   r(   r(      s9    t||GU,=?PQRG[[) )r   r(   c                   p    e Zd Z ej                  dddd      gZej                  j                  d        Z	y)TestNumpyVersionAttributer   r   r	   r
   c                     t        | j                  d      sJ t        | j                  j                  t              sJ t
        j                  | j                  j                  k(  sJ y )N__f2py_numpy_version__)hasattrr   
isinstancer>   strr   __version__)r   s    r   test_numpy_version_attributez6TestNumpyVersionAttribute.test_numpy_version_attribute3   sS     t{{$<=== $++<<cBBB ~~!C!CCCCr   N)
r   r    r!   r   r"   r#   r   r$   r%   rC   r&   r   r   r<   r<   .   s;     t||GUL+FGG[[	D 	Dr   r<   c                      t         j                  j                         } t        j                  |       }dD ]  }||v rJ  y )N)zfortranobject.czfortranobject.h)r   f2pyget_includeoslistdir)incdirfnames_in_dirfnames      r   test_include_pathrL   @   s:    WW  "FJJv&M7%%% 8r   c                       e Zd Z ej                  dddd      gZd ej                  ddd       d ej                  ddd       gZej                  j                  d        Z
y)	TestIncludeFilesr   r   r	   zincfile.f90z-Iz--include-paths c                 N    d}| j                   j                  dd      }||k(  sJ y )Ng      @g      @g      @)r   add)r   express      r   test_gh25344zTestIncludeFiles.test_gh25344L   s'    kkooc3's

r   N)r   r    r!   r   r"   r#   optionsr   r$   r%   rS   r&   r   r   rN   rN   G   su    t||GUL-HIGLDLL%>?@!,$,,w|"L!MNPG [[ r   rN   c                       e Zd Z ej                  dddd      gZej                  j                  d        Z	ej                  j                  d        Z
y)TestF77Commentsr   r   r	   zf77comments.fc                     t        j                  dt         j                        }t        j                  dt         j                        }| j                  j	                  ||      }|d   dk(  sJ |d   dk(  sJ y Nr   r      r      r      r   arrayint32r   testsubr   x1x2rR   s       r   test_gh26148zTestF77Comments.test_gh26148V   `    XXarxx(XXarxx(KKB'1v{{1v||r   c                     t        j                  ddt         j                        dz  }| j                  j	                         }t        j                  ||       y )Nr   r4   r   r   )r   r   r   r   testsub2nptassert_allclose)r   expectedrR   s      r   test_gh26466zTestF77Comments.test_gh26466^   sA     99Q"**5a7KK  "Hc*r   N)r   r    r!   r   r"   r#   r   r$   r%   rc   rj   r&   r   r   rV   rV   R   sU    t||GUL/JKG[[  [[+ +r   rV   c                   p    e Zd Z ej                  dddd      gZej                  j                  d        Z	y)TestF90Contiuationr   r   r	   f90continuation.f90c                     t        j                  dt         j                        }t        j                  dt         j                        }| j                  j	                  ||      }|d   dk(  sJ |d   dk(  sJ y rX   r\   r`   s       r   test_gh26148bz TestF90Contiuation.test_gh26148bi   rd   r   N)
r   r    r!   r   r"   r#   r   r$   r%   ro   r&   r   r   rl   rl   e   s8    t||GUL:OPQG[[ r   rl   c                      	 t        j                  t        j                  dddd      gdgd      } y # t        $ r}dt	        |      vsJ Y d }~y d }~ww xY w)	Nr   r   r	   rm   z	-lfoo.barBlah)module_namezlparen got assign)r   build_moduler"   RuntimeErrorrA   aarerrs     r   test_gh26623rx   q   sY    4\\'5,8MNOM

  4"#d)3334s   03 	AAA)LinuxDarwinz$Unsupported on this platform for now)reasonc                      	 t        j                  t        j                  dddd      gddgd      } y # t        $ r}d	t	        |      v sJ Y d }~y d }~ww xY w)
Nr   r   r	   zf77fixedform.f95z--f77flags='-ffixed-form -O2'z--f90flags="-ffixed-form -Og"rq   )rT   rr   unknown_subroutine_)r   rs   r"   ImportErrorrA   ru   s     r   test_gh25784r   ~   sc    2\\'5,8JKL 01
 
  2$D	1112s   14 	AAA)rG   r   platformnumpyr   numpy.testingtestingrg    r   F2PyTestr   r(   r<   rL   rN   rV   rl   r$   r%   rx   skipifsystemr   r&   r   r   <module>r      s    	     )dmm ) ) )&D D$&	t}} 	+dmm +&
 
 	4 	4 OHOO%-@@Iop2 q 2r   