Skip to content

Commit d1428e0

Browse files
[pre-commit.ci] pre-commit autoupdate (#4948)
<!--pre-commit.ci start--> updates: - [github.com/astral-sh/ruff-pre-commit: v0.12.10 → v0.12.11](astral-sh/ruff-pre-commit@v0.12.10...v0.12.11) - [github.com/pre-commit/mirrors-clang-format: v20.1.8 → v21.1.0](pre-commit/mirrors-clang-format@v20.1.8...v21.1.0) <!--pre-commit.ci end--> --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent adcacf9 commit d1428e0

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+2660
-2660
lines changed

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ repos:
2929
exclude: ^source/3rdparty
3030
- repo: https://github.com/astral-sh/ruff-pre-commit
3131
# Ruff version.
32-
rev: v0.12.10
32+
rev: v0.12.11
3333
hooks:
3434
- id: ruff
3535
args: ["--fix"]
@@ -60,7 +60,7 @@ repos:
6060
- id: blacken-docs
6161
# C++
6262
- repo: https://github.com/pre-commit/mirrors-clang-format
63-
rev: v20.1.8
63+
rev: v21.1.0
6464
hooks:
6565
- id: clang-format
6666
exclude: ^(source/3rdparty|source/lib/src/gpu/cudart/.+\.inc|.+\.ipynb$|.+\.json$)

source/api_c/include/deepmd.hpp

Lines changed: 1063 additions & 1063 deletions
Large diffs are not rendered by default.

source/api_c/tests/test_deepmd_exception.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ TEST(TestDeepmdException, deepmdexception) {
1616
std::string expected_error_message = "DeePMD-kit C API Error: unittest";
1717
try {
1818
throw deepmd::hpp::deepmd_exception("unittest");
19-
} catch (deepmd::hpp::deepmd_exception &ex) {
19+
} catch (deepmd::hpp::deepmd_exception& ex) {
2020
EXPECT_STREQ(expected_error_message.c_str(), ex.what());
2121
}
2222
}

source/api_c/tests/test_utils.h

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ typedef testing::Types<double, float> ValueTypes;
1414
template <typename VALUETYPE>
1515
inline void _fold_back(typename std::vector<VALUETYPE>::iterator out,
1616
const typename std::vector<VALUETYPE>::const_iterator in,
17-
const std::vector<int> &mapping,
17+
const std::vector<int>& mapping,
1818
const int nloc,
1919
const int nall,
2020
const int ndim,
@@ -35,9 +35,9 @@ inline void _fold_back(typename std::vector<VALUETYPE>::iterator out,
3535
}
3636

3737
template <typename VALUETYPE>
38-
inline void _fold_back(std::vector<VALUETYPE> &out,
39-
const std::vector<VALUETYPE> &in,
40-
const std::vector<int> &mapping,
38+
inline void _fold_back(std::vector<VALUETYPE>& out,
39+
const std::vector<VALUETYPE>& in,
40+
const std::vector<int>& mapping,
4141
const int nloc,
4242
const int nall,
4343
const int ndim,
@@ -48,14 +48,14 @@ inline void _fold_back(std::vector<VALUETYPE> &out,
4848
}
4949

5050
template <typename VALUETYPE>
51-
inline void _build_nlist(std::vector<std::vector<int>> &nlist_data,
52-
std::vector<VALUETYPE> &coord_cpy,
53-
std::vector<int> &atype_cpy,
54-
std::vector<int> &mapping,
55-
const std::vector<VALUETYPE> &coord,
56-
const std::vector<int> &atype,
57-
const std::vector<VALUETYPE> &box,
58-
const float &rc) {
51+
inline void _build_nlist(std::vector<std::vector<int>>& nlist_data,
52+
std::vector<VALUETYPE>& coord_cpy,
53+
std::vector<int>& atype_cpy,
54+
std::vector<int>& mapping,
55+
const std::vector<VALUETYPE>& coord,
56+
const std::vector<int>& atype,
57+
const std::vector<VALUETYPE>& box,
58+
const float& rc) {
5959
// convert VALUETYPE to double, it looks like copy_coord only accepts double
6060
std::vector<double> coord_cpy_;
6161
std::vector<double> coord_(coord.begin(), coord.end());
@@ -90,13 +90,13 @@ class EnergyModelTest {
9090
double level =
9191
std::is_same<VALUETYPE, double>::value ? 1e-6 : 1e-2; // expected?
9292
public:
93-
virtual void compute(double &ener,
94-
std::vector<VALUETYPE> &force,
95-
std::vector<VALUETYPE> &virial,
96-
const std::vector<VALUETYPE> &coord,
97-
const std::vector<VALUETYPE> &box) = 0;
98-
void test_f(const std::vector<VALUETYPE> &coord,
99-
const std::vector<VALUETYPE> &box) {
93+
virtual void compute(double& ener,
94+
std::vector<VALUETYPE>& force,
95+
std::vector<VALUETYPE>& virial,
96+
const std::vector<VALUETYPE>& coord,
97+
const std::vector<VALUETYPE>& box) = 0;
98+
void test_f(const std::vector<VALUETYPE>& coord,
99+
const std::vector<VALUETYPE>& box) {
100100
int ndof = coord.size();
101101
double ener;
102102
std::vector<VALUETYPE> force, virial;
@@ -114,8 +114,8 @@ class EnergyModelTest {
114114
EXPECT_LT(fabs(num - ana), level);
115115
}
116116
}
117-
void test_v(const std::vector<VALUETYPE> &coord,
118-
const std::vector<VALUETYPE> &box) {
117+
void test_v(const std::vector<VALUETYPE>& coord,
118+
const std::vector<VALUETYPE>& box) {
119119
std::vector<VALUETYPE> num_diff(9);
120120
double ener;
121121
std::vector<VALUETYPE> force, virial;

0 commit comments

Comments
 (0)