+
    ‹°³j.  ã                   óœ   € R t ^ RIHtHtHt ^ RIHtHtHt ^ RI	H
t
 ^ RIHt ]
! RRR7      t]'       g   RtR	 tR
 tR tR tR tR tR tR# )z<Tests of tools for setting up interactive IPython sessions. )Úinit_ipython_sessionÚenable_automatic_symbolsÚ"enable_automatic_int_sympification)ÚSymbolÚRationalÚInteger)Úimport_module)ÚraisesÚIPythonz1.0)Úmin_module_versionTc                  óŠ  € \        4       p V P                  R 4       \        V 4       RpWP                  9  g   Q hV P                  RV,          R4       WP                  9  g   Q hV P                  RV,          R4       V P                  R,          \        8X  g   Q hV P                  V: RV: R2R4       WP                  9   g   Q hV P                  RR4       R	V P                  9  g   Q hV P                  R,          RJ g   Q hV P                  R
4       V P                  RR4       V P                  R,          RJ g   Q hR# )zfrom sympy import *Úverylongsymbolnameza = %sTza = type(%s)Úaz = Symbol('z')za = all == __builtin__.allÚallzimport sympyz a = factorial == sympy.factorialN)r   Úrun_cellr   Úuser_nsr   )ÚappÚsymbols     Úe/home/luca/screen-checking/.venv/lib/python3.14/site-packages/sympy/interactive/tests/test_ipython.pyÚtest_automatic_symbolsr      s  € ô Ó
 €CØ‡L�LÐ&Ô'ä˜SÔ!à!€FØŸ™Ô$Ð$Ð$Ø‡L�L�˜FÕ" DÔ)ØŸ™Ô$Ð$Ð$Ø‡L�L� &Õ(¨$Ô/Ø�;‰;�sÕœvÔ%Ð%Ð%Ø‡L�L«³Ð7¸Ô>Ø—[‘[Ô Ð Ð ð ‡L�LÐ-¨tÔ4Ø˜Ÿ™Ô#Ð#Ð#Ø�;‰;�sÕ˜tÓ#Ð#Ð#ð ‡L�L�Ô Ø‡L�LÐ3°TÔ:Ø�;‰;�sÕ˜tÓ#Ð#Ò#ó    c                  óŒ  € \        4       p V P                  R 4       V P                  R4       \        V P                  R,          \        4      '       g   Q h\        V 4       V P                  R4       \        V P                  R,          \        4      '       g   Q hV P                  R4       \        V P                  R,          \        4      '       g   Q hV P                  R4       \        V P                  R,          \        4      '       g   Q hV P                  R4       V P                  R,          \        ^^4      8X  g   Q hR# )zfrom sympy import Integerza = 1r   za = 1/2z
a = int(1)z
a = (1/
2)N)r   r   Ú
isinstancer   Úintr   r   r   ©r   s    r   Útest_int_to_Integerr   :   sè   € ä
Ó
 €CØ‡L�LÐ,Ô-Ø‡L�L�ÔÜ�c—k‘k #Õ&¬×,Ò,Ð,Ð,ä& sÔ+Ø‡L�L�ÔÜ�c—k‘k #Õ&¬×1Ò1Ð1Ð1Ø‡L�L�ÔÜ�c—k‘k #Õ&¬×0Ò0Ð0Ð0Ø‡L�L�ÔÜ�c—k‘k #Õ&¬×,Ò,Ð,Ð,Ø‡L�L�ÔØ�;‰;�sÕœx¨¨1›~Ô-Ð-Ò-r   c                  óŒ  € \        4       p V P                  R 4       V P                  R4       V P                  R4       V P                  R4       V P                  R4       V P                  R4       \        \        P                  P                  R4      ^ ,          4      ^8  dD   V P                  R,          R,          R	8X  g   Q hV P                  R
