ó
    6ljþ  ã                   ó   • S r SSKrSSKJs  Jr  SSKJr  SSK	r	SSK
JrJrJr  \	R                  R                  SS\" S5      4S\" S	5      4S
\" S5      4S\" S5      4S\" S5      4S\" S5      4S\" S5      4S\" S5      4S\" S5      4S\" S5      4S\" S5      4S\" S5      4S\" S5      4S\" S 5      4/5      S! 5       r\	R                  R                  S"/ S#Q5      S$ 5       rS% r\	R                  R                  S/ S&Q5      S' 5       rg)(uÐ   The one figure reader. This is where the table of cases lives: every
consumer â€” the export's numeric column, the benchmark's scoring â€” calls
`as_number`, so the cases that ever went wrong are pinned here.é    N)ÚDecimal)Ú	as_numberÚ
is_percentÚnorm_printed)ÚprintedÚexpectedz(21,914)z-21914z(0.02)z-0.02ú
$ (10,550)z-10550z	$(10,550)z$14.47z14.47z	1,234,567Ú1234567ú92.6%z92.6ú6.7 %ú6.7z65%Ú65z4.6xz4.6z$1.2 millionz1.2z$241.4Mz241.4z3.1bnz3.1z-4.5%z-4.5c                 ó¼  • [        U 5      o"U:H  o3(       GdC  [        R                  " SU4SX!45      S[        R                  " 5       ;   d  [        R
                  " [         5      (       a  [        R                  " [         5      OSS[        R                  " 5       ;   d  [        R
                  " U 5      (       a  [        R                  " U 5      OS[        R                  " U5      S[        R                  " 5       ;   d  [        R
                  " U5      (       a  [        R                  " U5      OSS.-  nSSU0-  n[        [        R                  " U5      5      eS =p#g )	N©ú==)z0%(py3)s
{%(py3)s = %(py0)s(%(py1)s)
} == %(py5)sr   r   r   ©Úpy0Úpy1Úpy3Úpy5úassert %(py7)sÚpy7©	r   Ú
@pytest_arÚ_call_reprcompareÚ@py_builtinsÚlocalsÚ_should_repr_global_nameÚ	_safereprÚAssertionErrorÚ_format_explanation©r   r   Ú@py_assert2Ú@py_assert4Ú@py_format6Ú@py_format8s         Ú7/home/mande/repo/quber/tests/playground/test_figures.pyÚtest_as_numberr(      sª   € ô6 �WÓÐ) Ñ)×)×)×)Ó)Ð×)×)×)×)×)Õ)Œ9×)×)×)Ñ)Œ9×)×)×)×)×)Ö)�W×)×)×)Ñ)�W×)×)Õ)Ð×)×)×)×)×)Ô) ×)×)×)Ñ) ×)×)×)×)×)×)Ô)ó    r   )Ú Nzn/au   â€”znot disclosedÚUSDz1-2c                 óV  • [        U 5      nS o!UL o3(       Gd  [        R                  " SU4SX45      S[        R                  " 5       ;   d  [        R
                  " [         5      (       a  [        R                  " [         5      OSS[        R                  " 5       ;   d  [        R
                  " U 5      (       a  [        R                  " U 5      OS[        R                  " U5      [        R                  " U5      S.-  nSSU0-  n[        [        R                  " U5      5      eS =n=p2g )N©Úis)z0%(py3)s
{%(py3)s = %(py0)s(%(py1)s)
} is %(py6)sr   r   )r   r   r   Úpy6zassert %(py8)sÚpy8r   )r   r#   Ú@py_assert5r$   Ú@py_format7Ú@py_format9s         r'   Ú2test_non_numeric_returns_none_rather_than_guessingr4   *   s–   € ä�WÓÐ% Ð% Ð%×%×%×%Ó%Ð×%×%×%×%×%Õ%Œ9×%×%×%Ñ%Œ9×%×%×%×%×%Ö%�W×%×%×%Ñ%�W×%×%Õ%Ð×%×%Ó% ×%×%×%×%×%×%Ô%r)   c                  óà  • Sn [        U 5      nSo!U:H  o3(       d×  [        R                  " SU4SX45      S[        R                  " 5       ;   d  [        R
                  " [         5      (       a  [        R                  " [         5      OS[        R                  " U 5      [        R                  " U5      [        R                  " U5      S.-  nSSU0-  n[        [        R                  " U5      5      eS =n =n=p2S n [        U 5      nS	o!U:H  o3(       d×  [        R                  " SU4SX45      S[        R                  " 5       ;   d  [        R
                  " [         5      (       a  [        R                  " [         5      OS[        R                  " U 5      [        R                  " U5      [        R                  " U5      S.-  nSSU0-  n[        [        R                  " U5      5      eS =n =n=p2g )
Nz  $ (10,550)
r	   r   )z0%(py4)s
{%(py4)s = %(py0)s(%(py2)s)
} == %(py7)sr   )r   Úpy2Úpy4r   zassert %(py9)sÚpy9r*   )	r   r   r   r   r   r   r   r    r!   )Ú@py_assert1Ú@py_assert3Ú@py_assert6r1   r&   Ú@py_format10s         r'   Ú&test_norm_printed_collapses_whitespacer=   /   s  € Ø(Ð9Œ<Ð(Ó)Ð9¨\Ð9¨\Ñ9×9×9×9Ò9Ð)×9×9×9×9×9Õ9Œ<×9×9×9Ñ9Œ<×9×9Õ9Ð(×9×9Ó9Ð)×9×9Ó9¨\×9×9×9×9×9×9Õ9ØÐ#Œ<˜ÓÐ# Ð# Ñ#×#×#×#Ò#Ð×#×#×#×#×#Õ#Œ<×#×#×#Ñ#Œ<×#×#Õ#˜×#×#Ó#Ð×#×#Ó# ×#×#×#×#×#×#Ö#r)   ))r   T)r   T)r   F)r*   F)NFc                 óº  • [        U 5      o"UL o3(       GdC  [        R                  " SU4SX!45      S[        R                  " 5       ;   d  [        R
                  " [         5      (       a  [        R                  " [         5      OSS[        R                  " 5       ;   d  [        R
                  " U 5      (       a  [        R                  " U 5      OS[        R                  " U5      S[        R                  " 5       ;   d  [        R
                  " U5      (       a  [        R                  " U5      OSS.-  nSSU0-  n[        [        R                  " U5      5      eS =p#g )	Nr-   )z0%(py3)s
{%(py3)s = %(py0)s(%(py1)s)
} is %(py5)sr   r   r   r   r   r   )	r   r   r   r   r   r   r   r    r!   r"   s         r'   Ú,test_is_percent_reads_notation_not_magnituder?   4   sª   € ô
 �gÓÐ* (Ð*×*×*×*Ó*Ð×*×*×*×*×*Õ*Œ:×*×*×*Ñ*Œ:×*×*×*×*×*Ö*�g×*×*×*Ñ*�g×*×*Õ*Ð×*×*×*×*×*Ô* (×*×*×*Ñ* (×*×*×*×*×*×*Ô*r)   )Ú__doc__Úbuiltinsr   Ú_pytest.assertion.rewriteÚ	assertionÚrewriter   Údecimalr   ÚpytestÚ quber.playground.answers.figuresr   r   r   ÚmarkÚparametrizer(   r4   r=   r?   © r)   r'   Ú<module>rK      sQ  ðñC÷ „ Õ ã ç PÑ Pð ‡�×ÑØð 
‘W˜XÓ&Ð'Ø	‘7˜7Ó#Ð$ð 
‘w˜xÓ(Ð)Ø	‘g˜hÓ'Ð(à	‘7˜7Ó#Ð$Ø	‘g˜iÓ(Ð)à	‘'˜&“/Ð"Ø	‘'˜%“.Ð!Ø	‘˜“Ðà	‘˜“Ð Ø	™ ›Ð(Ø	‘G˜GÓ$Ð%Ø	‘'˜%“.Ð!à	‘'˜&“/Ð"ð+óñ4*ó5ð4*ð ‡�×Ñ˜Ò$[Ó\ñ&ó ]ð&ò$ð
 ‡�×ÑØÚRóñ+ó	ñ+r)   