CoolFace
Apppublic

bailing1961/asx-equity-analyst

sourceHugging Faceupdated 3mo agoView on Hugging Face
0likes
render.cpython-311.pyc32 linesDownload Raw Back to __pycache__
1�

2�8j��b�dZddlmZdddd�Zdd	�Zdd�Zdd
�Zdd�Zdd�Zdd�Z	dd�Z3dd�ZdS)a=Pure display helpers for the Space. Takes a Result dict (from src.api.analyze4or a fixture) and returns HTML. NO business logic, NO calculation -- every number5is read straight from the Result. The three outcomes are rendered by EXPLICIT6match on PASS / FAIL / STOPPED; a STOPPED view shows the reason and NO number.7�)�annotations)z#0f5132z#d1e7dd)z#842029z#f8d7da)z#41506bz#e2e8f0)�PASS�FAIL�STOPPED�return�strc��|�dn|d�S)Nzn/az+.2%�)�xs �I:\asx-analyst\space\render.py�pctr
s���I�5�5�a�;�;�.��r�dictc��|d}t�|td��\}}|dkr&dt|ddd���d�}n|d	krd8}nd}d|�d
|�d|d�d|�d|�d�S)N�outcomerrzgrossed-up TSR �numbers�grossed_up_tsr�valuez &middot; verification PASSEDrz+numbers shown but DID NOT PASS VERIFICATIONz+no number produced &mdash; see reason belowz<<div style='padding:14px 16px;border-radius:10px;background:z;color:z#;font-size:1.15em;font-weight:700'>�tickerz &nbsp;[z&]&nbsp; <span style='font-weight:500'>z
</span></div>)�_STYLE�getr
)r�o�fg�bg�subs     r�banner_htmlrs���	�)��A�
�Z�Z��6�)�,�
-�
-�F�B���F�{�{�.��Q�y�\�2B�%C�G�%L�!M�!M�.�.�.���	9�f���;���;��
R�2�
R�
R��
R�
R�<=�h�K�
R�
R��
R�
R�?B�
R�
R�
R�Src��d|d�d�S)z2The STOPPED view: reason only, no number anywhere.z�<div style='padding:14px;border-radius:10px;background:#e2e8f0;color:#41506b'><b>STOPPED &mdash; no trustworthy number could be produced.</b><br>Reason: �reasonza<br><span style='color:#555'>The system reports this instead of fabricating a value.</span></div>r10�rs r�stopped_htmlr!#s"��
0�()�(��
0�
0�
0�1rc	��|ddkrdS|d}|d}d�d�|dD����}dt|d	���d11|d�d|�d
�}dt|dd���dt|dd���dt|dd���d�}d|�|�d�S)zJNaive (price-only, FAIL) vs verified (cash / grossed-up, PASS). PASS only.rr�r�naivec3�"K�|]12}d|�d�V��dS)z<li>�</li>Nr13)�.0rs  r�	<genexpr>z"comparison_html.<locals>.<genexpr>2s*����D�D�A��q����D�D�D�D�D�Dr�	omissionsz�<div style='flex:1;padding:14px;border:2px solid #b91c1c;border-radius:10px;background:#fff5f5'><h3 style='margin:0;color:#842029'>Naive (typical tool) &mdash; FAIL</h3><p style='font-size:1.7em;font-weight:700;color:#842029;margin:6px 0'>�14price_onlyz#</p><p style='margin:0;color:#555'>�labelzX</p><p style='margin:8px 0 2px;font-weight:600'>Silently omits:</p><ul style='margin:0'>�</ul></div>z�<div style='flex:1;padding:14px;border:2px solid #0f5132;border-radius:10px;background:#f3faf6'><h3 style='margin:0;color:#0f5132'>Verified &mdash; PASS</h3><p style='margin:6px 0'><span style='font-size:1.5em;font-weight:700;color:#0f5132'>rrz$</span> grossed-up &nbsp;/&nbsp; <b>�cash_tsrzG</b> cash</p><p style='margin:0;color:#555'>price-only would have been �price_returnzX &mdash; the rest is dividends, franking credits, and in-specie distributions.</p></div>z#<div style='display:flex;gap:14px'>z</div>)�joinr
)r�nr$r)�left�rights      r�comparison_htmlr3,s%����|�v����r�	�)��A�
�g�J�E����D�D��{�1C�D�D�D�D�D�I�	7��u�\�"�#�#�		7�	7�15+0��.�	7�	7�!*�	7�	7�	7�	�	:��a� 0�1�'�:�;�;�	:�	:� ��*�
�g� 6�7�7�		:�	:��q�� ��)�*�*�
	:�	:�	:�16�E��D�u�D�D�D�Dr�itc�x�|ddkrd|d�d�Sd|�dd���d	|d�d�S)17N�status�OKz#<li style='color:#0f5132'>&#10003; �textr&z$<li style='color:#b91c1c'>&#10007; [�severityr#z] �r)r4s r�	_log_itemr;JsQ��	�(�|�t���F�R��Z�F�F�F�F�]�"�&�&��R�2H�2H�]�]�B�v�J�]�]�]�]rc18��|ddkrd|d�d�S|d}d|drd	nd19�d|drd	nd20�d
