Skip to content

Commit

Permalink
[pre-commit.ci] pre-commit autoupdate (deepmodeling#3700)
Browse files Browse the repository at this point in the history
<!--pre-commit.ci start-->
updates:
- [github.com/astral-sh/ruff-pre-commit: v0.3.7 →
v0.4.1](astral-sh/ruff-pre-commit@v0.3.7...v0.4.1)
- [github.com/pre-commit/mirrors-clang-format: v18.1.3 →
v18.1.4](pre-commit/mirrors-clang-format@v18.1.3...v18.1.4)
- [github.com/njzjz/mirrors-bibtex-tidy: v1.11.0 →
v1.13.0](njzjz/mirrors-bibtex-tidy@v1.11.0...v1.13.0)
<!--pre-commit.ci end-->

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
pre-commit-ci[bot] authored and Mathieu Taillefumier committed Sep 18, 2024
1 parent 8a7827d commit 57c83f2
Show file tree
Hide file tree
Showing 19 changed files with 35 additions and 35 deletions.
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ repos:
exclude: ^source/3rdparty
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.3.7
rev: v0.4.1
hooks:
- id: ruff
args: ["--fix"]
Expand All @@ -52,7 +52,7 @@ repos:
- id: blacken-docs
# C++
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: v18.1.3
rev: v18.1.4
hooks:
- id: clang-format
exclude: ^source/3rdparty|source/lib/src/gpu/cudart/.+\.inc
Expand All @@ -76,7 +76,7 @@ repos:
- id: cmake-format
#- id: cmake-lint
- repo: https://github.com/njzjz/mirrors-bibtex-tidy
rev: v1.11.0
rev: v1.13.0
hooks:
- id: bibtex-tidy
args:
Expand Down
12 changes: 6 additions & 6 deletions source/api_c/include/deepmd.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ namespace hpp {
**/
struct deepmd_exception : public std::runtime_error {
public:
deepmd_exception() : runtime_error("DeePMD-kit C API Error!"){};
deepmd_exception() : runtime_error("DeePMD-kit C API Error!") {};
deepmd_exception(const std::string &msg)
: runtime_error(std::string("DeePMD-kit C API Error: ") + msg){};
: runtime_error(std::string("DeePMD-kit C API Error: ") + msg) {};
};
} // namespace hpp
} // namespace deepmd
Expand Down Expand Up @@ -620,7 +620,7 @@ class DeepPot {
/**
* @brief DP constructor without initialization.
**/
DeepPot() : dp(nullptr){};
DeepPot() : dp(nullptr) {};
~DeepPot() { DP_DeleteDeepPot(dp); };
/**
* @brief DP constructor with initialization.
Expand Down Expand Up @@ -1160,7 +1160,7 @@ class DeepPotModelDevi {
/**
* @brief DP model deviation constructor without initialization.
**/
DeepPotModelDevi() : dp(nullptr){};
DeepPotModelDevi() : dp(nullptr) {};
~DeepPotModelDevi() { DP_DeleteDeepPotModelDevi(dp); };
/**
* @brief DP model deviation constructor with initialization.
Expand Down Expand Up @@ -1785,7 +1785,7 @@ class DeepTensor {
/**
* @brief Deep Tensor constructor without initialization.
**/
DeepTensor() : dt(nullptr){};
DeepTensor() : dt(nullptr) {};
~DeepTensor() { DP_DeleteDeepTensor(dt); };
/**
* @brief DeepTensor constructor with initialization.
Expand Down Expand Up @@ -2161,7 +2161,7 @@ class DipoleChargeModifier {
/**
* @brief DipoleChargeModifier constructor without initialization.
**/
DipoleChargeModifier() : dcm(nullptr){};
DipoleChargeModifier() : dcm(nullptr) {};
~DipoleChargeModifier() { DP_DeleteDipoleChargeModifier(dcm); };
/**
* @brief DipoleChargeModifier constructor with initialization.
Expand Down
2 changes: 1 addition & 1 deletion source/api_c/tests/test_deeppot_a_hpp.cc
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ TYPED_TEST(TestInferDeepPotAHPP, cpu_build_nlist_numfv) {

public:
MyModel(deepmd::hpp::DeepPot& dp_, const std::vector<int>& atype_)
: mydp(dp_), atype(atype_){};
: mydp(dp_), atype(atype_) {};
virtual void compute(double& ener,
std::vector<VALUETYPE>& force,
std::vector<VALUETYPE>& virial,
Expand Down
4 changes: 2 additions & 2 deletions source/api_cc/include/DataModifier.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class DipoleChargeModifierBase {
/**
* @brief Dipole charge modifier without initialization.
**/
DipoleChargeModifierBase(){};
DipoleChargeModifierBase() {};
/**
* @brief Dipole charge modifier without initialization.
* @param[in] model The name of the frozen model file.
Expand All @@ -24,7 +24,7 @@ class DipoleChargeModifierBase {
DipoleChargeModifierBase(const std::string& model,
const int& gpu_rank = 0,
const std::string& name_scope = "");
virtual ~DipoleChargeModifierBase(){};
virtual ~DipoleChargeModifierBase() {};
/**
* @brief Initialize the dipole charge modifier.
* @param[in] model The name of the frozen model file.
Expand Down
4 changes: 2 additions & 2 deletions source/api_cc/include/DeepPot.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ class DeepPotBase {
/**
* @brief DP constructor without initialization.
**/
DeepPotBase(){};
virtual ~DeepPotBase(){};
DeepPotBase() {};
virtual ~DeepPotBase() {};
/**
* @brief DP constructor with initialization.
* @param[in] model The name of the frozen model file.
Expand Down
4 changes: 2 additions & 2 deletions source/api_cc/include/DeepTensor.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ class DeepTensorBase {
/**
* @brief Deep Tensor constructor without initialization.
**/
DeepTensorBase(){};
virtual ~DeepTensorBase(){};
DeepTensorBase() {};
virtual ~DeepTensorBase() {};
/**
* @brief Deep Tensor constructor with initialization..
* @param[in] model The name of the frozen model file.
Expand Down
4 changes: 2 additions & 2 deletions source/api_cc/include/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -164,9 +164,9 @@ void load_op_library();
**/
struct tf_exception : public deepmd::deepmd_exception {
public:
tf_exception() : deepmd::deepmd_exception("TensorFlow Error!"){};
tf_exception() : deepmd::deepmd_exception("TensorFlow Error!") {};
tf_exception(const std::string& msg)
: deepmd::deepmd_exception(std::string("TensorFlow Error: ") + msg){};
: deepmd::deepmd_exception(std::string("TensorFlow Error: ") + msg) {};
};

std::string name_prefix(const std::string& name_scope);
Expand Down
2 changes: 1 addition & 1 deletion source/api_cc/src/DataModifier.cc
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ DipoleChargeModifier::DipoleChargeModifier(const std::string& model,
init(model, gpu_rank, name_scope_);
}

DipoleChargeModifier::~DipoleChargeModifier(){};
DipoleChargeModifier::~DipoleChargeModifier() {};

void DipoleChargeModifier::init(const std::string& model,
const int& gpu_rank,
Expand Down
2 changes: 1 addition & 1 deletion source/api_cc/tests/test_deeppot_a.cc
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ TYPED_TEST(TestInferDeepPotA, cpu_build_nlist_numfv) {

public:
MyModel(deepmd::DeepPot& dp_, const std::vector<int>& atype_)
: mydp(dp_), atype(atype_){};
: mydp(dp_), atype(atype_) {};
virtual void compute(double& ener,
std::vector<VALUETYPE>& force,
std::vector<VALUETYPE>& virial,
Expand Down
2 changes: 1 addition & 1 deletion source/api_cc/tests/test_deeppot_pt.cc
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ TYPED_TEST(TestInferDeepPotAPt, cpu_build_nlist_numfv) {

public:
MyModel(deepmd::DeepPot& dp_, const std::vector<int>& atype_)
: mydp(dp_), atype(atype_){};
: mydp(dp_), atype(atype_) {};
virtual void compute(double& ener,
std::vector<VALUETYPE>& force,
std::vector<VALUETYPE>& virial,
Expand Down
2 changes: 1 addition & 1 deletion source/api_cc/tests/test_deeppot_r.cc
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ TYPED_TEST(TestInferDeepPotR, cpu_build_nlist_numfv) {

public:
MyModel(deepmd::DeepPot& dp_, const std::vector<int>& atype_)
: mydp(dp_), atype(atype_){};
: mydp(dp_), atype(atype_) {};
virtual void compute(double& ener,
std::vector<VALUETYPE>& force,
std::vector<VALUETYPE>& virial,
Expand Down
8 changes: 4 additions & 4 deletions source/lib/include/errors.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ namespace deepmd {
**/
struct deepmd_exception : public std::runtime_error {
public:
deepmd_exception() : runtime_error("DeePMD-kit Error!"){};
deepmd_exception() : runtime_error("DeePMD-kit Error!") {};
deepmd_exception(const std::string& msg)
: runtime_error(std::string("DeePMD-kit Error: ") + msg){};
: runtime_error(std::string("DeePMD-kit Error: ") + msg) {};
};

struct deepmd_exception_oom : public deepmd_exception {
public:
deepmd_exception_oom() : deepmd_exception("DeePMD-kit OOM!"){};
deepmd_exception_oom() : deepmd_exception("DeePMD-kit OOM!") {};
deepmd_exception_oom(const std::string& msg)
: deepmd_exception(std::string("DeePMD-kit OOM: ") + msg){};
: deepmd_exception(std::string("DeePMD-kit OOM: ") + msg) {};
};
}; // namespace deepmd
6 changes: 3 additions & 3 deletions source/lib/include/neighbor_list.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ struct InputNlist {
int* numneigh;
/// Array stores the core region atom's neighbor index
int** firstneigh;
InputNlist() : inum(0), ilist(NULL), numneigh(NULL), firstneigh(NULL){};
InputNlist() : inum(0), ilist(NULL), numneigh(NULL), firstneigh(NULL) {};
InputNlist(int inum_, int* ilist_, int* numneigh_, int** firstneigh_)
: inum(inum_),
ilist(ilist_),
numneigh(numneigh_),
firstneigh(firstneigh_){};
~InputNlist(){};
firstneigh(firstneigh_) {};
~InputNlist() {};
};

/**
Expand Down
2 changes: 1 addition & 1 deletion source/lmp/pppm_dplr.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class PPPMDPLR : public PPPM {
#else
PPPMDPLR(class LAMMPS *);
#endif
~PPPMDPLR() override{};
~PPPMDPLR() override {};
void init() override;
const std::vector<double> &get_fele() const { return fele; };

Expand Down
2 changes: 1 addition & 1 deletion source/op/tf/add_flt_nvnmd.cc
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ template <typename Device, typename FPTYPE>
class AddFltNvnmdOp : public OpKernel {
public:
/// Constructor.
explicit AddFltNvnmdOp(OpKernelConstruction* context) : OpKernel(context){};
explicit AddFltNvnmdOp(OpKernelConstruction* context) : OpKernel(context) {};

/// Compute the descriptor
/// param: context
Expand Down
2 changes: 1 addition & 1 deletion source/op/tf/copy_flt_nvnmd.cc
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ template <typename Device, typename FPTYPE>
class CopyFltNvnmdOp : public OpKernel {
public:
/// Constructor.
explicit CopyFltNvnmdOp(OpKernelConstruction* context) : OpKernel(context){};
explicit CopyFltNvnmdOp(OpKernelConstruction* context) : OpKernel(context) {};

/// Compute the descriptor
/// param: context
Expand Down
2 changes: 1 addition & 1 deletion source/op/tf/dotmul_flt_nvnmd.cc
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class DotmulFltNvnmdOp : public OpKernel {
public:
/// Constructor.
explicit DotmulFltNvnmdOp(OpKernelConstruction *context)
: OpKernel(context){};
: OpKernel(context) {};

/// Compute the descriptor
/// param: context
Expand Down
2 changes: 1 addition & 1 deletion source/op/tf/flt_nvnmd.cc
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ template <typename Device, typename FPTYPE>
class FltNvnmdOp : public OpKernel {
public:
/// Constructor.
explicit FltNvnmdOp(OpKernelConstruction* context) : OpKernel(context){};
explicit FltNvnmdOp(OpKernelConstruction* context) : OpKernel(context) {};

/// Compute the descriptor
/// param: context
Expand Down
2 changes: 1 addition & 1 deletion source/op/tf/mul_flt_nvnmd.cc
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ template <typename Device, typename FPTYPE>
class MulFltNvnmdOp : public OpKernel {
public:
/// Constructor.
explicit MulFltNvnmdOp(OpKernelConstruction* context) : OpKernel(context){};
explicit MulFltNvnmdOp(OpKernelConstruction* context) : OpKernel(context) {};

/// Compute the descriptor
/// param: context
Expand Down

0 comments on commit 57c83f2

Please sign in to comment.