Code Duplication    Length = 13-13 lines in 2 locations

src/amd/io.py 2 locations

@@ 1022-1034 (lines=13) @@
1019
        remove_sites.extend((i for i, n in enumerate(asym_types) if n == 1))
1020
1021
    # Remove atoms with fractional occupancy or raise ParseError
1022
    if disorder != 'all_sites':
1023
        for i, dis in enumerate(has_disorder):
1024
            if i in remove_sites:
1025
                continue
1026
            if dis:
1027
                if disorder == 'skip':
1028
                    raise ParseError(
1029
                        f'{block.header} has disorder, pass '
1030
                        "disorder='ordered_sites' or 'all_sites' to "
1031
                        'remove/ignore disorder'
1032
                    )
1033
                elif disorder == 'ordered_sites':
1034
                    remove_sites.append(i)
1035
1036
    # Asymmetric unit
1037
    asym_unit = [c for i, c in enumerate(asym_unit) if i not in remove_sites]
@@ 824-836 (lines=13) @@
821
        remove_sites.extend(i for i, num in enumerate(asym_types) if num == 1)
822
823
    # Remove atoms with fractional occupancy or raise ParseError
824
    if disorder != 'all_sites':
825
        for i, dis in enumerate(has_disorder):
826
            if i in remove_sites:
827
                continue
828
            if dis:
829
                if disorder == 'skip':
830
                    raise ParseError(
831
                        f'{block.name} has disorder, pass '
832
                        "disorder='ordered_sites' or 'all_sites' to "
833
                        'remove/ignore disorder'
834
                    )
835
                elif disorder == 'ordered_sites':
836
                    remove_sites.append(i)
837
838
    # Asymmetric unit
839
    asym_unit = [c for i, c in enumerate(asym_unit) if i not in remove_sites]