Skip to content

Commit

Permalink
Need Confirm: set translation as tuple
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielYang59 committed Jun 12, 2024
1 parent 796c379 commit 9551db2
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 32 deletions.
8 changes: 0 additions & 8 deletions pymatgen/io/lobster/outputs.py
Original file line number Diff line number Diff line change
Expand Up @@ -429,14 +429,6 @@ def __init__(

labels, atoms1, atoms2, lens, translations, nums, icohps = [], [], [], [], [], [], []

# Initialize static variables
label = ""
atom1 = ""
atom2 = ""
length = None
num = None
translation: Vector3D | None = None

for bond in range(n_bonds):
line_parts = data_without_orbitals[bond].split()

Expand Down
48 changes: 24 additions & 24 deletions tests/io/lobster/test_inputs.py
Original file line number Diff line number Diff line change
Expand Up @@ -444,77 +444,77 @@ def test_values(self):
"length": 2.88231,
"number_of_bonds": 3,
"icohp": {Spin.up: -2.18042},
"translation": [0, 0, 0],
"translation": (0, 0, 0),
"orbitals": None,
},
"2": {
"length": 3.10144,
"number_of_bonds": 3,
"icohp": {Spin.up: -1.14347},
"translation": [0, 0, 0],
"translation": (0, 0, 0),
"orbitals": None,
},
"3": {
"length": 2.88231,
"number_of_bonds": 3,
"icohp": {Spin.up: -2.18042},
"translation": [0, 0, 0],
"translation": (0, 0, 0),
"orbitals": None,
},
"4": {
"length": 3.10144,
"number_of_bonds": 3,
"icohp": {Spin.up: -1.14348},
"translation": [0, 0, 0],
"translation": (0, 0, 0),
"orbitals": None,
},
"5": {
"length": 3.05001,
"number_of_bonds": 3,
"icohp": {Spin.up: -1.30006},
"translation": [0, 0, 0],
"translation": (0, 0, 0),
"orbitals": None,
},
"6": {
"length": 2.91676,
"number_of_bonds": 3,
"icohp": {Spin.up: -1.96843},
"translation": [0, 0, 0],
"translation": (0, 0, 0),
"orbitals": None,
},
"7": {
"length": 3.05001,
"number_of_bonds": 3,
"icohp": {Spin.up: -1.30006},
"translation": [0, 0, 0],
"translation": (0, 0, 0),
"orbitals": None,
},
"8": {
"length": 2.91676,
"number_of_bonds": 3,
"icohp": {Spin.up: -1.96843},
"translation": [0, 0, 0],
"translation": (0, 0, 0),
"orbitals": None,
},
"9": {
"length": 3.37522,
"number_of_bonds": 3,
"icohp": {Spin.up: -0.47531},
"translation": [0, 0, 0],
"translation": (0, 0, 0),
"orbitals": None,
},
"10": {
"length": 3.07294,
"number_of_bonds": 3,
"icohp": {Spin.up: -2.38796},
"translation": [0, 0, 0],
"translation": (0, 0, 0),
"orbitals": None,
},
"11": {
"length": 3.37522,
"number_of_bonds": 3,
"icohp": {Spin.up: -0.47531},
"translation": [0, 0, 0],
"translation": (0, 0, 0),
"orbitals": None,
},
}
Expand All @@ -523,77 +523,77 @@ def test_values(self):
"length": 2.88231,
"number_of_bonds": 3,
"icohp": {Spin.up: 0.14245},
"translation": [0, 0, 0],
"translation": (0, 0, 0),
"orbitals": None,
},
"2": {
"length": 3.10144,
"number_of_bonds": 3,
"icohp": {Spin.up: -0.04118},
"translation": [0, 0, 0],
"translation": (0, 0, 0),
"orbitals": None,
},
"3": {
"length": 2.88231,
"number_of_bonds": 3,
"icohp": {Spin.up: 0.14245},
"translation": [0, 0, 0],
"translation": (0, 0, 0),
"orbitals": None,
},
"4": {
"length": 3.10144,
"number_of_bonds": 3,
"icohp": {Spin.up: -0.04118},
"translation": [0, 0, 0],
"translation": (0, 0, 0),
"orbitals": None,
},
"5": {
"length": 3.05001,
"number_of_bonds": 3,
"icohp": {Spin.up: -0.03516},
"translation": [0, 0, 0],
"translation": (0, 0, 0),
"orbitals": None,
},
"6": {
"length": 2.91676,
"number_of_bonds": 3,
"icohp": {Spin.up: 0.10745},
"translation": [0, 0, 0],
"translation": (0, 0, 0),
"orbitals": None,
},
"7": {
"length": 3.05001,
"number_of_bonds": 3,
"icohp": {Spin.up: -0.03516},
"translation": [0, 0, 0],
"translation": (0, 0, 0),
"orbitals": None,
},
"8": {
"length": 2.91676,
"number_of_bonds": 3,
"icohp": {Spin.up: 0.10745},
"translation": [0, 0, 0],
"translation": (0, 0, 0),
"orbitals": None,
},
"9": {
"length": 3.37522,
"number_of_bonds": 3,
"icohp": {Spin.up: -0.12395},
"translation": [0, 0, 0],
"translation": (0, 0, 0),
"orbitals": None,
},
"10": {
"length": 3.07294,
"number_of_bonds": 3,
"icohp": {Spin.up: 0.24714},
"translation": [0, 0, 0],
"translation": (0, 0, 0),
"orbitals": None,
},
"11": {
"length": 3.37522,
"number_of_bonds": 3,
"icohp": {Spin.up: -0.12395},
"translation": [0, 0, 0],
"translation": (0, 0, 0),
"orbitals": None,
},
}
Expand All @@ -602,14 +602,14 @@ def test_values(self):
"length": 2.83189,
"number_of_bonds": 2,
"icohp": {Spin.up: -0.10218, Spin.down: -0.19701},
"translation": [0, 0, 0],
"translation": (0, 0, 0),
"orbitals": None,
},
"2": {
"length": 2.45249,
"number_of_bonds": 1,
"icohp": {Spin.up: -0.28485, Spin.down: -0.58279},
"translation": [0, 0, 0],
"translation": (0, 0, 0),
"orbitals": None,
},
}
Expand Down

0 comments on commit 9551db2

Please sign in to comment.