rust_physics_engine 0.2.0

A zero-dependency Rust library for physics, mathematics and engineering computation — 6,365 public functions across 71 modules
Documentation
�

�U�j�/���UdZddlmZddlZddlZddlZdZdZdgd�fdgd	�fd
gd�fdgd
�fdgd�fdgd�fdgd�fdgd�fddgfdgd�fdddgfdgd�fdd d!gfd"gd#�fd$gd%�fd&gd'�fgZd(e	d)<ej
d*��Zej
d+��Zej
d,��Z
d;d1�Zd<d3�Zd=d5�Zd>d7�Zd?d9�Zed:kreje����dSdS)@aGenerate docs/MODULE_MAP.md from the source tree.

The map is generated rather than written by hand so that it cannot drift
out of date: `--check` re-derives it and fails if the committed file
differs, which is what CI runs.

Every figure in the output comes from parsing the sources -- module
summary from the first `//!` line, counts of public items, lines of
code. Nothing is transcribed.

    python3 tools/gen_module_map.py            # rewrite docs/MODULE_MAP.md
    python3 tools/gen_module_map.py --check    # exit 1 if it is stale
�)�annotationsN�srczdocs/MODULE_MAP.mdzNumeric foundations)�core�math�linalg�	numerical�special�errorzExact and symbolic)�exact�discrete�graph�codeszClassical mechanics)�	classical�gravitation�solid_mechanics�continuum_mechanics�	resonance�
geophysicszThermal and statistical)�thermodynamics�statistical_mechanics�	radiation�Electromagnetism)�electromagnetism�electronics�rf�	photonics�plasma�magnetohydrodynamicszWaves and signals)�waves�optics�	acoustics�
transforms�dsp�signal_processing�audio�Fluids)�fluids�cfd�fluid_instabilities�
propulsionzModern physics)�
relativity�general_relativity�quantum�particle_physics�nuclear�
neutronics�Space�astrophysicszPDE solvers)�fem�sim�fields�vector_calculuszChemistry and life�	chemistry�
biophysicszProbability and data)�
statistics�
stochastic�monte_carlo�information_theory�learn�	Decisions�optimization�finance�Geometry)�geometry�curves�trigonometry�
quaternion�manifold�spatial�meshzPatterns and chaos)�fractals�patterns�	nonlinearzReference and utility)�units�	materials�
color_science�control_systems�
atmosphere�verificationzlist[tuple[str, list[str]]]�AREASz)pub (?:const |async |unsafe |extern )*fn zpub (?:struct|enum|trait) z(?:unsafe\s+)?impl[\s<]�path�str�return�dictc��dx}x}}d}d}g}d}g}d}	d}
t|dd���5}|D�]�}|
dz
}
|���}
|	rg|
�d��r9|
d	d����}|r|�|��n|rd
}	n|
r|
�d��sd
}	|�|
�d��r|}|r.||d
kr"|���|r||d
k�"|�Ft
�|
��r
|r|dz
}n|dz
}t�|
��r|dz
}|�t�|
��r|}||�	d��|�	d��z
z
}|�5||kr|�|��d}n|
�
d��rd}|�||krd}���	ddd��n#1swxYwYd�|��}tjd|��}|r|�
d��}|�dd��}t|��dkr'|dd��dd��ddz}||||
|pdd�S)aKPublic item counts, line count and summary for one source file.

    Three things this has to get right, each of which it got wrong first:

    * **Methods against free functions** are told apart by the enclosing
      `impl` block, not by indentation. An indented `pub fn` inside
      `pub mod presets { ... }` is a free function, and there are 98 of
      those; counting indentation put every one of them in the wrong
      column.
    * **Public types** are matched on the stripped line, so a `pub enum`
      inside an inline `pub mod` is counted rather than skipped.
    * **Test items** are skipped by tracking brace depth from
      `#[cfg(test)]`, so a test helper never inflates the public surface.

    The count is syntactic: a type generated by a macro is counted once
    where the macro defines it, not once per expansion.
    rNT�utf-8�replace)�encoding�errors�z//!�Fz#![z#[cfg(test)]������{�}�;� z(.+?[.!?])(?:\s|$)�|z\|��u…�—)�free�meth�types�lines�summary)�open�strip�
