Skip to content

Commit cb29631

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

1 file changed

Lines changed: 17 additions & 1 deletion

File tree

python/tskit/tables.py

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3455,6 +3455,21 @@ 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 ``.trees``
3466+
file and only the top-level information is populated in the returned
3467+
TableCollection.
3468+
:param bool skip_reference_sequence: If True, tables are read
3469+
without loading any reference sequence.
3470+
:return: A TableCollection instance
3471+
:rtype: TableCollection
3472+
"""
34583473
file, local_file = util.convert_file_like_to_open_file(file_or_path, "rb")
34593474
ll_tc = _tskit.TableCollection()
34603475
try:
@@ -3474,7 +3489,8 @@ def dump(self, file_or_path):
34743489
"""
34753490
Writes the table collection to the specified path or file object.
34763491
3477-
:param str file_or_path: The file object or path to write the TreeSequence to.
3492+
:param str file_or_path: The file object or path to which to write this
3493+
TableCollection.
34783494
"""
34793495
file, local_file = util.convert_file_like_to_open_file(file_or_path, "wb")
34803496
try:

0 commit comments

Comments
 (0)