Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
choglass committed Jun 2, 2024
1 parent be4455f commit 1946ae3
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 11 deletions.
24 changes: 14 additions & 10 deletions cell2mol/new_c2m_driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,13 +156,16 @@
# Summary
surmmary = open(surmmary_fname, "w")
sys.stdout = surmmary
print(name)
print("*** Reference molecules ***")
print(refcell)
print_output(refcell.refmoleclist)

if hasattr(newcell, "moleclist"):
print("***Unit cell molecules ***")
print(newcell)
print_output(newcell.moleclist)

print("***Unit cell molecules ***")
print(newcell)
print_output(newcell.moleclist)
surmmary.close()
sys.stdout = stdout

Expand All @@ -176,11 +179,12 @@
sys.stdout = stdout

# Error handling
case = newcell.error_case
error_fname = os.path.join(current_dir, f"unitcell_error_{case}.out")
error = open(error_fname, "w")
sys.stdout = error
handle_error(case)
error.close()
sys.stdout = stdout
if hasattr(newcell, "error_case"):
case = newcell.error_case
error_fname = os.path.join(current_dir, f"unitcell_error_{case}.out")
error = open(error_fname, "w")
sys.stdout = error
handle_error(case)
error.close()
sys.stdout = stdout

1 change: 0 additions & 1 deletion cell2mol/read_write.py
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,6 @@ def parse_formula_with_quantity(formula: str):
######################################################
def print_output(moleclist):

print(moleclist[0].get_parent("reference").name)
for idx, mol in enumerate(moleclist):
if mol.iscomplex:
if hasattr(mol, "totcharge") and hasattr(mol, "spin"):
Expand Down

0 comments on commit 1946ae3

Please sign in to comment.