Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a note about what is serialised to file #3075

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 19 additions & 4 deletions docs/data-model.md
Original file line number Diff line number Diff line change
Expand Up @@ -387,10 +387,10 @@ The tree sequence itself also has metadata stored as a byte array.
### Valid tree sequence requirements

Arbitrary data can be stored in tables using the classes in the
{ref}`sec_tables_api`. However, only a {class}`TableCollection`
that fulfils a set of requirements represents
a valid {class}`TreeSequence` object which can be obtained
using the {meth}`TableCollection.tree_sequence` method. In this
{ref}`sec_tables_api`. The {meth}`TableCollection.tree_sequence` method
can be used to turn such a {class}`TableCollection` into an immutable
{class}`TreeSequence` object, but this requires the tables to
fulfil a specific set of requirements. In this
section we list these requirements, and explain their rationale.
Violations of most of these requirements are detected when the
user attempts to load a tree sequence via {func}`tskit.load` or
Expand Down Expand Up @@ -598,6 +598,21 @@ can be used to create an index on a table collection if necessary.
Add more details on what the indexes actually are.
:::


(sec_data_model_saving)=

### Saving to file

When serializing (storing a tree sequence on disk). the underlying tables are stored
along with the indexes *and other stuff*. When the tree sequence is loaded from file,
it is then guaranteed to be valid, with pre-calculated indexes and cached properties
immediately available.

If a TableCollection is saved to file, then any indexes are also stored in the
file. A TableCollection that has been loaded from a file is not, however, guaranteed
to be a valid tree sequence.


(sec_data_model_data_encoding)=

## Data encoding
Expand Down
Loading