Skip to content

Commit 9f1724c

Browse files
committed
Fix track type hints and docstring
1 parent 97872ab commit 9f1724c

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

mikeio/dataset/_dataarray.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1148,19 +1148,17 @@ def __dataarray_read_item_time_func(
11481148

11491149
def extract_track(
11501150
self,
1151-
track: pd.DataFrame,
1151+
track: str | Path | Dataset | pd.DataFrame,
11521152
method: Literal["nearest", "inverse_distance"] = "nearest",
11531153
dtype: Any = np.float32,
11541154
) -> "Dataset":
11551155
"""Extract data along a moving track.
11561156
11571157
Parameters
11581158
---------
1159-
track: pandas.DataFrame
1159+
track: pandas.DataFrame, str or Dataset
11601160
with DatetimeIndex and (x, y) of track points as first two columns
1161-
x,y coordinates must be in same coordinate system as dfsu
1162-
track: str
1163-
filename of csv or dfs0 file containing t,x,y
1161+
x,y coordinates must be in same coordinate system
11641162
method: str, optional
11651163
Spatial interpolation method ('nearest' or 'inverse_distance')
11661164
default='nearest'

mikeio/dfsu/_dfsu.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -506,7 +506,7 @@ def _dfs_read_item_time_func(
506506

507507
def extract_track(
508508
self,
509-
track: pd.DataFrame,
509+
track: str | Path | Dataset | pd.DataFrame,
510510
items: int | str | Sequence[int | str] | None = None,
511511
method: Literal["nearest", "inverse_distance"] = "nearest",
512512
dtype: Any = np.float32,
@@ -518,8 +518,6 @@ def extract_track(
518518
track: pandas.DataFrame
519519
with DatetimeIndex and (x, y) of track points as first two columns
520520
x,y coordinates must be in same coordinate system as dfsu
521-
track: str
522-
filename of csv or dfs0 file containing t,x,y
523521
items: list[int] or list[str], optional
524522
Extract only selected items, by number (0-based), or by name
525523
method: str, optional

0 commit comments

Comments
 (0)