Code Duplication    Length = 13-13 lines in 2 locations

src/amd/io.py 2 locations

@@ 966-978 (lines=13) @@
963
        remove_sites.extend((i for i, n in enumerate(asym_types) if n == 1))
964
965
    # Remove atoms with fractional occupancy or raise ParseError
966
    if disorder != 'all_sites':
967
        for i, dis in enumerate(has_disorder):
968
            if i in remove_sites:
969
                continue
970
            if dis:
971
                if disorder == 'skip':
972
                    raise ParseError(
973
                        f'{block.header} has disorder, pass '
974
                        "disorder='ordered_sites' or 'all_sites' to "
975
                        'remove/ignore disorder'
976
                    )
977
                elif disorder == 'ordered_sites':
978
                    remove_sites.append(i)
979
980
    # Asymmetric unit
981
    asym_unit = [c for i, c in enumerate(asym_unit) if i not in remove_sites]
@@ 772-784 (lines=13) @@
769
        remove_sites.extend(i for i, num in enumerate(asym_types) if num == 1)
770
771
    # Remove atoms with fractional occupancy or raise ParseError
772
    if disorder != 'all_sites':
773
        for i, dis in enumerate(has_disorder):
774
            if i in remove_sites:
775
                continue
776
            if dis:
777
                if disorder == 'skip':
778
                    raise ParseError(
779
                        f'{block.name} has disorder, pass '
780
                        "disorder='ordered_sites' or 'all_sites' to "
781
                        'remove/ignore disorder'
782
                    )
783
                elif disorder == 'ordered_sites':
784
                    remove_sites.append(i)
785
786
    # Asymmetric unit
787
    asym_unit = [c for i, c in enumerate(asym_unit) if i not in remove_sites]