mllam/neural-lam

Add type hints to methods in interaction_net.py

Fermée

#448 ouverte le 20 mars 2026

 (0 commentaire) (0 réaction) (0 personne assignée)Python (276 forks)auto 404
good first issuemaintenance

Métriques du dépôt

Stars
 (282 étoiles)
Métriques de merge PR
 (Merge moyen 56j 22h) (6 PRs mergées en 30 j)

Description

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)

Guide contributeur