Skip to content

Commit

Permalink
Merge pull request #36 from lcmd-epfl/fix-issue-#33
Browse files Browse the repository at this point in the history
Fix a typo that could mess up spin/charge for open-shell neutral systems
  • Loading branch information
briling authored May 1, 2024
2 parents eeb1faa + ae5163c commit b0bc5c1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
4 changes: 2 additions & 2 deletions qstack/spahm/rho/bond.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@ def main():

if args.filename.endswith('xyz'):
xyzlist = [args.filename]
charge = [int(args.charge) if args.charge else 0]
spin = [int(args.spin) if args.spin else None]
charge = [int(args.charge) if args.charge is not None else 0]
spin = [int(args.spin) if args.spin is not None else None]
else:
xyzlistfile = args.filename
xyzlist = utils.get_xyzlist(xyzlistfile)
Expand Down
5 changes: 4 additions & 1 deletion qstack/spahm/rho/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,10 @@ def load_mols(xyzlist, charge, spin, basis, printlevel=0, units='ANG'):
mols = []
for xyzfile, ch, sp in zip(xyzlist, charge, spin):
if printlevel>0: print(xyzfile, flush=True)
mols.append(compound.xyz_to_mol(xyzfile, basis, charge=0 if ch is None else ch, spin=0 if ch is None else sp, unit=units)) #TODO
mols.append(compound.xyz_to_mol(xyzfile, basis,
charge=0 if ch is None else ch,
spin=0 if sp is None else sp,
unit=units))
if printlevel>0: print()
return mols

Expand Down

0 comments on commit b0bc5c1

Please sign in to comment.