Skip to content

Commit

Permalink
avoid exposing test code as public api
Browse files Browse the repository at this point in the history
  • Loading branch information
bguo068 committed Jun 1, 2024
1 parent 0114d93 commit 64d33e6
Show file tree
Hide file tree
Showing 7 changed files with 474 additions and 465 deletions.
1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ serde_json = {version = "1.0.117", optional = true}
bincode = {version = "1.3.1", optional = true}
tskit-derive = {version = "0.2.0", path = "tskit-derive", optional = true}
delegate = "0.12.0"
rand = "0.8.3"


[dev-dependencies]
Expand Down
1 change: 0 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -177,5 +177,4 @@ mod tests {
}

// Testing modules
pub mod test_data;
mod test_fixtures;
47 changes: 23 additions & 24 deletions src/table_collection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ use crate::TskReturnValue;
use crate::{EdgeId, NodeId};
use ll_bindings::tsk_id_t;
use ll_bindings::tsk_size_t;
use streaming_iterator::StreamingIterator;

/// A table collection.
///
Expand Down Expand Up @@ -1389,30 +1388,29 @@ impl TableCollection {
///
/// # Example
/// ```rust
/// # use tskit::test_data::simulation::simulate_two_treesequences;
/// # let intervals = vec![(10.0, 20.0), (700.0, 850.0)];
/// # use tskit::*;
/// # let snode = NodeFlags::new_sample();
/// # let anode = NodeFlags::default();
/// # let pop = PopulationId::NULL;
/// # let ind = IndividualId::NULL;
/// # let seqlen = 100.0;
/// # let popsize = 100;
/// # let totle_generations = 50;
/// # let popsplit_time = 10;
/// # let seed = 123;

/// # let (full_trees, _exepected) = simulate_two_treesequences(
/// # seqlen,
/// # popsize,
/// # totle_generations,
/// # popsplit_time,
/// # &intervals,
/// # seed,
/// # )
/// # .unwrap();
/// #
/// # let tables = full_trees.dump_tables().unwrap();
///
/// let _trucated_tables = tables
/// .keep_intervals(intervals.iter().map(|a| *a), true)
/// .unwrap()
/// .unwrap();
/// # let (t0, t10) = (0.0, 10.0);
/// # let (left, right) = (0.0, 100.0);
/// # let sim_opts = SimplificationOptions::default();
///
/// # let mut tables = TableCollection::new(seqlen).unwrap();
/// # let child1 = tables.add_node(snode, t0, pop, ind).unwrap();
/// # let child2 = tables.add_node(snode, t0, pop, ind).unwrap();
/// # let parent = tables.add_node(anode, t10, pop, ind).unwrap();
///
/// # tables.add_edge(left, right, parent, child1).unwrap();
/// # tables.add_edge(left, right, parent, child2).unwrap();
/// # tables.full_sort(TableSortOptions::all()).unwrap();
/// # tables.simplify(&[child1, child2], sim_opts, false).unwrap();
/// # tables.build_index().unwrap();
///
/// let intervals = [(0.0, 10.0), (90.0, 100.0)].into_iter();
/// tables.keep_intervals(intervals, true).unwrap().unwrap();
/// ```
///
/// Note that no new provenance will be appended.
Expand All @@ -1424,6 +1422,7 @@ impl TableCollection {
where
P: Into<Position>,
{
use streaming_iterator::StreamingIterator;
let mut tables = self;
// use tables from sys to allow easier process with metadata
let options = 0;
Expand Down
Loading

0 comments on commit 64d33e6

Please sign in to comment.