Skip to content

Commit 81f830b

Browse files
committed
try to define row_vector_cell for the typechecker
1 parent 77bdc90 commit 81f830b

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

torch_sim/state.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -501,6 +501,11 @@ class DeformGradMixin:
501501

502502
_system_attributes: ClassVar[set[str]] = {"reference_cell"}
503503

504+
if TYPE_CHECKING:
505+
# define this under a TYPE_CHECKING block to avoid it being included in the
506+
# dataclass __init__ during runtime
507+
row_vector_cell: torch.Tensor
508+
504509
@property
505510
def reference_row_vector_cell(self) -> torch.Tensor:
506511
"""Get the original unit cell in terms of row vectors."""

0 commit comments

Comments
 (0)