Skip to content

Commit 5af5c97

Browse files
committed
Add tables.load docstring
Fixes #3406
1 parent f268aef commit 5af5c97

1 file changed

Lines changed: 16 additions & 1 deletion

File tree

python/tskit/tables.py

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3455,6 +3455,20 @@ def __getstate__(self):
34553455

34563456
@classmethod
34573457
def load(cls, file_or_path, *, skip_tables=False, skip_reference_sequence=False):
3458+
"""
3459+
Load a TableCollection from a file or path, saved in the format defined by
3460+
:meth:`.dump`. If the file is not in a valid format, an exception will be
3461+
raised.
3462+
3463+
:param file_or_path: The file object or path from which to load the
3464+
TableCollection.
3465+
:param bool skip_tables: If True, no tables are read from the file and
3466+
only the top-level information is populated in the returned TableCollection.
3467+
:param bool skip_reference_sequence: If True, tables are read
3468+
without loading any reference sequence.
3469+
:return: A TableCollection instance
3470+
:rtype: TableCollection
3471+
"""
34583472
file, local_file = util.convert_file_like_to_open_file(file_or_path, "rb")
34593473
ll_tc = _tskit.TableCollection()
34603474
try:
@@ -3474,7 +3488,8 @@ def dump(self, file_or_path):
34743488
"""
34753489
Writes the table collection to the specified path or file object.
34763490
3477-
:param str file_or_path: The file object or path to write the TreeSequence to.
3491+
:param str file_or_path: The file object or path to which to write this
3492+
TableCollection.
34783493
"""
34793494
file, local_file = util.convert_file_like_to_open_file(file_or_path, "wb")
34803495
try:

0 commit comments

Comments
 (0)