,          R,          R8X  g   Q hMPV P                  R,          ^ ,          R,          R	8X  g   Q hV P                  R
,          ^ ,          R,          R8X  g   Q hV P                  R4       V P                  R4       V P                  R4       V P                  R4       \        \        P                  P                  R4      ^ ,          4      ^8  dE   V P                  R,          R,          R9   g   Q hV P                  R
,          R,          R9   g   Q hR# V P                  R,          ^ ,          R,          R9   g   Q hV P                  R
,          ^ ,          R,          R9   g   Q hR# )úip = get_ipython()úinst = ip.instance()ú&format = inst.display_formatter.formatúfrom sympy import Symbolza = format(Symbol('pi'))za2 = format(Symbol('pi')**2)Ú.r   ú
text/plainÚpiÚa2zpi**2úfrom sympy import init_printingzinit_printing()N)u   Ï€r#   )u    2
Ï€ z  2
pi ©r   r   r   ÚipythonÚ__version__Úsplitr   r   s    r   Útest_ipythonprintingr*   N   sÎ  € ä
Ó
 €CØ‡L�LÐ%Ô&Ø‡L�LÐ'Ô(Ø‡L�LÐ9Ô:Ø‡L�LÐ+Ô,ð ‡L�LÐ+Ô,Ø‡L�LÐ/Ô0ä
