From eee66327cb403cba52bc976cd9a9e0b014738576 Mon Sep 17 00:00:00 2001 From: Jinzhe Zeng Date: Thu, 2 Nov 2023 16:56:51 -0400 Subject: [PATCH 1/2] raise error instead of sys.exit `sys.exit` is not an exemplary implementation when one wants to catch the error. --- dpdata/qe/scf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dpdata/qe/scf.py b/dpdata/qe/scf.py index d2f5dead4..89d958f5b 100755 --- a/dpdata/qe/scf.py +++ b/dpdata/qe/scf.py @@ -55,7 +55,7 @@ def get_cell(lines): raise RuntimeError("parameter 'a' or 'celldm(1)' cannot be found.") ret = np.array([[a, 0.0, 0.0], [0.0, a, 0.0], [0.0, 0.0, a]]) else: - sys.exit("ibrav > 1 not supported yet.") + raise RuntimeError("ibrav > 1 not supported yet.") return ret From 61ba0b4b5342fa3af040b663cc89b9ba8f48ce63 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Thu, 2 Nov 2023 20:57:39 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- dpdata/qe/scf.py | 1 - 1 file changed, 1 deletion(-) diff --git a/dpdata/qe/scf.py b/dpdata/qe/scf.py index 89d958f5b..bd8254c3b 100755 --- a/dpdata/qe/scf.py +++ b/dpdata/qe/scf.py @@ -1,7 +1,6 @@ #!/usr/bin/env python3 import os -import sys import numpy as np