startswith�append�pop�PUB_FN�match�PUB_TYPE�
IMPL_START�count�endswith�join�re�grouprY�len�rsplit)rSrgrhri�depth�
test_depth�
impl_stack�pending_impl�
summary_parts�
in_summary�total�fh�line�stripped�textrkrrs                 �4/home/user/RustPhysicsEngine/tools/gen_module_map.py�scanr�:sI��$��D��4�%�
�E�!�J��J�#�L�!�M��J�
�E�	
�d�W�Y�	7�	7�	7�+"�2��*	"�*	"�D��Q�J�E��z�z�|�|�H��
'��&�&�u�-�-�'�#�A�B�B�<�-�-�/�/�D��+�%�,�,�T�2�2�2�2�&�+�%*�
���'�h�&9�&9�%�&@�&@�'�!&�J��!�h�&9�&9�.�&I�&I�!�"�
��
!��*�R�.�!8�!8���� � � ��
!��*�R�.�!8�!8��!��<�<��)�)�"�!�"���	�����	���>�>�(�+�+���Q�J�E��#�
�(8�(8��(B�(B�#�$���T�Z�Z��_�_�t�z�z�#���6�6�E��'��<�'�'��%�%�l�3�3�3�#'�L�L��&�&�s�+�+�(�#'�L��%�%�:�*=�*=�!�
��U*	"�+"�+"�+"�+"�+"�+"�+"�+"�+"�+"�+"����+"�+"�+"�+"�Z�h�h�}�%�%�G��H�*�G�4�4�E��!��+�+�a�.�.���o�o�c�5�)�)�G�
�7�|�|�c����$�3�$�-�&�&�s�A�.�.�q�1�E�9���$���w�'7�%�9�9�9s�F(G�G �#G �set[str]c��t��}ttj�t
d��d���5}|D]f}|�d��rO|�|���td��d��
d�����g	ddd��n#1swxYwY|S)z�Top-level modules declared `pub mod` in lib.rs.

    `verification` is declared as a bare `mod`, so it is compiled and
    tested but not part of the public API. Counting it as a public module
    would make the totals here disagree with the README.
    �lib.rsrX�rZzpub mod Nra)�setrl�osrSrw�SRCrn�addrmrz�rstrip)�outr�r�s   r��public_top_levelsr��s����%�%�C�	
