Skip to content

Doc restructure - #1963

Merged
mergify[bot] merged 2 commits into
tskit-dev:mainfrom
hyanwong:doc-restructure
Dec 1, 2021
Merged

mergify[bot] merged 2 commits into
tskit-dev:mainfrom
hyanwong:doc-restructure

Conversation

@hyanwong

@hyanwong hyanwong commented Nov 28, 2021 •

Copy link
Copy Markdown
Member

Before I go too much further, here's the start of a suggestion to address #1951. I've only really looked at structuring the methods in the TreeSequence class. I haven't even got onto the Tree class and others yet. It looks a bit like this (note the use of definition lists to break down topics within a section - not sure if this is a good way to do it or not, but I wanted to avoid even greater subsection depth).

Is this the sort of thing you had in mind @jeromekelleher ?

#### Loading and saving
Load a tree sequence
    .. autosummary::
      load
      load_text
      TableCollection.tree_sequence

Save a tree sequence
    .. autosummary::
      TreeSequence.dump

#### Obtaining trees

.. autosummary::

  TreeSequence.num_trees
  TreeSequence.trees
  TreeSequence.breakpoints
  TreeSequence.coiterate
  TreeSequence.first
  TreeSequence.last
  TreeSequence.aslist
  TreeSequence.at
  TreeSequence.at_index

#### Obtaining other objects
##### Tree topology

Nodes
    .. autosummary::
      Node
      TreeSequence.num_nodes
      TreeSequence.nodes
      TreeSequence.node
      TreeSequence.num_samples
      TreeSequence.samples

Edges
    .. autosummary::
      Edge
      TreeSequence.num_edges
      TreeSequence.edges
      TreeSequence.edge

##### Genetic variation
Sites
    .. autosummary::
      Site
      TreeSequence.num_sites
      TreeSequence.sites
      TreeSequence.site
      Variant
      TreeSequence.variants
      TreeSequence.genotype_matrix
      TreeSequence.haplotypes
      TreeSequence.alignments

Mutations
    .. autosummary::
      Mutation
      TreeSequence.num_mutations
      TreeSequence.mutations
      TreeSequence.mutation

##### Demography

Populations
    .. autosummary::
      Population
      TreeSequence.num_populations
      TreeSequence.populations
      TreeSequence.population

Migrations
    .. autosummary::
      Migration
      TreeSequence.num_migrations
      TreeSequence.migrations
      TreeSequence.migration

##### Other

Individuals
    .. autosummary::
      Individual
      TreeSequence.num_individuals
      TreeSequence.individuals
      TreeSequence.individual


Provenance entries (also see :ref:`sec_provenance_api`)
    .. autosummary::
      Provenance
      TreeSequence.num_provenances
      TreeSequence.provenances
      TreeSequence.provenance

#### Tree sequence manipulation
 .. autosummary::
  TreeSequence.simplify
  TreeSequence.subset
  TreeSequence.union
  TreeSequence.keep_intervals
  TreeSequence.delete_intervals
  TreeSequence.delete_sites
  TreeSequence.trim

#### Tables

.. autosummary::
  TreeSequence.tables
  TreeSequence.dump_tables
  TreeSequence.table_metadata_schemas
  TreeSequence.tables_dict

#### Statistics

Single site
    .. autosummary::
      TreeSequence.allele_frequency_spectrum
      TreeSequence.divergence
      TreeSequence.diversity
      TreeSequence.f2
      TreeSequence.f3
      TreeSequence.f4
      TreeSequence.Fst
      TreeSequence.genealogical_nearest_neighbours
      TreeSequence.genetic_relatedness
      TreeSequence.general_stat
      TreeSequence.segregating_sites
      TreeSequence.sample_count_stat
      TreeSequence.mean_descendants
      TreeSequence.Tajimas_D
      TreeSequence.trait_correlation
      TreeSequence.trait_covariance
      TreeSequence.trait_linear_model
      TreeSequence.Y2
      TreeSequence.Y3

Comparative
    .. autosummary::
      TreeSequence.kc_distance

also see {meth}`TreeSequence.count_topologies` in the {ref}`sec_combinatorics_api`
section

#### Visualization

.. autosummary::
  TreeSequence.draw_svg
  TreeSequence.draw_text
  TreeSequence.__str__
  TreeSequence._repr_html_

#### Export
.. autosummary::
  TreeSequence.as_fasta
  TreeSequence.as_nexus
  TreeSequence.dump_text
  TreeSequence.to_macs
  TreeSequence.write_fasta
  TreeSequence.write_nexus
  TreeSequence.write_vcf


#### General properties

.. autosummary::
  TreeSequence.time_units
  TreeSequence.nbytes
  TreeSequence.sequence_length
  TreeSequence.max_root_time
  TreeSequence.discrete_genome
  TreeSequence.discrete_time
  TreeSequence.metadata
  TreeSequence.metadata_schema

@hyanwong
hyanwong marked this pull request as draft November 28, 2021 23:01
@codecov

codecov Bot commented Nov 28, 2021 •

Copy link
Copy Markdown

Codecov Report

Merging #1963 (1d9cff7) into main (1d3f6de) will decrease coverage by 11.87%.
The diff coverage is n/a.

Impacted file tree graph

@@             Coverage Diff             @@
##             main    #1963       +/-   ##
===========================================
- Coverage   93.32%   81.45%   -11.88%     
===========================================
  Files          27       27               
  Lines       25212    25079      -133     
  Branches     1108     1107        -1     
===========================================
- Hits        23530    20427     -3103     
- Misses       1648     4591     +2943     
- Partials       34       61       +27     
Flag Coverage Δ
c-tests 92.32% <ø> (ø)
lwt-tests 89.14% <ø> (ø)
python-c-tests 71.68% <ø> (ø)
python-tests ?

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
python/tskit/tables.py 84.41% <ø> (-14.53%) ⬇️
python/tskit/trees.py 46.89% <ø> (-50.90%) ⬇️
python/tskit/cli.py 0.00% <0.00%> (-95.94%) ⬇️
python/tskit/vcf.py 9.78% <0.00%> (-90.22%) ⬇️
python/tskit/drawing.py 10.41% <0.00%> (-89.02%) ⬇️
python/tskit/text_formats.py 12.62% <0.00%> (-87.38%) ⬇️
python/tskit/combinatorics.py 13.70% <0.00%> (-85.66%) ⬇️
python/tskit/stats.py 35.13% <0.00%> (-64.87%) ⬇️
python/tskit/util.py 59.56% <0.00%> (-40.44%) ⬇️
... and 3 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1d3f6de...1d9cff7. Read the comment docs.

@jeromekelleher

Copy link
Copy Markdown
Member

I like it @hyanwong - I think we can fiddle with the names and what-goes-where over time, but the overall layout looks great to me. I say we merge and let folks have a look and feedback.

@benjeffery

Copy link
Copy Markdown
Member

This is already an improvment! As @jeromekelleher says, lets merge and iterate.

@hyanwong

Copy link
Copy Markdown
Member Author

Yep - will finish passing though it in a few hours and request a merge then. Thanks @benjeffery!

Mainly so that the first sentences make sense with the new doc layout.
@hyanwong

hyanwong commented Dec 1, 2021

Copy link
Copy Markdown
Member Author

This is now reasonably complete, and can probably be merged, then improved iteratively, as @jeromekelleher says.

@jeromekelleher
jeromekelleher marked this pull request as ready for review December 1, 2021 20:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants