You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Addressed review feedback to replace remaining `Any` type annotations
with specific types across training, fitting, and model modules.
## Changes
### Learning Rate Types
- `EnerFitting.get_loss()` and `StandardModel.get_loss()`: `lr: Any` →
`lr: LearningRateExp`
### Trainer Method Signatures
- `build()`: `data: dict` → `data: DeepmdDataSystem | None`
- `_build_loss()`: `-> Any` → `-> tuple[None, None] | tuple[tf.Tensor,
dict[str, tf.Tensor]]`
- `_build_network()`: `data: dict` → `data: DeepmdDataSystem`
- `get_global_step()`: `-> Any` → `-> int`
### Example
```python
# Before
def get_loss(self, loss: dict, lr: Any) -> Loss:
...
# After
def get_loss(self, loss: dict, lr: LearningRateExp) -> Loss:
...
```
The `_build_loss()` return type now accurately reflects that it returns
either `(None, None)` when `stop_batch == 0`, or `(tf.Tensor, dict[str,
tf.Tensor])` from the loss build.
<!-- START COPILOT CODING AGENT TIPS -->
---
✨ Let Copilot coding agent [set things up for
you](https://github.com/deepmodeling/deepmd-kit/issues/new?title=✨+Set+up+Copilot+instructions&body=Configure%20instructions%20for%20this%20repository%20as%20documented%20in%20%5BBest%20practices%20for%20Copilot%20coding%20agent%20in%20your%20repository%5D%28https://gh.io/copilot-coding-agent-tips%29%2E%0A%0A%3COnboard%20this%20repo%3E&assignees=copilot)
— coding agent works faster and does higher quality work when set up for
your repo.
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: njzjz <9496702+njzjz@users.noreply.github.com>
Co-authored-by: Jinzhe Zeng <jinzhe.zeng@ustc.edu.cn>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
0 commit comments