Skip to content

Commit

Permalink
Merge pull request #683 from DHI/types42
Browse files Browse the repository at this point in the history
More type hints - No untyped defs
  • Loading branch information
ecomodeller authored May 23, 2024
2 parents fbac5e1 + 6e616ec commit 7882682
Show file tree
Hide file tree
Showing 24 changed files with 610 additions and 294 deletions.
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

0 comments on commit 7882682

Please sign in to comment.