Function demes::loads

source · []
pub fn loads(yaml: &str) -> Result<Graph, DemesError>
Expand description

Build a Graph from an in-memory str.

Errors

Returns DemesError in the event of invalid input.

Examples

let yaml = "
time_units: generations
demes:
 - name: ancestor
   epochs:
    - start_size: 100
 - name: derived
   start_time: 50
   ancestors: [ancestor]
   epochs:
    - start_size: 10
";

let graph = demes::loads(yaml).unwrap();