Skip to content

chore: improve type annotations #4

chore: improve type annotations

chore: improve type annotations #4

Triggered via pull request May 17, 2024 00:50
Status Failure
Total duration 31s
Artifacts

pyright.yml

on: pull_request
Fit to window
Zoom out
Zoom in

Annotations

10 errors
pyright: dpdata/system.py#L312
Argument of type "int | slice | list[Unknown] | ndarray[Unknown, Unknown]" cannot be assigned to parameter "f_idx" of type "Integral" in function "sub_system"   Type "int | slice | list[Unknown] | ndarray[Unknown, Unknown]" is incompatible with type "Integral"     "int" is incompatible with "Integral" (reportArgumentType)
pyright: dpdata/system.py#L452
Expression of type "NDArray[Any]" is incompatible with declared type "Integral"   "ndarray[Any, dtype[Any]]" is incompatible with "Integral" (reportAssignmentType)
pyright: dpdata/system.py#L462
No overloads for "__setitem__" match the provided arguments (reportCallIssue)
pyright: dpdata/system.py#L462
Argument of type "Integral" cannot be assigned to parameter "value" of type "slice | ndarray[Unknown, Unknown]" in function "__setitem__"   Type "Integral" is incompatible with type "slice | ndarray[Unknown, Unknown]"     "Integral" is incompatible with "slice"     "Integral" is incompatible with "ndarray[Unknown, Unknown]" (reportArgumentType)
pyright: dpdata/system.py#L708
Expression of type "Literal[0]" cannot be assigned to parameter of type "Integral"   "Literal[0]" is incompatible with "Integral" (reportArgumentType)
pyright: dpdata/system.py#L724
Argument of type "int" cannot be assigned to parameter "f_idx" of type "Integral" in function "rot_frame_lower_triangular"   "int" is incompatible with "Integral" (reportArgumentType)
pyright: dpdata/system.py#L726
Expression of type "Literal[0]" cannot be assigned to parameter of type "Integral"   "Literal[0]" is incompatible with "Integral" (reportArgumentType)
pyright: dpdata/system.py#L778
No overloads for "sort" match the provided arguments (reportCallIssue)
pyright: dpdata/system.py#L779
No overloads for "tile" match the provided arguments (reportCallIssue)
pyright: dpdata/system.py#L779
Argument of type "int64" cannot be assigned to parameter "reps" of type "int | Sequence[int]" in function "tile"   Type "int64" is incompatible with type "int | Sequence[int]"     "signedinteger[_64Bit]" is incompatible with "int"     "signedinteger[_64Bit]" is incompatible with "Sequence[int]" (reportArgumentType)