|
31 | 31 | Analysis = None |
32 | 32 | Description = None |
33 | 33 |
|
34 | | -__all__ = ["LobsterTaskDocument"] |
| 34 | +__all__ = [ |
| 35 | + "LobsterTaskDocument", |
| 36 | + "LobsteroutModel", |
| 37 | + "LobsterinModel", |
| 38 | + "CondensedBondingAnalysis", |
| 39 | + "StrongestBonds", |
| 40 | +] |
35 | 41 |
|
36 | 42 | logger = logging.getLogger(__name__) |
37 | 43 |
|
@@ -432,9 +438,9 @@ def from_directory( |
432 | 438 |
|
433 | 439 | icohplist_path = dir_name / "ICOHPLIST.lobster.gz" |
434 | 440 | cohpcar_path = dir_name / "COHPCAR.lobster.gz" |
| 441 | + charge_path = dir_name / "CHARGE.lobster.gz" |
435 | 442 | cobicar_path = dir_name / "COBICAR.lobster.gz" |
436 | 443 | coopcar_path = dir_name / "COOPCAR.lobster.gz" |
437 | | - charge_path = dir_name / "CHARGE.lobster.gz" |
438 | 444 | doscar_path = dir_name / "DOSCAR.lobster.gz" |
439 | 445 | structure_path = dir_name / "POSCAR.gz" |
440 | 446 | madelung_energies_path = dir_name / "MadelungEnergies.lobster.gz" |
@@ -638,72 +644,37 @@ def _get_strong_bonds( |
638 | 644 | lengths.append(l) |
639 | 645 |
|
640 | 646 | bond_labels_unique = list(set(bonds)) |
641 | | - sep_blabels: List[List[str]] = [[] for _ in range(len(bond_labels_unique))] |
642 | 647 | sep_icohp: List[List[float]] = [[] for _ in range(len(bond_labels_unique))] |
643 | 648 | sep_lengths: List[List[float]] = [[] for _ in range(len(bond_labels_unique))] |
644 | 649 |
|
645 | 650 | for i, val in enumerate(bond_labels_unique): |
646 | 651 | for j, val2 in enumerate(bonds): |
647 | 652 | if val == val2: |
648 | | - sep_blabels[i].append(val2) |
649 | 653 | sep_icohp[i].append(icohp_all[j]) |
650 | 654 | sep_lengths[i].append(lengths[j]) |
651 | | - if not are_cobis and not are_coops: |
652 | | - bond_dict = {} |
653 | | - for i, lab in enumerate(bond_labels_unique): |
654 | | - label = lab.split("-") |
655 | | - label.sort() |
656 | | - for rel_bnd in relevant_bonds: |
657 | | - rel_bnd_list = rel_bnd.split("-") |
658 | | - rel_bnd_list.sort() |
659 | | - if label == rel_bnd_list: |
660 | | - index = np.argmin(sep_icohp[i]) |
661 | | - bond_dict.update( |
662 | | - { |
663 | | - rel_bnd: { |
664 | | - "ICOHP": min(sep_icohp[i]), |
665 | | - "length": sep_lengths[i][index], |
666 | | - } |
667 | | - } |
668 | | - ) |
669 | | - return bond_dict |
670 | 655 |
|
671 | 656 | if are_cobis and not are_coops: |
672 | | - bond_dict = {} |
673 | | - for i, lab in enumerate(bond_labels_unique): |
674 | | - label = lab.split("-") |
675 | | - label.sort() |
676 | | - for rel_bnd in relevant_bonds: |
677 | | - rel_bnd_list = rel_bnd.split("-") |
678 | | - rel_bnd_list.sort() |
679 | | - if label == rel_bnd_list: |
680 | | - index = np.argmax(sep_icohp[i]) |
681 | | - bond_dict.update( |
682 | | - { |
683 | | - rel_bnd: { |
684 | | - "ICOBI": max(sep_icohp[i]), |
685 | | - "length": sep_lengths[i][index], |
686 | | - } |
| 657 | + prop = "ICOBI" |
| 658 | + elif not are_cobis and are_coops: |
| 659 | + prop = "ICOOP" |
| 660 | + else: |
| 661 | + prop = "ICOHP" |
| 662 | + |
| 663 | + bond_dict = {} |
| 664 | + for i, lab in enumerate(bond_labels_unique): |
| 665 | + label = lab.split("-") |
| 666 | + label.sort() |
| 667 | + for rel_bnd in relevant_bonds: |
| 668 | + rel_bnd_list = rel_bnd.split("-") |
| 669 | + rel_bnd_list.sort() |
| 670 | + if label == rel_bnd_list: |
| 671 | + index = np.argmin(sep_icohp[i]) |
| 672 | + bond_dict.update( |
| 673 | + { |
| 674 | + rel_bnd: { |
| 675 | + prop: min(sep_icohp[i]), |
| 676 | + "length": sep_lengths[i][index], |
687 | 677 | } |
688 | | - ) |
689 | | - return bond_dict |
690 | | - |
691 | | - if not are_cobis and are_coops: |
692 | | - bond_dict = {} |
693 | | - for i, lab in enumerate(bond_labels_unique): |
694 | | - label = lab.split("-") |
695 | | - label.sort() |
696 | | - for rel_bnd in relevant_bonds: |
697 | | - rel_bnd_list = rel_bnd.split("-") |
698 | | - rel_bnd_list.sort() |
699 | | - if label == rel_bnd_list: |
700 | | - index = np.argmax(sep_icohp[i]) |
701 | | - bond_dict.update( |
702 | | - { |
703 | | - rel_bnd: { |
704 | | - "ICOOP": max(sep_icohp[i]), |
705 | | - "length": sep_lengths[i][index], |
706 | | - } |
707 | | - } |
708 | | - ) |
709 | | - return bond_dict |
| 678 | + } |
| 679 | + ) |
| 680 | + return bond_dict |
0 commit comments