diff --git a/skbio/alignment/tests/test_ssw.py b/skbio/alignment/tests/test_ssw.py index 4cddb6771..315a5301b 100644 --- a/skbio/alignment/tests/test_ssw.py +++ b/skbio/alignment/tests/test_ssw.py @@ -86,7 +86,7 @@ def _check_bit_flag_sets_properties_falsy_or_negative( kwarg = {} def falsy_or_negative(alignment, prop): - if type(alignment[prop]) is int: + if isinstance(alignment[prop], int): return alignment[prop] < 0 else: return not alignment[prop] diff --git a/skbio/diversity/alpha/_lladser.py b/skbio/diversity/alpha/_lladser.py index e38f74970..eeaf64ce0 100644 --- a/skbio/diversity/alpha/_lladser.py +++ b/skbio/diversity/alpha/_lladser.py @@ -426,8 +426,6 @@ def _ul_confidence_bounds(f, r, alpha): (6, 6, 0.95): (1.8207383, 2.58658608), (5, 7, 0.95): (2.48303930, 3.22806682), (3, 14, 0.95): (7.17185045, 8.27008349), - (2.5, 19, 0.95): (11.26109001, 11.96814857), - (1.5, 94, 0.95): (75.9077267, 76.5492088), (1.25, 309, 0.95): (275.661191, 275.949782) } diff --git a/skbio/io/format/gff3.py b/skbio/io/format/gff3.py index 084837268..68f2fcc8f 100644 --- a/skbio/io/format/gff3.py +++ b/skbio/io/format/gff3.py @@ -359,9 +359,9 @@ def _interval_metadata_to_gff3(obj, fh, seq_id, skip_subregion=True): def _construct_seq(fh, constructor=DNA, seq_num=1): lines = [] - for i, (data_type, seq_id, l) in enumerate(_yield_record(fh), 1): + for i, (data_type, seq_id, L) in enumerate(_yield_record(fh), 1): if data_type == 'data' and seq_num == i: - lines = l + lines = L seq = _get_nth_sequence(_fasta_to_generator(fh, constructor=constructor), seq_num=seq_num) seq.interval_metadata = _parse_record(lines, len(seq)) diff --git a/skbio/io/registry.py b/skbio/io/registry.py index d4d04b14b..c272c747e 100644 --- a/skbio/io/registry.py +++ b/skbio/io/registry.py @@ -887,7 +887,7 @@ def sniffer(self, override=False): (False, {}) """ - if not type(override) is bool: + if isinstance(override, bool) is not True: raise InvalidRegistrationError("`override` must be a bool not %r" % override) diff --git a/skbio/sequence/_sequence.py b/skbio/sequence/_sequence.py index 2f9bfa0c1..da2a39386 100644 --- a/skbio/sequence/_sequence.py +++ b/skbio/sequence/_sequence.py @@ -648,7 +648,7 @@ def __init__(self, sequence, metadata=None, positional_metadata=None, self._convert_to_uppercase(lowercase_mask) # If it isn't True, it must be a string_type - if not (lowercase is True): + if lowercase is not True: self.positional_metadata[lowercase] = lowercase_mask else: raise TypeError("lowercase keyword argument expected a bool or " @@ -1414,7 +1414,7 @@ def replace(self, where, character): True """ - if type(character) is not bytes: + if isinstance(character, bytes) is not True: character = character.encode('ascii') character = ord(character) index = self._munge_to_index_array(where) @@ -2179,7 +2179,7 @@ def _munge_to_sequence(self, other, method): return Sequence(other) def _munge_to_bytestring(self, other, method): - if type(other) is bytes: + if isinstance(other, bytes): return other elif isinstance(other, str): return other.encode('ascii')