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 typehints and deprecation warning #165

Merged
merged 1 commit into from
Jul 20, 2022
Merged
Show file tree
Hide file tree
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
Fix typehints and deprecation warning
Closes #164
  • Loading branch information
dweindl committed Jul 20, 2022
commit 25c7861b39a15eaa1d884a34e399aae3ab75e9b7
4 changes: 2 additions & 2 deletions petab/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
'create_combine_archive', 'unique_preserve_order']


def get_simulation_df(simulation_file: str) -> pd.DataFrame:
def get_simulation_df(simulation_file: Union[str, Path]) -> pd.DataFrame:
"""Read PEtab simulation table

Arguments:
Expand All @@ -33,7 +33,7 @@ def get_simulation_df(simulation_file: str) -> pd.DataFrame:
float_precision='round_trip')


def write_simulation_df(df: pd.DataFrame, filename: str) -> None:
def write_simulation_df(df: pd.DataFrame, filename: Union[str, Path]) -> None:
"""Write PEtab simulation table

Arguments:
Expand Down
4 changes: 2 additions & 2 deletions petab/problem.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ def __init__(
if any((sbml_model, sbml_document, sbml_reader),):
warn("Passing `sbml_model`, `sbml_document`, or `sbml_reader` "
"to petab.Problem is deprecated and will be removed in a "
"future version. Use `model=petab.models.SbmlModel(...)` "
"instead.", DeprecationWarning, stacklevel=2)
"future version. Use `model=petab.models.sbml_model."
"SbmlModel(...)` instead.", DeprecationWarning, stacklevel=2)
if model:
raise ValueError("Must only provide one of (`sbml_model`, "
"`sbml_document`, `sbml_reader`) or `model`.")
Expand Down