Code Duplication    Length = 13-13 lines in 2 locations

src/amd/io.py 2 locations

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