Examples

The pyrat/src/pyrat/examples subdirectory contains Python examples. Most are translations of the original Rat C++ examples defined across the Project-Rat repositories.

The wheel ships them, and the pyrat command generates them into the current directory to quickly get started:

pyrat -e                # list the examples
pyrat -e rat-template   # generate examples/rat/rat-template/rat_template.py

pyrat -e also takes directories, all and glob patterns: see the CLI section of Module pyrat for every pattern and the layout of the generated examples directory.

Examples come with the input files they read (CSV tables, JSON geometries), placed relative to them: run them from their own directory.

cd examples/rat/rat-template
python rat_template.py