
    Bwg                        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 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 G d de	j                        Zej(                  j*                  d        Zej(                  j*                  ej(                  j/                   ej0                         dvd      d               Zej(                  j*                   G d de	j                               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     W/var/www/horilla/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)TestDataOnlyMultiModuler   r   r	   zdatonly.f90c                     | j                   j                  j                  dk(  sJ | j                   j                  j                  dk(  sJ d}| j                   j                  d      dk(  sJ y )Nd   i     i  )r   datonly	max_valuedatmax_simple_subroutine)r   int_ins     r   	test_mdatz!TestDataOnlyMultiModule.test_mdat   s^    {{"",,333{{##t+++{{,,Q/4777r   N)
r   r    r!   r   r"   r#   r   r$   r%   r2   r&   r   r   r(   r(      s7    t||GUL-HIG[[8 8r   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>.ubound2   s    7Q;r   )is_ie_arr   r   )r   r   r   r   r   r   )r   xvecxlowxhighr<   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%   rF   r&   r   r   r4   r4   '   s9    t||GU,=?PQRG[[) )r   r4   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   
isinstancerJ   strr   __version__r   s    r   test_numpy_version_attributez6TestNumpyVersionAttribute.test_numpy_version_attribute?   sS     t{{$<=== $++<<cBBB ~~!C!CCCCr   N)
r   r    r!   r   r"   r#   r   r$   r%   rP   r&   r   r   rH   rH   :   s;     t||GUL+FGG[[	D 	Dr   rH   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_pathrY   L   s?    WW  "FJJv&M7 &%%%&r   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_gh25344X   s'    kkooc3's

r   N)r   r    r!   r   r"   r#   optionsr   r$   r%   r`   r&   r   r   r[   r[   S   su    t||GUL-HIGLDLL%>?@!,$,,w|"L!MNPG [[ r   r[   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      r   arrayint32r   testsubr   x1x2r_   s       r   test_gh26148zTestF77Comments.test_gh26148b   `    XXarxx(XXarxx(KKB'1v{{1v||r   c                     t        j                  ddt         j                        dz  }| j                  j	                         }t        j                  ||       y )Nr   r@   r   r   )r   r   r   r   testsub2nptassert_allclose)r   expectedr_   s      r   test_gh26466zTestF77Comments.test_gh26466j   sA     99Q"**5a7KK  "Hc*r   N)r   r    r!   r   r"   r#   r   r$   r%   ro   rv   r&   r   r   rc   rc   ^   sU    t||GUL/JKG[[  [[+ +r   rc   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 re   rh   rl   s       r   test_gh26148bz TestF90Contiuation.test_gh26148bu   rp   r   N)
r   r    r!   r   r"   r#   r   r$   r%   r{   r&   r   r   rx   rx   q   s8    t||GUL:OPQG[[ r   rx   c                   p    e Zd Z ej                  dddd      gZej                  j                  d        Z	y)TestLowerF2PYDirectivesr   r   r	   zlower_f2py_fortran.f90c                 :    | j                   j                  d       y )Nr   )r   inquire_nextrO   s    r   test_gh28014z$TestLowerF2PYDirectives.test_gh28014   s      #r   N)
r   r    r!   r   r"   r#   r   r$   r%   r   r&   r   r   r}   r}   }   s8    t||GUL:RSTG[[ r   r}   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	   ry   z	-lfoo.barBlah)module_namezlparen got assign)r   build_moduler"   RuntimeErrorrM   aarerrs     r   test_gh26623r      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"r   )ra   r   unknown_subroutine_)r   r   r"   ImportErrorrM   r   s     r   test_gh25784r      sc    2\\'5,8JKL 01
 
  2$D	1112s   14 	AAAc                   p    e Zd Z ej                  dddd      gZej                  j                  d        Z	y)TestAssignmentOnlyModulesr   r   r	   zassignOnlyModule.f90c                     | j                   j                  j                  dk(  sJ | j                   j                  j                  dk(  sJ | j                   j                  j                  dk(  sJ y )N      H   )r   	f_globalsn_maxi_maxj_maxrO   s    r   test_gh27167z&TestAssignmentOnlyModules.test_gh27167   s\    %%++r121%%++r121%%++r121r   N)
r   r    r!   r   r"   r#   r   r$   r%   r   r&   r   r   r   r      s:     t||GUL:PQRG[[3 3r   r   )rT   r   platformnumpyr   numpy.testingtestingrs    r   F2PyTestr   r(   r4   rH   rY   r[   rc   rx   r}   r$   r%   r   skipifsystemr   r   r&   r   r   <module>r      s0   	     )dmm ) 	8dmm 	8) )&D D$&	t}} 	+dmm +&
 
dmm  	4 	4 OHOO%-@@Iop2 q 2  3 3 3r   