44__all__ = ["setas" ]
55import re
66import copy
7- from collections .abc import MutableMapping , Mapping , Iterable
7+ from collections .abc import MutableMapping , Iterable
88
99import numpy as np
1010
11- from ..compat import string_types , int_types , index_types , _pattern_type
11+ from ..compat import string_types , index_types , _pattern_type
1212from ..tools import AttributeStore , isiterable , typedList , isLikeList
1313from .utils import decode_string
1414
@@ -339,7 +339,8 @@ def __contains__(self, item):
339339 def __delitem__ (self , name ):
340340 """Unset either by column index or column assignment.
341341
342- Equivalent to unsetting the same object."""
342+ Equivalent to unsetting the same object.
343+ """
343344 self .unset (name )
344345
345346 def __eq__ (self , other ):
@@ -445,7 +446,7 @@ def __setitem__(self, name, value):
445446 case "x" | "y" | "z" | "u" | "v" | "w" | "d" | "e" | "f" | "." | "-" :
446447 for c in self .find_col (value , force_list = True ):
447448 self ._setas [c ] = name
448- case int () | str () | _pattern_type () if value in [ letter for letter in "xyzuvwdef.-" ] :
449+ case int () | str () | _pattern_type () if value in list ( "xyzuvwdef.-" ) :
449450 for c in self .find_col (name , force_list = True ):
450451 self .setas [c ] = value
451452 case _:
@@ -646,21 +647,24 @@ def get(self, key, default=None): # pylint: disable=arguments-differ
646647 def keys (self ):
647648 """Access mapping keys.
648649
649- Mapping keys are the same as iterating over the unique headers"""
650+ Mapping keys are the same as iterating over the unique headers
651+ """
650652 for c in self ._unique_headers :
651653 yield c
652654
653655 def values (self ):
654656 """Access mapping values.
655657
656- Mapping values are the same as iterating over setas."""
658+ Mapping values are the same as iterating over setas.
659+ """
657660 for v in self .setas :
658661 yield v
659662
660663 def items (self ):
661664 """Access mapping items.
662665
663- Mapping items iterates over keys and values."""
666+ Mapping items iterates over keys and values.
667+ """
664668 for k , v in zip (self ._unique_headers , self .setas ):
665669 yield k , v
666670
@@ -746,7 +750,8 @@ def to_dict(self):
746750 """Return the setas attribute as a dictionary.
747751
748752 If multiple columns are assigned to the same type, then the column names are
749- returned as a list. If column headers are duplicated"""
753+ returned as a list. If column headers are duplicated.
754+ """
750755 ret = dict ()
751756 for k , ch in zip (self ._setas , self ._unique_headers ):
752757 if k != "." :
@@ -766,7 +771,8 @@ def to_list(self):
766771 def to_string (self , encode = False ):
767772 """Return the setas attribute encoded as a string.
768773
769- Optionally replaces runs of 3 or more identical characters with a precediung digit."""
774+ Optionally replaces runs of 3 or more identical characters with a precediung digit.
775+ """
770776 expanded = "" .join (self )
771777 if encode :
772778 pat = re .compile (r"((.)\2{2,9})" )
0 commit comments