@@ -32,7 +32,6 @@ use crate::TskReturnValue;
32
32
use crate :: { EdgeId , NodeId } ;
33
33
use ll_bindings:: tsk_id_t;
34
34
use ll_bindings:: tsk_size_t;
35
- use streaming_iterator:: StreamingIterator ;
36
35
37
36
/// A table collection.
38
37
///
@@ -1389,30 +1388,29 @@ impl TableCollection {
1389
1388
///
1390
1389
/// # Example
1391
1390
/// ```rust
1392
- /// # use tskit::test_data::simulation::simulate_two_treesequences;
1393
- /// # let intervals = vec![(10.0, 20.0), (700.0, 850.0)];
1391
+ /// # use tskit::*;
1392
+ /// # let snode = NodeFlags::new_sample();
1393
+ /// # let anode = NodeFlags::default();
1394
+ /// # let pop = PopulationId::NULL;
1395
+ /// # let ind = IndividualId::NULL;
1394
1396
/// # let seqlen = 100.0;
1395
- /// # let popsize = 100;
1396
- /// # let totle_generations = 50;
1397
- /// # let popsplit_time = 10;
1398
- /// # let seed = 123;
1399
-
1400
- /// # let (full_trees, _exepected) = simulate_two_treesequences(
1401
- /// # seqlen,
1402
- /// # popsize,
1403
- /// # totle_generations,
1404
- /// # popsplit_time,
1405
- /// # &intervals,
1406
- /// # seed,
1407
- /// # )
1408
- /// # .unwrap();
1409
- /// #
1410
- /// # let tables = full_trees.dump_tables().unwrap();
1411
- ///
1412
- /// let _trucated_tables = tables
1413
- /// .keep_intervals(intervals.iter().map(|a| *a), true)
1414
- /// .unwrap()
1415
- /// .unwrap();
1397
+ /// # let (t0, t10) = (0.0, 10.0);
1398
+ /// # let (left, right) = (0.0, 100.0);
1399
+ /// # let sim_opts = SimplificationOptions::default();
1400
+ ///
1401
+ /// # let mut tables = TableCollection::new(seqlen).unwrap();
1402
+ /// # let child1 = tables.add_node(snode, t0, pop, ind).unwrap();
1403
+ /// # let child2 = tables.add_node(snode, t0, pop, ind).unwrap();
1404
+ /// # let parent = tables.add_node(anode, t10, pop, ind).unwrap();
1405
+ ///
1406
+ /// # tables.add_edge(left, right, parent, child1).unwrap();
1407
+ /// # tables.add_edge(left, right, parent, child2).unwrap();
1408
+ /// # tables.full_sort(TableSortOptions::all()).unwrap();
1409
+ /// # tables.simplify(&[child1, child2], sim_opts, false).unwrap();
1410
+ /// # tables.build_index().unwrap();
1411
+ ///
1412
+ /// let intervals = [(0.0, 10.0), (90.0, 100.0)].into_iter();
1413
+ /// tables.keep_intervals(intervals, true).unwrap().unwrap();
1416
1414
/// ```
1417
1415
///
1418
1416
/// Note that no new provenance will be appended.
@@ -1424,6 +1422,7 @@ impl TableCollection {
1424
1422
where
1425
1423
P : Into < Position > ,
1426
1424
{
1425
+ use streaming_iterator:: StreamingIterator ;
1427
1426
let mut tables = self ;
1428
1427
// use tables from sys to allow easier process with metadata
1429
1428
let options = 0 ;
0 commit comments