Examples ======== The `pyrat/src/pyrat/examples`_ subdirectory contains Python_ examples. These are translations from the original Rat C++ examples defined across the Project-Rat_ repositories. The pyRat_ Python_ module directly ships these Python_ examples through the ``pyrat`` CLI in order to quickly get started. - List all available examples: .. code-block:: bash python -m pyrat -e Examples can be generated from the list using patterns: - Generate examples from patterns: .. code-block:: bash python -m pyrat -e # list all available examples python -m pyrat -e moon # generate rat/dm/moon.py example python -m pyrat -e dmsh* # generate rat/mdl/dmesher/{dmshcoil.py, dmshyoke1.py, dmshyoke2.py} examples python -m pyrat -e mdl/** # generate all Rat-Models examples python -m pyrat -e rat-template # generate rat/rat-template/rat-template.py example python -m pyrat -e ** # generate all examples Examples will be stored under a generated ``./examples`` directory like so: .. code-block:: text examples/ ├── rat/ ├── dm/ ├── fmm/ ├── mat/ ├── mdl/ | ├── asbuild/ | ├── dmesher/ | ├── nlsolver/ | ├── other/ | ├── simple/ ├── rat-template/ - Run any example: .. code-block:: bash python examples/rat/rat-template/rat_template.py .. Links .. _Project-Rat: https://gitlab.com/project-rat .. _pybind11: https://github.com/pybind/pybind11 .. _pyRat: https://gitlab.com/project-rat-extras/pyrat .. _pyrat/src/pyrat/examples: https://gitlab.com/project-rat-extras/pyrat/-/tree/main/src/pyrat/examples?ref_type=heads .. _Python: https://www.python.org/ .. _Python wheels: https://pythonwheels.com/ .. _Python wheel: https://pythonwheels.com/ .. _Rat-Containers: https://gitlab.com/project-rat-extras/rat-containers .. _Rat-GUI: https://rat-gui.com/ .. _Rat-Models: https://gitlab.com/project-rat/rat-models .. _Rat-vcpkg: https://gitlab.com/project-rat-extras/rat-vcpkg .. _UV: https://github.com/astral-sh/uv