Œ7×Ñ×$Ñ$ SÓ)¨!Õ,Ó-°Ô1Ø�{‰{˜3Õ Õ-°Ô5Ð5Ð5Ø�{‰{˜4Õ  Õ.°'Ô9Ð9Ñ9à�{‰{˜3Õ Õ" <Õ0°DÔ8Ð8Ð8Ø�{‰{˜4Õ  Õ# LÕ1°WÔ<Ð<Ð<ð ‡L�LÐ2Ô3Ø‡L�LÐ"Ô#à‡L�LÐ+Ô,Ø‡L�LÐ/Ô0ä
Œ7×Ñ×$Ñ$ SÓ)¨!Õ,Ó-°Ô1Ø�{‰{˜3Õ Õ-Ð1TÔTÐTÐTØ�{‰{˜4Õ  Õ.Ð2`Ô`Ð`Ò`à�{‰{˜3Õ Õ" <Õ0Ð4WÔWÐWÐWØ�{‰{˜4Õ  Õ# LÕ1Ð5cÔcÐcÒcr   c                  óè  a€ \        4       oSP                  R 4       SP                  R4       SP                  R4       SP                  R4       SP                  R4       SP                  R4       \        \        P                  P                  R4      ^ ,          4      ^8  d0   SP                  R,          R,          p \        \        V3R	 l4       M5SP                  R,          ^ ,          R,          p \        \        V3R
 l4       V R9   g   Q hSP                  R4       SP                  R4       SP                  R4       \        \        P                  P                  R4      ^ ,          4      ^8  d6   SP                  R,          R,          p SP                  R,          R,          pMBSP                  R,          ^ ,          R,          p SP                  R,          ^ ,          R,          pV R9   g   Q hVR8X  g   Q hSP                  R4       SP                  R4       \        \        P                  P                  R4      ^ ,          4      ^8  d   SP                  R,          R,          pM!SP                  R,          ^ ,          R,          pVR8X  g   Q hSP                  R4       SP                  R4       SP                  R4       \        \        P                  P                  R4      ^ ,          4      ^8  d0   SP                  R,          R,          p \        \        V3R l4       M5SP                  R,          ^ ,          R,          p \        \        V3R l4       V R9   g   Q hR# )r   r   r   r    r%   z2a = format({Symbol('pi'): 3.14, Symbol('n_i'): 3})r!   r   r"   c                  ó8   <€ S P                   R ,          R,          # ©r   ú
text/latex©r   r   s   €r   Ú<lambda>Ú+test_print_builtin_option.<locals>.<lambda>}   ó   ø€  §¡¨SÕ!1°,Ö!?r   c                  óF   <€ S P                   R ,          ^ ,          R,          # r-   r/   r   s   €r   r0   r1   €   ó   ø€  §¡¨SÕ!1°!Õ!4°\Ö!Br   ú>inst.display_formatter.formatters['text/latex'].enabled = Trueúinit_printing(use_latex=True)r.   z8$\displaystyle \left\{ n_{i} : 3, \  \pi : 3.14\right\}$z\    class WithOverload:
        def _latex(self, printer):
            return r"\LaTeX"
    za = format((WithOverload(),))z%$\displaystyle \left( \LaTeX,\right)$z2init_printing(use_latex=True, print_builtin=False)c                  ó8   <€ S P                   R ,          R,          # r-   r/   r   s   €r   r0   r1   ¯   r2   r   c                  óF   <€ S P                   R ,          ^ ,          R,          # r-   r/   r   s   €r   r0   r1   ²   r4   r   N)ú{pi: 3.14, n_i: 3}u   {náµ¢: 3, Ï€: 3.14}ú{n_i: 3, pi: 3.14}u   {Ï€: 3.14, náµ¢: 3})r9   r:   )	r   r   r   r'   r(   r)   r   r	   ÚKeyError)ÚtextÚlatexr   s     @r   Útest_print_builtin_optionr>   p   sÃ  ø€ ä
Ó
 €CØ‡L�LÐ%Ô&Ø‡L�LÐ'Ô(Ø‡L�LÐ9Ô:Ø‡L�LÐ+Ô,Ø‡L�LÐ2Ô3à‡L�LÐEÔFä
Œ7×Ñ×$Ñ$ SÓ)¨!Õ,Ó-°Ô1Ø�{‰{˜3Õ Õ-ˆÜŒxÔ?Õ@à�{‰{˜3Õ Õ" <Õ0ˆÜŒxÔBÔCð ð aô að að að ‡L�LÐQÔRØ‡L�LÐ0Ô1Ø‡L�LÐEÔFä
Œ7×Ñ×$Ñ$ SÓ)¨!Õ,Ó-°Ô1Ø�{‰{˜3Õ Õ-ˆØ—‘˜CÕ  Õ.‰à�{‰{˜3Õ Õ" <Õ0ˆØ—‘˜CÕ  Õ# LÕ1ˆØð aô að að að ÐOÔOÐOÐOð ‡L�Lð ô 	ð
 ‡L�LÐ0Ô1ä
Œ7×Ñ×$Ñ$ SÓ)¨!Õ,Ó-°Ô1Ø—‘˜CÕ  Õ.‰à—‘˜CÕ  Õ# LÕ1ˆØÐ<Ô<Ð<Ð<à‡L�LÐQÔRØ‡L�LÐEÔFØ‡L�LÐEÔFä
Œ7×Ñ×$Ñ$ SÓ)¨!Õ,Ó-°Ô1Ø�{‰{˜3Õ Õ-ˆÜŒxÔ?Õ@à�{‰{˜3Õ Õ" <Õ0ˆÜŒxÔBÔCð
 Ð?Ô?Ð?Ò?r   c                  ó*  € \        4       p V P                  R 4       V P                  R4       V P                  R4       V P                  R4       V P                  R4       V P                  R4       V P                  R4       V P                  R4       V P                  R4       V P                  R	4       \        \        P                  P                  R
4      ^ ,          4      ^8  dÂ   V P                  R,          R,          R8X  g   Q hRV P                  R,          9  g   Q hV P                  R,          R,          R,          R8X  g   Q hRV P                  R,          9  g   Q hV P                  R,          R,          R8X  g   Q hV P                  R,          R,          R8X  g   Q hR# V P                  R,          ^ ,          R,          R8X  g   Q hRV P                  R,          ^ ,          9  g   Q hV P                  R,          ^ ,          R,          R,          R8X  g   Q hRV P                  R,          ^ ,          9  g   Q hV P                  R,          ^ ,          R,          R8X  g   Q hV P                  R,          ^ ,          R,          R8X  g   Q hR# )r   r   r   r5   ú'from sympy import init_printing, Matrixz0init_printing(use_latex=True, use_unicode=False)za = format((True, False))z
import syszb = format(sys.flags)zc = format((Matrix([1, 2]),))r!   r   r"   z(True, False)r.   Úb:Né
   Nz
sys.flags(Úcz [1]  
([ ],)
 [2]  zJ$\displaystyle \left( \left[\begin{matrix}1\\2\end{matrix}\right],\right)$Nr&   r   s    r   Útest_builtin_containersrD   º   sD  € ä
Ó
 €CØ‡L�LÐ%Ô&Ø‡L�LÐ'Ô(Ø‡L�LÐ9Ô:Ø‡L�LÐQÔRØ‡L�LÐ:Ô;Ø‡L�LÐCÔDð ‡L�LÐ,Ô-Ø‡L�L�ÔØ‡L�LÐ(Ô)Ø‡L�LÐ0Ô1ä
Œ7×Ñ×$Ñ$ SÓ)¨!Õ,Ó-°Ô1Ø�{‰{˜3Õ Õ-°/ÔAÐAÐAØ 3§;¡;¨sÕ#3Ô3Ð3Ð3Ø�{‰{˜3Õ Õ-¨cÕ2°lÔBÐBÐBØ 3§;¡;¨sÕ#3Ô3Ð3Ð3Ø�{‰{˜3Õ Õ-ðôð 	ð ð �{‰{˜3Õ Õ-ð  2Gô  Gð  	Gò  Gà�{‰{˜3Õ Õ" <Õ0°_ÔDÐDÐDØ 3§;¡;¨sÕ#3°AÕ#6Ô6Ð6Ð6Ø�{‰{˜3Õ Õ" <Õ0°Õ5¸ÔEÐEÐEØ 3§;¡;¨sÕ#3°AÕ#6Ô6Ð6Ð6Ø�{‰{˜3Õ Õ" <Õ0ðôð 	ð ð �{‰{˜3Õ Õ" <Õ0ð  5Jô  Jð  	Jò  Jr   c                  ó>  € \        4       p V P                  R 4       V P                  R4       V P                  R4       V P                  R4       V P                  R4       V P                  R4       V P                  R4       V P                  R4       \        \        P                  P                  R4      ^ ,          4      ^8  d   V P                  R	4       MV P                  R
4       V P                  R4       V P                  R4       V P                  R4       R# )úimport IPythonr   r   r   r@   z%init_printing(use_latex='matplotlib')z=inst.display_formatter.formatters['image/png'].enabled = Truezimport warningsr!   zwarnings.simplefilter('error')zHwarnings.simplefilter('error', IPython.core.formatters.FormatterWarning)za = format(Matrix([1, 2, 3]))z'from sympy import Piecewise, Symbol, EqzAx = Symbol('x'); pw = format(Piecewise((1, Eq(x, 0)), (0, True)))N)r   r   r   r'   r(   r)   r   s    r   Útest_matplotlib_bad_latexrG   ã   sÞ   € ä
Ó
 €CØ‡L�LÐ!Ô"Ø‡L�LÐ%Ô&Ø‡L�LÐ'Ô(Ø‡L�LÐ9Ô:Ø‡L�LÐ:Ô;Ø‡L�LÐ8Ô9ð ‡L�LÐPÔQð ‡L�LÐ"Ô#ä
Œ7×Ñ×$Ñ$ SÓ)¨!Õ,Ó-°Ô1Ø�‰Ð5Õ6à�‰Ð_Ô`ð ‡L�LÐ0Ô1ð ‡L�LÐ:Ô;Ø‡L�LÐTÖUr   c                  ó`  € \        4       p V P                  R 4       V P                  R4       V P                  R4       V P                  R4       V P                  R4       V P                  R4       V P                  R4       V P                  R4       V P                  R4       V P                  R	4       \        \        P                  P                  R
4      ^ ,          4      ^8  d   V P                  R,          R,          pM!V P                  R,          ^ ,          R,          pVR8X  g   Q hR# )rF   r   r   r   r5   r%   r    r6   z‹    class SymbolWithOverload(Symbol):
        def _repr_latex_(self):
            return r"Hello " + super()._repr_latex_() + " world"
    z#a = format(SymbolWithOverload('s'))r!   r   r.   zHello $\displaystyle s$ worldNr&   )r   r=   s     r   Útest_override_repr_latexrI      sï   € ä
Ó
 €CØ‡L�LÐ!Ô"Ø‡L�LÐ%Ô&Ø‡L�LÐ'Ô(Ø‡L�LÐ9Ô:Ø‡L�LÐQÔRØ‡L�LÐ2Ô3Ø‡L�LÐ+Ô,Ø‡L�LÐ0Ô1Ø‡L�Lð ô 	ð
 ‡L�LÐ6Ô7ä
Œ7×Ñ×$Ñ$ SÓ)¨!Õ,Ó-°Ô1Ø—‘˜CÕ  Õ.‰à—‘˜CÕ  Õ# LÕ1ˆØÐ4Ô4Ð4Ò4r   N)Ú__doc__Úsympy.interactive.sessionr   r   r   Ú
sympy.corer   r   r   Úsympy.externalr   Úsympy.testing.pytestr	   r'   Údisabledr   r   r*   r>   rD   rG   rI   © r   r   Ú<module>rQ      sc   ðÙ B÷Bñ B÷ 1Ñ 0Ý (Ý 'ñ ˜	°eÔ
<€çà€Hò$ò:.ò(dòDG@òT'JòRVô:5r   