# guide_runs

Python reference for `nagasim.appearance.guide_runs`. Provisional: it may change between minor versions, see [Appearance](../../appearance.md).

`nagasim.appearance.guide_runs`

```python
guide_runs(length: float, openings: Sequence[Mapping], side: str)
```

The stretches of one side guide that stand: [0, *length*] minus that side's openings.

Parameters
----------
length : float
    The piece's length, in the openings' unit (metres for `look_of`'s openings).
openings : sequence of mapping
    `{"side", "start", "end"}` gaps, as `look_of` and `exit_openings` give them; one whose
    side is *side* or `both` cuts the guide.
side : str
    `left` or `right`, seen along the travel.

Returns
-------
list of (float, float)
    (start, end) runs in order; a run of 1e-9 or less is dropped.

See Also
--------
nagasim.appearance.look_of : The stored openings, in metres.
nagasim.appearance.exit_openings : The openings the exits cut.
nagasim.appearance.piece_length_m : The piece's length in metres.

Examples
--------
>>> from nagasim.appearance import guide_runs
>>> guide_runs(2.0, [{"side": "left", "start": 0.5, "end": 0.9}], "left")
[(0.0, 0.5), (0.9, 2.0)]
