diff --git a/Cargo.toml b/Cargo.toml index 22fd8d88..708dcca9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -15,4 +15,4 @@ keywords = ["simulation", "tree_sequences", "tskit", "population_genetics"] bitflags = "1.2.1" thiserror = "1.0" GSL = "2.0.1" -tskit_rust = "0.1.0" +tskit = "0.1.1" diff --git a/forrustts_examples/Cargo.toml b/forrustts_examples/Cargo.toml index 0102311e..8f368e6d 100644 --- a/forrustts_examples/Cargo.toml +++ b/forrustts_examples/Cargo.toml @@ -10,7 +10,7 @@ edition = "2018" path = "../" [dependencies] -tskit_rust = { git = "https://github.com/molpopgen/tskit_rust", branch = "main" } +tskit = "0.1.1" clap = "~2.27.0" [[bin]] diff --git a/forrustts_examples/neutral_wf.rs b/forrustts_examples/neutral_wf.rs index 5ba84fd2..6576270a 100644 --- a/forrustts_examples/neutral_wf.rs +++ b/forrustts_examples/neutral_wf.rs @@ -77,7 +77,7 @@ fn main() { let psurvival = value_t!(matches.value_of("psurvival"), f64).unwrap_or(0.0); let seed = value_t_or_exit!(matches.value_of("seed"), usize); let outfile = value_t_or_exit!(matches.value_of("outfile"), String); - let validate_tables = matches.is_present("validate_tables"); + let validate_tables = matches.is_present("validate_tables"); // TODO: parameter validation.. @@ -129,7 +129,7 @@ fn main() { tskit_tables.dump(&outfile, 0).unwrap(); } else { tskit_tables - .dump(&outfile, tskit_rust::TSK_NO_BUILD_INDEXES) + .dump(&outfile, tskit::TSK_NO_BUILD_INDEXES) .unwrap(); } } diff --git a/src/simplification_logic.rs b/src/simplification_logic.rs index cd9d78a9..060590c5 100644 --- a/src/simplification_logic.rs +++ b/src/simplification_logic.rs @@ -37,12 +37,10 @@ impl SegmentOverlapper { fn num_overlaps(&self) -> usize { assert!( self.oend - self.obeg <= self.overlapping.len(), - format!( - "overlap details = {} {} {}", - self.oend, - self.obeg, - self.overlapping.len() - ) + "overlap details = {} {} {}", + self.oend, + self.obeg, + self.overlapping.len() ); self.oend - self.obeg } diff --git a/src/test_simplify_tables.rs b/src/test_simplify_tables.rs index b9a6d8cf..3d5f997c 100644 --- a/src/test_simplify_tables.rs +++ b/src/test_simplify_tables.rs @@ -1,9 +1,9 @@ #[cfg(test)] mod test { // NOTE: Currently, these tests are both testing - // stuff from tskit_rust and forrusts, which isn't great. + // stuff from tskit and forrusts, which isn't great. // We'll clean this up later when we get better abstractions - // into tskit_rust. + // into tskit. use crate::simplify_tables_without_state; use crate::tsdef::{IdType, Position, Time}; use crate::wright_fisher::*; @@ -13,11 +13,10 @@ mod test { use crate::SimplificationOutput; use crate::TableCollection; use std::mem::MaybeUninit; - use tskit_rust::bindings as tskr; + use tskit::bindings as tskr; + use tskit::ffi::TskitType; - fn tables_to_treeseq( - tables: &mut tskit_rust::TableCollection, - ) -> MaybeUninit { + fn tables_to_treeseq(tables: &mut tskit::TableCollection) -> MaybeUninit { let mut tsk_ts: MaybeUninit = MaybeUninit::uninit(); unsafe { let rv = tskr::tsk_table_collection_build_index(tables.as_mut_ptr(), 0); diff --git a/src/tskit.rs b/src/tskit.rs index 962f58fb..4c65be54 100644 --- a/src/tskit.rs +++ b/src/tskit.rs @@ -1,4 +1,4 @@ -//! Data interchange to ``tskit`` format using [``tskit_rust``]. +//! Data interchange to ``tskit`` format using [``tskit``]. //! //! # Note //! @@ -11,7 +11,7 @@ use crate::tsdef::Time; use crate::TableCollection; -use tskit_rust::{tsk_flags_t, tsk_id_t, TSK_NODE_IS_SAMPLE, TSK_NULL}; +use tskit::{tsk_flags_t, tsk_id_t, TSK_NODE_IS_SAMPLE, TSK_NULL}; /// Return a closure to help reverse time. /// @@ -44,7 +44,7 @@ pub fn simple_time_reverser(x: Time) -> Box f64> { /// /// # Returns /// -/// A [``tskit_rust::TableCollection``]. +/// A [``tskit::TableCollection``]. /// /// # Example /// @@ -69,8 +69,8 @@ pub fn convert_to_tskit_minimal( is_sample: &[i32], convert_time: impl Fn(Time) -> f64, build_indexes: bool, -) -> tskit_rust::TableCollection { - let mut tsk_tables = tskit_rust::TableCollection::new(tables.genome_length() as f64).unwrap(); +) -> tskit::TableCollection { + let mut tsk_tables = tskit::TableCollection::new(tables.genome_length() as f64).unwrap(); for e in tables.edges() { tsk_tables @@ -133,7 +133,7 @@ fn swap_with_empty(v: &mut Vec) { /// /// # Returns /// -/// A [``tskit_rust::TableCollection``]. +/// A [``tskit::TableCollection``]. /// /// # Example /// @@ -166,8 +166,8 @@ pub fn convert_to_tskit_and_drain_minimal( convert_time: impl Fn(Time) -> f64, build_indexes: bool, tables: &mut TableCollection, -) -> tskit_rust::TableCollection { - let mut tsk_tables = tskit_rust::TableCollection::new(tables.genome_length() as f64).unwrap(); +) -> tskit::TableCollection { + let mut tsk_tables = tskit::TableCollection::new(tables.genome_length() as f64).unwrap(); let mut max_pop: tsk_id_t = -1; for (i, n) in tables.enumerate_nodes() {