155155 "lat" : partial (pticker .SimpleFormatter , negpos = "SN" ),
156156 "lon" : partial (pticker .SimpleFormatter , negpos = "WE" , wraprange = (- 180 , 180 )),
157157 "deg" : partial (pticker .SimpleFormatter , suffix = "\N{DEGREE SIGN} " ),
158- "deglat" : partial (
159- pticker .SimpleFormatter , suffix = "\N{DEGREE SIGN} " , negpos = "SN"
160- ),
158+ "deglat" : partial (pticker .SimpleFormatter , suffix = "\N{DEGREE SIGN} " , negpos = "SN" ),
161159 "deglon" : partial (
162160 pticker .SimpleFormatter ,
163161 suffix = "\N{DEGREE SIGN} " ,
@@ -862,9 +860,7 @@ def __init__(self, *args, N=None, samples=None, name=None, **kwargs):
862860 elif self ._is_all_cyclers (args ):
863861 self ._handle_cycler_args (args , cycler_props , kwargs )
864862 else :
865- self ._handle_colormap_args (
866- args , cycler_props , kwargs , samples , name
867- )
863+ self ._handle_colormap_args (args , cycler_props , kwargs , samples , name )
868864
869865 self ._iterator = None # internal reference for cycle
870866
@@ -887,17 +883,13 @@ def _handle_empty_args(self, props, kwargs):
887883 """Handle case when no positional arguments are provided."""
888884 props .setdefault ("color" , "black" )
889885 if kwargs :
890- warnings ._warn_ultraplot (
891- f"Ignoring Cycle() keyword arg(s) { kwargs } ."
892- )
886+ warnings ._warn_ultraplot (f"Ignoring Cycle() keyword arg(s) { kwargs } ." )
893887 self ._build_cycler (())
894888
895889 def _handle_cycler_args (self , args , props , kwargs ):
896890 """Handle case when arguments are cycler objects."""
897891 if kwargs :
898- warnings ._warn_ultraplot (
899- f"Ignoring Cycle() keyword arg(s) { kwargs } ."
900- )
892+ warnings ._warn_ultraplot (f"Ignoring Cycle() keyword arg(s) { kwargs } ." )
901893 if len (args ) == 1 and not props :
902894 self ._build_cycler ((args [0 ].by_key (),))
903895 else :
@@ -912,11 +904,7 @@ def _handle_colormap_args(self, args, props, kwargs, samples, name):
912904 )
913905
914906 cmap = self ._create_colormap (args , name , samples , kwargs )
915- dict_ = {
916- "color" : [
917- c if isinstance (c , str ) else to_hex (c ) for c in cmap .colors
918- ]
919- }
907+ dict_ = {"color" : [c if isinstance (c , str ) else to_hex (c ) for c in cmap .colors ]}
920908 self ._build_cycler ((dict_ , props ))
921909 self .name = _not_none (name , cmap .name )
922910
@@ -946,9 +934,7 @@ def _build_cycler(self, dicts):
946934 # Build cycler with matching property lengths
947935 lengths = [len (value ) for value in props .values ()]
948936 maxlen = np .lcm .reduce (lengths )
949- props = {
950- key : value * (maxlen // len (value )) for key , value in props .items ()
951- }
937+ props = {key : value * (maxlen // len (value )) for key , value in props .items ()}
952938 mcycler = cycler .cycler (** props )
953939 super ().__init__ (mcycler )
954940
@@ -1286,9 +1272,7 @@ def Formatter(formatter, *args, date=False, index=False, **kwargs):
12861272 elif formatter is False :
12871273 formatter = mticker .NullFormatter (* args , ** kwargs )
12881274 elif np .iterable (formatter ):
1289- formatter = (mticker .FixedFormatter , pticker .IndexFormatter )[index ](
1290- formatter
1291- )
1275+ formatter = (mticker .FixedFormatter , pticker .IndexFormatter )[index ](formatter )
12921276 elif callable (formatter ):
12931277 formatter = mticker .FuncFormatter (formatter , * args , ** kwargs )
12941278 else :
@@ -1594,9 +1578,7 @@ def Proj(
15941578 if backend is not None :
15951579 kwargs ["backend" ] = backend
15961580 if kwargs :
1597- warnings ._warn_ultraplot (
1598- f"Ignoring Proj() keyword arg(s): { kwargs !r} ."
1599- )
1581+ warnings ._warn_ultraplot (f"Ignoring Proj() keyword arg(s): { kwargs !r} ." )
16001582 proj = name
16011583 backend = "cartopy" if is_crs else "basemap"
16021584
@@ -1621,19 +1603,14 @@ def Proj(
16211603 message = f"{ name !r} is an unknown cartopy projection class.\n "
16221604 message += "The known cartopy projection classes are:\n "
16231605 message += "\n " .join (
1624- " "
1625- + key
1626- + " " * (max (map (len , PROJS )) - len (key ) + 10 )
1627- + cls .__name__
1606+ " " + key + " " * (max (map (len , PROJS )) - len (key ) + 10 ) + cls .__name__
16281607 for key , cls in PROJS .items ()
16291608 )
16301609 if include_axes :
16311610 from . import axes as paxes # avoid circular imports
16321611
16331612 message = message .replace ("class." , "class or axes subclass." )
1634- message += (
1635- "\n The known axes subclasses are:\n " + paxes ._cls_table
1636- )
1613+ message += "\n The known axes subclasses are:\n " + paxes ._cls_table
16371614 raise ValueError (message ) from None
16381615 if name == "geos" : # fix common mistake
16391616 kwargs .pop ("central_latitude" , None )
@@ -1687,12 +1664,8 @@ def Proj(
16871664 if include_axes :
16881665 from . import axes as paxes # avoid circular imports
16891666
1690- message = message .replace (
1691- "projection." , "projection or axes subclass."
1692- )
1693- message += (
1694- "\n The known axes subclasses are:\n " + paxes ._cls_table
1695- )
1667+ message = message .replace ("projection." , "projection or axes subclass." )
1668+ message += "\n The known axes subclasses are:\n " + paxes ._cls_table
16961669 raise ValueError (message ) from None
16971670
16981671 proj ._proj_backend = backend
0 commit comments