Skip to content

Commit 64d33e6

Browse files
committed
avoid exposing test code as public api
1 parent 0114d93 commit 64d33e6

File tree

7 files changed

+474
-465
lines changed

7 files changed

+474
-465
lines changed

Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ serde_json = {version = "1.0.117", optional = true}
2727
bincode = {version = "1.3.1", optional = true}
2828
tskit-derive = {version = "0.2.0", path = "tskit-derive", optional = true}
2929
delegate = "0.12.0"
30-
rand = "0.8.3"
3130

3231

3332
[dev-dependencies]

src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,5 +177,4 @@ mod tests {
177177
}
178178

179179
// Testing modules
180-
pub mod test_data;
181180
mod test_fixtures;

src/table_collection.rs

Lines changed: 23 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ use crate::TskReturnValue;
3232
use crate::{EdgeId, NodeId};
3333
use ll_bindings::tsk_id_t;
3434
use ll_bindings::tsk_size_t;
35-
use streaming_iterator::StreamingIterator;
3635

3736
/// A table collection.
3837
///
@@ -1389,30 +1388,29 @@ impl TableCollection {
13891388
///
13901389
/// # Example
13911390
/// ```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;
13941396
/// # 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();
14161414
/// ```
14171415
///
14181416
/// Note that no new provenance will be appended.
@@ -1424,6 +1422,7 @@ impl TableCollection {
14241422
where
14251423
P: Into<Position>,
14261424
{
1425+
use streaming_iterator::StreamingIterator;
14271426
let mut tables = self;
14281427
// use tables from sys to allow easier process with metadata
14291428
let options = 0;

0 commit comments

Comments
 (0)