ferrotherm 0.25.1

Thermodynamic computing in pure Rust: sparse energy-based models, chromatic block-Gibbs, parallel tempering, thermodynamic linear algebra, stochastic differentiable programs, a variational compiler onto device topologies, exact inference by variable elimination, planted instances with known optima, sampler certificates, and a first-class joules ledger. std-only, zero dependencies, wasm-clean, deterministic by seed.
Documentation
�

x�jI�	��SrSSKrSSKJs Jr SSKrSSKrSSK	r	SSK
r
SSKr\
R"\
5RS5rS\\4SjrSr\R(R+S\"\"\"5555S\4Sj5rS	rg)
a�The README's own code blocks, executed.

`python/README.md` is what PyPI serves as this package's description, and it was a **verbatim copy
of the Rust README** -- `cargo add ferrotherm` and Rust code, shown to people who ran `pip install`.
It also still carried the uncompilable `joules` snippet that the Rust README had already been fixed
for, because the fix was applied in one place and the copy was forgotten.

A README nothing executes is a README that drifts. This runs every ```python block in it, so the
quickstart is checked the way `#[cfg(doctest)]` checks the Rust one.

Writing it caught two more: `magnetization` is a property and the draft called it as a method, and
`ledger()` does not exist -- the accessors are `node_updates` and `joules`.
�Nz	README.md�returnc�r�[R"S[R5[R5$)Nz```python\n(.*?)```)�re�findall�README�	read_text�S���Q/Users/dcharlot/vibe-coding/bmi-concept/research/ferrotherm/python/test_readme.py�_blocksr
s#��
�:�:�,�f�.>�.>�.@�"�$�$�G�Grc��[5n[U5nSo!U:�o3(Gd1[R"SU4SX45S[R
"5;d[R"[5(a[R"[5OSS[R
"5;d[R"U5(a[R"U5OS[R"U5[R"U5S.-n[R"S[U5S35S	-S
U0-n[[R"U55eS=n=p2g)N���>=)z0%(py3)s
{%(py3)s = %(py0)s(%(py1)s)
} >= %(py6)s�len�blocks)�py0�py1�py3�py6�only z1 python block(s); this would check almost nothingz
>assert %(py8)s�py8)r
r�
@pytest_ar�_call_reprcompare�@py_builtins�locals�_should_repr_global_name�	_saferepr�_format_assertmsg�AssertionError�_format_explanation)r�@py_assert2�@py_assert5�@py_assert4�@py_format7�@py_format9s      r�(test_the_readme_has_python_blocks_to_runr(s����Y�F��v�;�c�!�c�!��c�c�c�c�;�c�c�c�c�c�c�3�c�c�c�c�3�c�c�c�c�c�c�v�c�c�c�c�v�c�c�c�;�c�c�c�!�c�c�c�c�u�S��[�M�1b�c�c�c�c�c�c�c�cr�ic��[5Un0n[R"5n[R"U5 [[
USUS-S3S5U5 SSS5 UR5nUR5nSnUR5GH�nSU;aMU[U5:aXVOSnUS-
nS	U;aM.URS	S5SR5n	[R"S
U	RS5S5GH n
X�;o�(Gd[R"SU4S
X�45S[ R""5;d[R$"U
5(a[R&"U
5OSS[ R""5;d[R$"U5(a[R&"U5OSS.-n[R("SUS-SU
SUR5SU35S-SU0-n
[+[R,"U
55eSnGM# GM� g!,(df   GN�=f)a�Each block executes standalone, and any value it claims in a comment is a value it prints.

Running the blocks is only half of it. A block that runs while printing something other than the
number written beside it is still a lie, and the first version of this test could not see that:
it checked the Onsager figures against HARDCODED constants rather than against the README, so
editing the README could not fail it. Verified by reverting the README to the 16x16/500-sweep
parameters and watching it stay green.

So the claims are read out of the file. A trailing `# 0.9736` on a print line is a promise about
that line's output, and this holds the file to it.
zREADME.md[python block ��]�execNr�print(��#�
-?\d+\.\d+�--)�in)z%(py0)s in %(py2)s�token�here)r�py2zblock z claims z on this line:
    z
and that line printed:
    z
>assert %(py4)s�py4)r
�io�StringIO�
contextlib�redirect_stdoutr-�compile�getvalue�
splitlinesr�split�striprrrrrrrrr r!r")r)�src�ns�buf�out�printed�n�liner5�claimr4�@py_assert1�@py_format3�@py_format5s              r�0test_readme_block_runs_and_prints_what_it_claimsrL$s����)�A�,�C��B�
�+�+�-�C�	�	#�	#�C�	(��W�S�3�A��E�7�!�<�f�
E�r�J�
)�

�,�,�.�C��n�n��G�	�A���� ���4�����W��-�w�z�2��	�Q����d�?���
�
�3��"�1�%�+�+�-���Z�Z�
�u�{�{�4�/@��/C�D�E��=�
�
���
�5�
�
��v�
�
���
�5�
�
��I�
�5�
�
��v�
�
���
�D�
�
��I�
�D�
�
���
���Q���x��w�.B�4�:�:�<�.�Q/�/3�f�6�
�
�
���
�
�E�!�
)�	(�s�H9�9
Ic��Sn[5HrnUR5H[nSU;dMSU;dMU[[R"SURSS5SRS5S55-
nM] Mt So0U:�oD(d�[R"SU4S	X45S
[R"5;d[R"U5(a[R"U5OS
[R"U5S.-n[R"SUS
35S-SU0-n[[R"U55eS=pCg)zJA floor: if no block claims a number, the check above passes over nothing.rr.r0r1r+r2�r)z%(py0)s >= %(py3)s�claimed)rrrz9 numeric claim(s) in the README; nothing is being held toz
>assert %(py5)s�py5N)r
r>rrrr?rrrrrrr r!r")rOrArGr#rI�@py_format4�@py_format6s       r� test_the_claims_are_load_bearingrSQs����G��y���N�N�$�D��4��C�4�K��3�r�z�z�-����C��9K�A�9N�9T�9T�UY�9Z�[\�9]�^�_�_��%���c�a�<�c�c�c�c�7�c�c�c�c�c�c�7�c�c�c�c�7�c�c�c�a�c�c�c�c�5��	�)b�c�c�c�c�c�c�cr)�__doc__�builtinsr�_pytest.assertion.rewrite�	assertion�rewriterr:r8r�pathlib�pytest�Path�__file__�	with_namer�list�strr
r(�mark�parametrize�ranger�intrLrSr
rr�<module>rds�������	�	��
�	���h�	�	)�	)�+�	6��H��c��H�d�������e�C��	�N�3�4�)��)�5�)�Xdr