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 Nov 1, 2024
1 parent ae64a72 commit d1d49c3
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 38 deletions.
24 changes: 12 additions & 12 deletions deepmd/dpmodel/atomic_model/base_atomic_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,19 +150,19 @@ def enable_compression(
check_frequency: int = -1,
) -> None:
"""Call descriptor enable_compression()
Parameters
----------
min_nbor_dist
The nearest distance between atoms
table_extrapolate
The scale of model extrapolation
table_stride_1
The uniform stride of the first table
table_stride_2
The uniform stride of the second table
check_frequency
The overflow check frequency
----------
min_nbor_dist
The nearest distance between atoms
table_extrapolate
The scale of model extrapolation
table_stride_1
The uniform stride of the first table
table_stride_2
The uniform stride of the second table
check_frequency
The overflow check frequency
"""
raise NotImplementedError("This atomi model doesn't support compression!")

Expand Down
26 changes: 13 additions & 13 deletions deepmd/dpmodel/atomic_model/dp_atomic_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def has_message_passing(self) -> bool:
def need_sorted_nlist_for_lower(self) -> bool:
"""Returns whether the atomic model needs sorted nlist when using `forward_lower`."""
return self.descriptor.need_sorted_nlist_for_lower()

def enable_compression(
self,
min_nbor_dist: float,
Expand All @@ -95,19 +95,19 @@ def enable_compression(
check_frequency: int = -1,
) -> None:
"""Call descriptor enable_compression()
Parameters
----------
min_nbor_dist
The nearest distance between atoms
table_extrapolate
The scale of model extrapolation
table_stride_1
The uniform stride of the first table
table_stride_2
The uniform stride of the second table
check_frequency
The overflow check frequency
----------
min_nbor_dist
The nearest distance between atoms
table_extrapolate
The scale of model extrapolation
table_stride_1
The uniform stride of the first table
table_stride_2
The uniform stride of the second table
check_frequency
The overflow check frequency
"""
self.descriptor.enable_compression(
min_nbor_dist,
Expand Down
24 changes: 11 additions & 13 deletions deepmd/dpmodel/model/make_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ def model_output_type(self) -> list[str]:
if vv.category == OutputVariableCategory.OUT
]
return vars

def enable_compression(
self,
table_extrapolate: float = 5,
Expand All @@ -194,19 +194,17 @@ def enable_compression(
check_frequency: int = -1,
) -> None:
"""Call atomic_model enable_compression()
Parameters
----------
min_nbor_dist
The nearest distance between atoms
table_extrapolate
The scale of model extrapolation
table_stride_1
The uniform stride of the first table
table_stride_2
The uniform stride of the second table
check_frequency
The overflow check frequency
----------
table_extrapolate
The scale of model extrapolation
table_stride_1
The uniform stride of the first table
table_stride_2
The uniform stride of the second table
check_frequency
The overflow check frequency
"""
self.atomic_model.enable_compression(
self.get_min_nbor_dist(),
Expand Down

0 comments on commit d1d49c3

Please sign in to comment.