mllam/neural-lam

Add type hints to methods in interaction_net.py

已关闭

#448 创建于 2026年3月20日

 (0 条评论) (0 个反应) (0 位负责人)Python (276 个派生)auto 404
good first issuemaintenance

仓库指标

星标
 (282 个星标)
PR 合并指标
 (平均合并 56天 22小时) (30 天内合并 6 个 PR)

描述

Summary

The methods in neural_lam/interaction_net.py currently lack type annotations. mypy is already configured in pre-commit but cannot fully validate this module without proper type hints.

Methods affected

  • InteractionNet.forward
  • InteractionNet.message
  • InteractionNet.aggregate
  • SplitMLPs.forward

Proposed Fix

Add torch.Tensor, Optional[torch.Tensor], Tuple and Union type hints to all method signatures and return types.

Why This Matters

  • mypy is already set up in .pre-commit-config.yaml
  • Type hints improve contributor experience and catch bugs early
  • Consistent with type hints already added in metrics.py (see #446)

贡献者指南