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

Fix type hints for DiploidPopulation functions. #692

Merged
merged 1 commit into from Mar 5, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions fwdpy11/_types/diploid_population.py
@@ -1,4 +1,4 @@
from typing import Dict, Iterable, Iterator, List, Optional, Tuple, Union
from typing import IO, Dict, Iterable, Iterator, List, Optional, Tuple, Union

import fwdpy11._fwdpy11
import fwdpy11._types
Expand Down Expand Up @@ -67,7 +67,7 @@ def create_from_tskit(cls, ts: tskit.TreeSequence) -> "fwdpy11.DiploidPopulation
return cls(0, 0.0, ll_pop=ll)

@classmethod
def load_from_file(cls, filename: str) -> "fwdpy11.DiploidPopulation":
def load_from_file(cls, filename: IO) -> "fwdpy11.DiploidPopulation":
"""
Load population from the output of
:func:`fwdpy11.DiploidPopulation.dump_to_file`.
Expand All @@ -79,7 +79,7 @@ def load_from_file(cls, filename: str) -> "fwdpy11.DiploidPopulation":
return cls(0, 0.0, ll_pop=ll)

@classmethod
def load_from_pickle_file(cls, filename: str) -> "fwdpy11.DiploidPopulation":
def load_from_pickle_file(cls, filename: IO) -> "fwdpy11.DiploidPopulation":
"""
Read in a pickled population from a file.
The file muse have been generated by
Expand Down