Skip to content

Commit 7b52f86

Browse files
committed
Annotate ts as PointModelResult | NodeModelResult in load()
mypy inferred ts's type from its first assignment (NodeModelResult), flagging the later PointModelResult assignment as incompatible. Part of gh #677
1 parent 39c70f7 commit 7b52f86

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

src/modelskill/comparison/_comparison.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1412,6 +1412,7 @@ def load(filename: Union[str, Path]) -> "Comparer":
14121412
ds = data[[var_name]].rename(
14131413
{"_time_raw_" + new_key: "time", var_name: new_key}
14141414
)
1415+
ts: PointModelResult | NodeModelResult
14151416
if data.gtype == "node":
14161417
ts = NodeModelResult(
14171418
data=ds, node=int(ds.coords["node"].item()), name=new_key

0 commit comments

Comments
 (0)