From 5439ec1f85463658756e9974fbf4d1c9f7e355e9 Mon Sep 17 00:00:00 2001 From: my-name Date: Sun, 2 Jun 2024 22:49:53 +0200 Subject: [PATCH] Fix --- cell2mol/new_c2m_driver.py | 4 ++-- cell2mol/new_c2m_module.py | 5 ++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/cell2mol/new_c2m_driver.py b/cell2mol/new_c2m_driver.py index 40d3cc4c..3b53e0ea 100644 --- a/cell2mol/new_c2m_driver.py +++ b/cell2mol/new_c2m_driver.py @@ -124,7 +124,7 @@ newcell = cell2mol(newcell, refcell, sym_ops, reconstruction, charge_assignment, spin_assignment, debug=debug) newcell.assess_errors(mode="reconstruction") - """ + if newcell.error_case == 0 and reconstruction : reconstruction = False charge_assignment = True @@ -145,7 +145,7 @@ # Update reference cell object refcell.save(ref_cell_fname) - """ + # Save unit cell object newcell.save(cell_fname) diff --git a/cell2mol/new_c2m_module.py b/cell2mol/new_c2m_module.py index e3befc2f..dde20856 100644 --- a/cell2mol/new_c2m_module.py +++ b/cell2mol/new_c2m_module.py @@ -17,6 +17,8 @@ def cell2mol(newcell: object, refcell: object, sym_ops, reconstruction: bool=Tru # Cell Reconstruction all_molecules, reconstructed_molecules = reconstuct(refcell, newcell, sym_ops, debug=debug) all_molecules.extend(reconstructed_molecules) + # Get moleclist for the unit cell + newcell = get_moleclist(newcell, refcell, all_molecules, debug=debug) if newcell.error_get_fragments: return newcell elif newcell.error_reconstruction: return newcell @@ -30,9 +32,6 @@ def cell2mol(newcell: object, refcell: object, sym_ops, reconstruction: bool=Tru tini = time.time() if not newcell.error_reconstruction: - # Get moleclist for the unit cell - newcell = get_moleclist(newcell, refcell, all_molecules, debug=debug) - # Get unique species for the reference cell refcell.get_unique_species(debug=debug) print("refcell.unique_species", [specie.formula for specie in refcell.unique_species], refcell.unique_indices)