�b�g�l�l�3��)�)�G�	<�	<�	<�D���	D�	D�D����z�*�*�
D�����
�
���S��_�_�%5�%5�6�=�=�c�B�B�C�C�C��	D�D�D�D�D�D�D�D�D�D�D�D����D�D�D�D��Js�A*B:�:B>�B>�dict[str, dict]c���i}tjt��D]�\}}}t|��D]�}|�d��s�tj�||��}tj�|t��}|dd��tj	d��}|�d��r
|dd�}t|��||d�z||<����|S)z1Every source file, keyed by its Rust module path.�.rsN������::z::mod�����)rS�rel)r��walkr��sortedrvrSrw�relpathrY�sepr�)r��root�_dirs�files�namerSr��mods        r��collectr��s���
�C� �g�c�l�l�	?�	?���e�U��5�M�M�	?�	?�D��=�=��'�'�
���7�<�<��d�+�+�D��'�/�/�$��,�,�C��c�r�c�(�"�"�2�6�4�0�0�C��|�|�G�$�$�
��#�2�#�h���D�z�z�T�#�$>�$>�>�C��H�H�	?��J��modsc����� �!�"�td��D�����"t��� � fd��"D��}d�tD��}tdtt�"��|z
��fgz}t	d�����D����}t	d�����D����}t	d�����D����}t	d�����D����}g}|�d	��|�d
��|�d��|�d��|�d
��|�d
��|�d��|�d��|�d��|�d
��|�d��|�d��|�d��|�d
��|�dt���dz
�dt� ���d|d�dt����d|d�d|d�d|d�d���|rLd�d�|D����}	|�d
��|�|	�d ���|�d
��|�d!��|�d
��|�d��|�d"d#�d$d%����|�d&d'd(��d)d$d*�d+���t�"��D�]T\}
�!t�!fd,��D����}|
t�"��dz
k}|rd-nd&}
�!� vrd
nd.}|r߉�
�!��}t	�fd/�|D����|r|d$nd0z}|�|
��!d1zd(�|d*�|����|rd2nd3}t|��D]h\}}|�d4��d5}|t|��dz
krd-nd&}|�|�|�|d6zd7��|d$d*�����i��&|�|
��!d6zd(���!d$d*�|������V|�d��|�d
��|�d8��|�d
��|D�]0\}}	�"fd9�|	D��}|s�|�d:|����|�d
��|�d;��|�d<��|D]��t�fd=��D����}t	�fd>�|D����}t	�fd?�|D����}t	�fd@�|D����}��vr��dAndB}|�dC��dD|d�dE|d�dE|d�dE|�dF�����|�d
����2|�dG��|�d
��|�dH��|�dI��t���D]a}|d)kr�	�|}|�dJ|dK�dL|�dM|d$d�dE|dN�dE|dO�dE|dP�dE|dA�dF����b|�d
��dQ�|��S)RNc�P�h|]#}|dk�|�d��d��$S)�libr�r)�split��.0�ms  r��	<setcomp>zrender.<locals>.<setcomp>�s,��@�@�@��Q�%�Z�Z�1�7�7�4�=�=��#�Z�Z�Zr�c���g|]}|�v�|��	S�r�)r��t�publics  �r��
<listcomp>zrender.<locals>.<listcomp>�s���2�2�2�Q�!�6�/�/�q�/�/�/r�c�"�h|]\}}|D]}|���
Sr�r�)r��_�names�ns    r�r�zrender.<locals>.<setcomp>�s)��4�4�4�8�1�e�e�4�4��Q�4�4�4�4r��Otherc3�&K�|]}|dV��
dS�rjNr�r�s  r��	<genexpr>zrender.<locals>.<genexpr>��&����8�8�Q�a��j�8�8�8�8�8�8r�c3�&K�|]}|dV��
dS)rgNr�r�s  r�r�zrender.<locals>.<genexpr>��&����6�6�1�Q�v�Y�6�6�6�6�6�6r�c3�&K�|]}|dV��
dS)rhNr�r�s  r�r�zrender.<locals>.<genexpr>�r�r�c3�&K�|]}|dV��
dS�riNr�r�s  r�r�zrender.<locals>.<genexpr>�r�r�z# Module map�u/**Generated file — do not edit.** Produced byzG[`tools/gen_module_map.py`](../tools/gen_module_map.py) from the sourcez5tree; CI fails if it is out of date. Regenerate with:z```bashzpython3 tools/gen_module_map.pyz```zFEvery figure below is parsed from the sources. Summaries are the firstzIsentence of each module's `//!` documentation. Public-item counts excludezanything inside `#[cfg(test)]`.z**r\z modules** across **z public top-level modules**, **�,z lines** in **z; files** (the modules plus the crate root `src/lib.rs`), **z public functions** and **z public methods**, **z public types**.z, c3�"K�|]
}d|�d�V��dS)�`Nr�)r��ps  r�r�zrender.<locals>.<genexpr>�s*����4�4�q�(�a�(�(�(�4�4�4�4�4�4r�z� is compiled and tested but declared `mod` rather than `pub mod`, so it is not part of the public API and is excluded from the module count above.z## Treezsrc/z                            rjz>8u
├── r�z<28r�z>8,z   (crate root)c3�L�K�|]}|��dz���|V��dS)r�N�rn)r�r��tops  �r�r�zrender.<locals>.<genexpr>�s8�����F�F��Q�\�\�#��*�-E�-E�F�!�F�F�F�F�F�Fr�u
└── z   (private)c3�4�K�|]}�|dV��dSr�r�)r��cr�s  �r�r�zrender.<locals>.<genexpr>�s,�����7�7��D��G�G�$�7�7�7�7�7�7r�r�/z    u│   r�r^r�z<24z
## By areac���g|]}|�v�|��	Sr�r�)r�r��topss  �r�r�zrender.<locals>.<listcomp>�s���1�1�1��q�D�y�y�1�y�y�yr�z### z4| Module | Lines | Public fns | Types | What it is |z|---|--:|--:|--:|---|c3�d�K�|]*}|dk�|�ks|��dz���&|V��+dS)r�r�Nr�)r�r�r�s  �r�r�zrender.<locals>.<genexpr>�sT�����V�V���%�Z�Z�Q�$�Y�Y�!�,�,�t�d�{�:S�:S�Y��-6�Y�Y�Y�V�Vr�c3�4�K�|]}�|dV��dSr�r��r��sr�s  �r�r�zrender.<locals>.<genexpr>��,�����7�7�Q��Q���(�7�7�7�7�7�7r�c3�R�K�|]!}�|d�|dzV��"dS)rgrhNr�r�s  �r�r�zrender.<locals>.<genexpr>�s8�����F�F�A�d�1�g�f�o��Q����7�F�F�F�F�F�Fr�c3�4�K�|]}�|dV��dSr�r�r�s  �r�r�zrender.<locals>.<genexpr>�r�r�rkrfz| **`z`** | z | z |z## Every modulez;| Path | Module | Lines | Fns | Methods | Types | Summary |z|---|---|--:|--:|--:|--:|---|z| `r�z` | `z` | rgrhri�
)r�r�rRr��sum�valuesrorzrw�	enumerate�getr�)#r��private�named�areas�total_lines�
total_free�
total_meth�total_types�Lr��i�children�last_top�stem�tag�ownr��pad�j�child�leaf�cstem�area�present�subsrj�fnsrirkr�r�r�r�r�r�s#`                              @@@@r��renderr��s���������@�@�T�@�@�@�A�A�D�
�
 �
 �F�2�2�2�2�$�2�2�2�G�4�4�u�4�4�4�E��g�v�c�$�i�i�%�&7�8�8�9�:�:�E��8�8�$�+�+�-�-�8�8�8�8�8�K��6�6����
�
�6�6�6�6�6�J��6�6����
�
�6�6�6�6�6�J��8�8�$�+�+�-�-�8�8�8�8�8�K��A��H�H�^�����H�H�R�L�L�L��H�H�
>�?�?�?��H�H�
V�W�W�W��H�H�
D�E�E�E��H�H�R�L�L�L��H�H�Y�����H�H�
.�/�/�/��H�H�U�O�O�O��H�H�R�L�L�L��H�H�
U�V�V�V��H�H�
X�Y�Y�Y��H�H�
.�/�/�/��H�H�R�L�L�L��H�H�2�#�d�)�)�a�-�2�2�S��[�[�2�2�(�
8�2�2��d�)�)�2�2��
[�2�2�;E�
[�2�2��
1�	2�2�2�3�3�3�
�,��	�	�4�4�G�4�4�4�4�4��	�������	���E�+�+�+�	,�	,�	,��H�H�R�L�L�L��H�H�Y�����H�H�R�L�L�L��H�H�U�O�O�O��H�H�
*�H�
*�g�
*�
*�
*�+�+�+��H�H�
Q�(�
Q�
Q��U��G�(<�
Q�
Q�
Q�
Q�R�R�R��D�/�/�P�P���3��F�F�F�F�T�F�F�F�F�F����D�	�	�A�
�%��'�9�|�|�\���6�M�M�b�b�~���
	P��(�(�3�-�-�C��7�7�7�7�h�7�7�7�7�7�3�;U�3�w�<�<�TU�V�A�
�H�H��;�s�S�y�;�;�q�;�;�c�;�;�<�<�<�$�2�&�&�(�C�%�h�/�/�
X�
X���5��{�{�4�(�(��,��()�S��]�]�Q�->�(>�(>���L�����C�V��V����V�V�D��K��<P�V�V�V�W�W�W�W�
X�

�H�H��N�s�U�{�N�N��c��7�1C�N�N��N�N�O�O�O�O��H�H�U�O�O�O��H�H�R�L�L�L��H�H�\�����H�H�R�L�L�L������e�1�1�1�1�e�1�1�1���	��	����������	�������	���G�H�H�H�	���(�)�)�)��	X�	X�D��V�V�V�V�T�V�V�V�V�V�D��7�7�7�7�$�7�7�7�7�7�E��F�F�F�F��F�F�F�F�F�C��7�7�7�7�$�7�7�7�7�7�E�/3�t�|�|�d�4�j��+�+��G�
�H�H�V�T�V�V��V�V�V�S�V�V�V�u�V�V�V�7�V�V�V�W�W�W�W�	���������H�H�
�����H�H�R�L�L�L��H�H�
J�K�K�K��H�H�
,�-�-�-��d�|�|�E�E���%�<�<����I��	���D�q��x�D�D�c�D�D�q��z�L�D�D��&�	�D�D���i�D�D�$%�g�J�D�D�34�Y�<�D�D�D�	E�	E�	E�	E��H�H�R�L�L�L��9�9�Q�<�<�r��intc�N�tj�t��st	dt
j���dStt����}dt
j	v}tj�
t��r(ttd����
��nd}|rW||krt	t�d���dSt	t�d	t
j	d�d
�t
j���dStjtj�t��d�
��ttdd���5}|�|��ddd��n#1swxYwYt	dt����dS)Nzrun from the repository root)�file�z--checkrXr�z is up to dateru is STALE — run `python3 z` and commit the resultr\T)�exist_ok�wzwrote )r�rS�isdirr��print�sys�stderrr�r��argv�exists�OUTrl�read�makedirs�dirname�write)r��check�existingr�s    r��mainrs���
�7�=�=�����
�,�3�:�>�>�>�>��q��'�)�)���D����!�E�57�W�^�^�C�5H�5H�R�t�C�'�*�*�*�/�/�1�1�1�d�H����t����S�(�(�(�)�)�)��1�
��U�U���!��U�U�U��:�	�	�	�	��q��K������$�$�t�4�4�4�4�	
�c�3��	)�	)�	)��R�
�������������������������	�.�3�.�.�����1s�!F�F�
F�__main__)rSrTrUrV)rUr�)rUr�)r�r�rUrT)rUr�)�__doc__�
__future__rr�rxr�r�r�rR�__annotations__�compilerqrsrtr�r�r�r�r�__name__�exitr�r�r��<module>rso�����#�"�"�"�"�"�	�	�	�	�	�	�	�	�
�
�
�
�����
�W�W�W�X��B�B�B�C��O�O�O�P�� X� X� X�Y��<�<�<�=��9�9�9�:�
�E�E�E�F��E�E�E�F��~����?�?�?�@��K��6�7��=�=�=�>��>�9�-�.��%�%�%�&��@�@�@�A��P�P�P�Q�-&������4
���@�	A�	A���2�:�3�4�4��
�R�Z�2�
3�
3�
�Q9�Q9�Q9�Q9�h����
�
�
�
� b�b�b�b�J
�
�
�
�*�z����C�H�T�T�V�V�������r