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 26, 2024
1 parent fc3040b commit 3e70a28
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 3 additions & 1 deletion source/api_cc/include/DeepPotPT.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ class DeepPotPT : public DeepPotBase {
* @param[in] file_content The content of the model file. If it is not empty,
*DP will read from the string instead of the file.
**/
void init(const std::string& model, const int& gpu_rank = 0, const std::string& file_content = "");
void init(const std::string& model,
const int& gpu_rank = 0,
const std::string& file_content = "");

private:
/**
Expand Down
6 changes: 4 additions & 2 deletions source/api_cc/src/DeepPotPT.cc
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,15 @@ DeepPotPT::DeepPotPT(const std::string& model,
const std::string& file_content)
: inited(false) {
try {
init(model, gpu_rank,file_content);
init(model, gpu_rank, file_content);
} catch (...) {
// Clean up and rethrow, as the destructor will not be called
throw;
}
}
void DeepPotPT::init(const std::string& model, const int& gpu_rank, const std::string& file_content = "") {
void DeepPotPT::init(const std::string& model,
const int& gpu_rank,
const std::string& file_content = "") {
if (inited) {
std::cerr << "WARNING: deepmd-kit should not be initialized twice, do "
"nothing at the second call of initializer"
Expand Down

0 comments on commit 3e70a28

Please sign in to comment.