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

More type hints - No untyped defs #683

Merged
merged 13 commits into from
May 23, 2024
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
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@
"python.formatting.provider": "black",
"editor.formatOnSave": true,
"mypy-type-checker.args": [
"--disallow-incomplete-defs",
"--disallow-untyped-defs",
],
}
2 changes: 1 addition & 1 deletion mikeio/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def read(
items: str | int | Sequence[str | int] | None = None,
time: int | str | slice | None = None,
keepdims: bool = False,
**kwargs,
**kwargs: Any,
) -> Dataset:
"""Read all or a subset of the data from a dfs file

Expand Down
6 changes: 3 additions & 3 deletions mikeio/_track.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from __future__ import annotations
from pathlib import Path
from collections.abc import Sequence
from typing import Callable, Tuple
from typing import Any, Callable, Tuple

import numpy as np
import pandas as pd
Expand All @@ -25,7 +25,7 @@ def _extract_track(
time_steps: Sequence[int],
n_elements: int,
method: str,
dtype,
dtype: Any, # TODO DTypeLike?
data_read_func: Callable[[int, int], Tuple[np.ndarray, float]],
) -> Dataset:

Expand Down Expand Up @@ -119,7 +119,7 @@ def _extract_track(
d[d == deletevalue] = np.nan
d2[i, :] = d

def is_EOF(step):
def is_EOF(step: int) -> bool:
return step >= len(time_steps)

# loop over track points
Expand Down
Loading
Loading