Skip to content

Commit

Permalink
chore: improve neighbor stat log (#4561)
Browse files Browse the repository at this point in the history
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

- **Documentation**
- Improved logging statements in the `NeighborStat` class for better
clarity and detail
- Enhanced log messages to include more descriptive information about
neighbor distances and sizes

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Signed-off-by: Jinzhe Zeng <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
njzjz and pre-commit-ci[bot] authored Jan 20, 2025
1 parent a3242c4 commit 1b0d6a1
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions deepmd/utils/neighbor_stat.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,12 @@ def get_stat(self, data: DeepmdDataSystem) -> tuple[float, np.ndarray]:

# do sqrt in the final
min_nbor_dist = math.sqrt(min_nbor_dist)
log.info("training data with min nbor dist: " + str(min_nbor_dist))
log.info("training data with max nbor size: " + str(max_nbor_size))
log.info(
f"Neighbor statistics: training data with minimal neighbor distance: {min_nbor_dist:f}"
)
log.info(
f"Neighbor statistics: training data with maximum neighbor size: {max_nbor_size!s} (cutoff radius: {self.rcut:f})"
)
return min_nbor_dist, max_nbor_size

@abstractmethod
Expand Down

0 comments on commit 1b0d6a1

Please sign in to comment.