Skip to content

Commit d700af7

Browse files
authored
doc sorting requirements (#243)
* Allow broken intradoc links in binding.rs. * Clarify table sorting requirements in docs. Closes #239 Closes #242
1 parent 6114d2b commit d700af7

File tree

3 files changed

+19
-7
lines changed

3 files changed

+19
-7
lines changed

src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@
7474
#![allow(non_snake_case)]
7575

7676
#[allow(deref_nullptr)]
77+
#[allow(rustdoc::broken_intra_doc_links)]
7778
pub mod bindings;
7879

7980
mod _macros; // Starts w/_ to be sorted at front by rustfmt!

src/table_collection.rs

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -626,11 +626,10 @@ impl TableCollection {
626626
/// The [``bookmark``](crate::types::Bookmark) can
627627
/// be used to affect where sorting starts from for each table.
628628
///
629-
/// # Note
629+
/// # Details
630630
///
631-
/// As of `0.7.0`, this function does not sort the individual table!
632-
/// See
633-
/// [``topological_sort_individuals``](crate::TableCollection::topological_sort_individuals).
631+
/// See [`full_sort`](crate::TableCollection::full_sort)
632+
/// for more details about which tables are sorted.
634633
pub fn sort<O: Into<TableSortOptions>>(
635634
&mut self,
636635
start: &Bookmark,
@@ -650,10 +649,20 @@ impl TableCollection {
650649
/// Fully sort all tables.
651650
/// Implemented via a call to [``sort``](crate::TableCollection::sort).
652651
///
653-
/// # Note
652+
/// # Details
653+
///
654+
/// This function only sorts the tables that have a strict sortedness
655+
/// requirement according to the `tskit` [data
656+
/// model](https://tskit.dev/tskit/docs/stable/data-model.html).
657+
///
658+
/// These tables are:
659+
///
660+
/// * edges
661+
/// * mutations
662+
/// * sites
654663
///
655-
/// As of `0.7.0`, this function does not sort the individual table!
656-
/// See
664+
/// For some use cases it is desirable to have the individual table
665+
/// sorted so that parents appear before offspring. See
657666
/// [``topological_sort_individuals``](crate::TableCollection::topological_sort_individuals).
658667
pub fn full_sort<O: Into<TableSortOptions>>(&mut self, options: O) -> TskReturnValue {
659668
let b = Bookmark::new();

src/trees.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -975,6 +975,8 @@ impl TreeSequence {
975975
/// # Errors
976976
///
977977
/// * [`TskitError`] if the tables are not indexed.
978+
/// * [`TskitError`] if the tables are not properly sorted.
979+
/// See [`TableCollection::full_sort`](crate::TableCollection::full_sort).
978980
///
979981
/// # Examples
980982
///

0 commit comments

Comments
 (0)