## with_stereo()


A new graph with each item at its site, replacing what was there.


Usage

``` python
with_stereo(g: MolGraph | StereoMolGraph, items: _LS = ()) -> StereoMolGraph
 
with_stereo(g: ReactionGraph | StereoReactionGraph, items: _LS | StereoChange = ()) -> StereoReactionGraph
```


An item is an LS or, for a reaction graph, a [StereoChange](StereoChange.md#protomol.StereoChange); in a reaction graph an LS and a change at one site replace each other. A [MolGraph](MolGraph.md#protomol.MolGraph) gives a [StereoMolGraph](StereoMolGraph.md#protomol.StereoMolGraph) and a [ReactionGraph](ReactionGraph.md#protomol.ReactionGraph) a [StereoReactionGraph](StereoReactionGraph.md#protomol.StereoReactionGraph).

``` python
>>> g = MolGraph(
...     symbols=["C", "F", "Cl", "Br", "H"], bonds=[(0, 1), (0, 2), (0, 3), (0, 4)]
... )
>>> new = with_stereo(g, Tetrahedral(atoms=(0, 1, 2, 3, 4), parity=1))
>>> type(new).__name__, len(new.atom_stereo)
```

('StereoMolGraph', 1)


## Raises


`TypeError`  
If an item is not an LS or a [StereoChange](StereoChange.md#protomol.StereoChange), or is a [StereoChange](StereoChange.md#protomol.StereoChange) for a molecule graph.

`ValueError`  
If the new graph is invalid (pydantic's `ValidationError`), for example with two items at one site.
