diff --git a/deepmd/dpmodel/atomic_model/base_atomic_model.py b/deepmd/dpmodel/atomic_model/base_atomic_model.py index 6559c99d8a..b8c4902d68 100644 --- a/deepmd/dpmodel/atomic_model/base_atomic_model.py +++ b/deepmd/dpmodel/atomic_model/base_atomic_model.py @@ -61,7 +61,8 @@ def atomic_output_def(self) -> FittingOutputDef: else: old_list = list(old_def.get_data().values()) return FittingOutputDef( - old_list.append( + old_list # noqa:RUF005 + + [ OutputVariableDef( name="mask", shape=[1], @@ -69,7 +70,7 @@ def atomic_output_def(self) -> FittingOutputDef: r_differentiable=False, c_differentiable=False, ) - ) + ] ) def forward_common_atomic( diff --git a/deepmd/pt/model/atomic_model/base_atomic_model.py b/deepmd/pt/model/atomic_model/base_atomic_model.py index 1e1c6ec6dc..8827e3f18b 100644 --- a/deepmd/pt/model/atomic_model/base_atomic_model.py +++ b/deepmd/pt/model/atomic_model/base_atomic_model.py @@ -71,7 +71,8 @@ def atomic_output_def(self) -> FittingOutputDef: else: old_list = list(old_def.get_data().values()) return FittingOutputDef( - old_list.append( + old_list # noqa:RUF005 + + [ OutputVariableDef( name="mask", shape=[1], @@ -79,7 +80,7 @@ def atomic_output_def(self) -> FittingOutputDef: r_differentiable=False, c_differentiable=False, ) - ) + ] ) def forward_common_atomic(