Skip to content

Commit 91796a8

Browse files
Apply suggestions from code review
Co-authored-by: Jerome Kelleher <[email protected]>
1 parent 5db7d1d commit 91796a8

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

python/tskit/tables.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2881,10 +2881,10 @@ def __getstate__(self):
28812881
return self.asdict()
28822882

28832883
@classmethod
2884-
def load(cls, file_or_path, skip_tables=False):
2884+
def load(cls, file_or_path, *, skip_tables=False):
28852885
file, local_file = util.convert_file_like_to_open_file(file_or_path, "rb")
28862886
ll_tc = _tskit.TableCollection(1)
2887-
ll_tc.load(file, skip_tables=bool(skip_tables))
2887+
ll_tc.load(file, skip_tables=skip_tables)
28882888
tc = TableCollection(1)
28892889
tc._ll_tables = ll_tc
28902890
return tc

python/tskit/trees.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2845,7 +2845,7 @@ def generate_random_binary(
28452845
)
28462846

28472847

2848-
def load(file, skip_tables=False):
2848+
def load(file, *, skip_tables=False):
28492849
"""
28502850
Loads a tree sequence from the specified file object or path. The file must be in the
28512851
:ref:`tree sequence file format <sec_tree_sequence_file_format>` produced by the
@@ -3510,11 +3510,11 @@ def aslist(self, **kwargs):
35103510
return [tree.copy() for tree in self.trees(**kwargs)]
35113511

35123512
@classmethod
3513-
def load(cls, file_or_path, skip_tables=False):
3513+
def load(cls, file_or_path, *, skip_tables=False):
35143514
file, local_file = util.convert_file_like_to_open_file(file_or_path, "rb")
35153515
try:
35163516
ts = _tskit.TreeSequence()
3517-
ts.load(file, skip_tables=bool(skip_tables))
3517+
ts.load(file, skip_tables=skip_tables)
35183518
return TreeSequence(ts)
35193519
except exceptions.FileFormatError as e:
35203520
# TODO Fix this for new file semantics

0 commit comments

Comments
 (0)