Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Jan 6, 2025
1 parent 4a38f1d commit 78b2a10
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions deepmd/pt/utils/stat.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,10 @@
Optional,
Union,
)

import numpy as np
import torch
from deepmd.dpmodel.output_def import (
FittingOutputDef,
)

from deepmd.pt.utils import (
AtomExcludeMask,
)
Expand All @@ -35,6 +34,7 @@

log = logging.getLogger(__name__)


def make_stat_input(
datasets,
dataloaders,
Expand Down Expand Up @@ -103,7 +103,9 @@ def process_with_new_frame(sys_indices, newele_counter, miss):
newele_counter += 1
if newele_counter <= min_frames_per_element_forstat:
frame_data = sys.__getitem__(frame)
assert miss in frame_data['atype'], f"Missing element '{miss}' not found in frame data."
assert (
miss in frame_data["atype"]
), f"Missing element '{miss}' not found in frame data."
sys_stat_new = {}
for dd in frame_data:
if dd == "type":
Expand Down Expand Up @@ -211,6 +213,7 @@ def finalize_stats(sys_stat):
process_with_new_frame(sys_indices, newele_counter, miss)
return lst


def _restore_from_file(
stat_file_path: DPPath,
keys: list[str] = ["energy"],
Expand Down

0 comments on commit 78b2a10

Please sign in to comment.