|drd	nd21�d�}g}|dD]R}d�d�|dD����}|�d|d�d|d�d|�d����S|d�|��zS)Nrrz><p>No verification &mdash; no number was produced.<br>Reason: rz</p>�verificationz<p>symbolic: <b>�passedrrz</b> &middot; statistical: <b>�statisticalz</b> &middot; consistency: <b>�consistencyz</b></p>�logr#c3�4K�|]}t|��V��dS)N)r;)r'r4s  rr(z(verification_log_html.<locals>.<genexpr>Zs(����=�=�"�	�"�
�
�=�=�=�=�=�=r�itemsz<div style='margin:6px 0'><b>�dim� �titlez</b><ul style='margin:2px 0'>r,)r/�append)r�v�head�blocksrDrCs      r�verification_log_htmlrKPsQ����|�y� � �-��X�;�-�-�-�	.�	�.��A�
P��8��@�v�v�&�
P�
P�)*�=�)9�E�v�v�v�
P�
P�)*�=�)9�E�v�v�v�
P�
P�
P�D��F���x�F�F�����=�=��G��=�=�=�=�=���
�
�E�c�%�j�E�E�3�w�<�E�E�27�E�E�E�	F�	F�	F�	F��"�'�'�&�/�/�!�!rc�|�|ddkrdSd}|dD]D}|d|d�d|d	�d22|dd�d23|d
dzd�d|dd�d|d�d�
z
}�Ed|pd�d�}d}|�d��r<|d}d|d�d|dd�d|dd�d |d!d�d"|dd�d#�}||zS)$Nrrz5<p>No audit trail &mdash; no number was produced.</p>r#�
distributionsz<tr><td>�typez	</td><td>�ex_datez"</td><td style='text-align:right'>�per_share_valuez.4f�franking_pct�dz.0fz#%</td><td style='text-align:right'>�franking_creditz"</td><td style='font-size:0.85em'>�sourcez24</td></tr>z�<table style='width:100%;border-collapse:collapse' border='1' cellpadding='4'><thead><tr><th>type</th><th>ex-date</th><th>per share</th><th>franked</th><th>credit</th><th>source</th></tr></thead><tbody>z.<tr><td colspan=6>(no distributions)</td></tr>z</tbody></table>�buybackzc<p style='margin-top:10px'><b>Off-market buy-back (disclosed; NOT in the buy-and-hold TSR):</b><br>�datez: $�
buyback_pricez.2fz/sh = $�capital_componentz capital + $�dividend_componentz! fully franked dividend (credit $z*); received by tendering holders only.</p>r:)r�rows�d�table�bb�bs      r�25audit_htmlr_`s�����|�y� � �F�F�
�D�
��
�J�J���I�A�f�I�I�I��)��I�I�12�3D�1E�P�I�I�12�>�1B�S�1H�T�I�I�23�3D�1E�P�I�I�23�8��	I�I�I�	J���	]��J�J�	]�	]�	]�26�27�B��u�u�Y���`�
�i�L��_��6��_�_� ��1�[�_�_�>?�@S�>T�[�_�_��2�3�Q�_�_��-�.�^�	_�_�_��28�2�:�rc�.�|�dd��S)zGThe deterministic five-section report (or the STOPPED text). Monospace.�rendered_reportr#r:r s r�report_textrb{s���5�5�"�B�'�'�'rN)rr)rrrr)r4rrr)�__doc__�29__future__rrr
rr!r3r;rKr_rbr30rr�<module>res�����#�"�"�"�"�"�
#�"�%�31�32��/�/�/�/�S�S�S�S�1�1�1�1�E�E�E�E�<^�^�^�^�
"�
"�
"�
"� ����6(�(�(�(�(�(r