Code Duplication    Length = 13-13 lines in 2 locations

src/amd/io.py 2 locations

@@ 985-997 (lines=13) @@
982
        remove_sites.extend((i for i, n in enumerate(asym_types) if n == 1))
983
984
    # Remove atoms with fractional occupancy or raise ParseError
985
    if disorder != 'all_sites':
986
        for i, dis in enumerate(has_disorder):
987
            if i in remove_sites:
988
                continue
989
            if dis:
990
                if disorder == 'skip':
991
                    raise ParseError(
992
                        f'{block.header} has disorder, pass '
993
                        "disorder='ordered_sites' or 'all_sites' to "
994
                        'remove/ignore disorder'
995
                    )
996
                elif disorder == 'ordered_sites':
997
                    remove_sites.append(i)
998
999
    # Asymmetric unit
1000
    asym_unit = [c for i, c in enumerate(asym_unit) if i not in remove_sites]
@@ 792-804 (lines=13) @@
789
        remove_sites.extend(i for i, num in enumerate(asym_types) if num == 1)
790
791
    # Remove atoms with fractional occupancy or raise ParseError
792
    if disorder != 'all_sites':
793
        for i, dis in enumerate(has_disorder):
794
            if i in remove_sites:
795
                continue
796
            if dis:
797
                if disorder == 'skip':
798
                    raise ParseError(
799
                        f'{block.name} has disorder, pass '
800
                        "disorder='ordered_sites' or 'all_sites' to "
801
                        'remove/ignore disorder'
802
                    )
803
                elif disorder == 'ordered_sites':
804
                    remove_sites.append(i)
805
806
    # Asymmetric unit
807
    asym_unit = [c for i, c in enumerate(asym_unit) if i not in remove_sites]