Skip to content

Commit

Permalink
Merge pull request #96 from e-kwsm/E712
Browse files Browse the repository at this point in the history
fix: fix comparison against True/False
  • Loading branch information
AlexHeide authored Aug 19, 2024
2 parents d46c3d3 + 362049b commit db3eb00
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions optking/addIntcos.py
Original file line number Diff line number Diff line change
Expand Up @@ -376,14 +376,14 @@ def add_oofp_from_connectivity(C, intcos, geom):
# Find adjacent atoms
vertex_atoms = []
for T in terminal_atoms:
vertex_atoms.append(np.where(C[T] == True)[0][0])
vertex_atoms.append(np.where(C[T])[0][0])

for (T, V) in zip(terminal_atoms, vertex_atoms):
if Nneighbors[V] < 3:
pass
# Find at least 2 other/side atoms
side = []
for N in np.where(C[V] == True)[0]:
for N in np.where(C[V])[0]:
if N == T:
pass
else:
Expand Down
2 changes: 1 addition & 1 deletion optking/tests/test_atom.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def test_atom():
success = qc_output['success']
Etraj = qc_output["trajectory"][-1]['extras']['qcvars']['CURRENT ENERGY']

assert qc_output['success'] == False
assert not qc_output['success']
assert qc_output["error"]["error_message"] == "There is only 1 atom. Nothing to optimize. Computing energy."
assert psi4.compare_values(E, RefEnergy, 6, "Atom energy (energies)")
assert psi4.compare_values(Etraj, RefEnergy, 6, "Atom energy (trajectory)")
Expand Down
2 changes: 1 addition & 1 deletion optking/tests/test_atom_stepwise.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def test_atom_stepwise():
E = qc_output['energies'][-1]
Etraj = qc_output["trajectory"][-1]['extras']['qcvars']['CURRENT ENERGY']

assert qc_output['success'] == False
assert not qc_output['success']
assert qc_output["error"]["error_message"] == "There is only 1 atom. Nothing to optimize. Computing energy."
assert psi4.compare_values(RefEnergy, E, 6, "Atom energy (energies)")
assert psi4.compare_values(RefEnergy, E, 6, "Atom energy (trajectory)")
Expand Down

0 comments on commit db3eb00

Please sign in to comment.