@@ -139,6 +139,9 @@ def wrapper(
139
139
error : bool = True ,
140
140
default : str = None ,
141
141
) -> List [Optional [str ]]:
142
+ """
143
+ This decorator will add `error` and `default` kwargs to the decorated Mapper function.
144
+ """
142
145
if key not in valid_keys :
143
146
if error :
144
147
raise KeyError (
@@ -645,21 +648,26 @@ def __getattr__(self, attr):
645
648
def plot (self ):
646
649
return _CFWrappedPlotMethods (self ._obj , self )
647
650
648
- def _describe (self ):
651
+ def describe (self ):
652
+ """
653
+ Print a string repr to screen.
654
+ """
649
655
text = "Axes:\n "
650
656
for key in _AXIS_NAMES :
651
- text += f"\t { key } : { _get_axis_coord (self ._obj , key , error = False , default = None )} \n "
657
+ text += f"\t { key } : { _get_axis_coord (self ._obj , key , error = False )} \n "
652
658
653
659
text += "\n Coordinates:\n "
654
660
for key in _COORD_NAMES :
655
- text += f"\t { key } : { _get_axis_coord (self ._obj , key , error = False , default = None )} \n "
661
+ text += f"\t { key } : { _get_axis_coord (self ._obj , key , error = False )} \n "
656
662
657
663
text += "\n Cell Measures:\n "
658
664
for measure in _CELL_MEASURES :
659
665
if isinstance (self ._obj , xr .Dataset ):
660
666
text += f"\t { measure } : unsupported\n "
661
667
else :
662
- text += f"\t { measure } : { _get_measure (self ._obj , measure , error = False , default = None )} \n "
668
+ text += (
669
+ f"\t { measure } : { _get_measure (self ._obj , measure , error = False )} \n "
670
+ )
663
671
664
672
text += "\n Standard Names:\n "
665
673
if isinstance (self ._obj , xr .DataArray ):
@@ -670,13 +678,7 @@ def _describe(self):
670
678
text += "\n " .join (
671
679
textwrap .wrap (f"{ stdnames !r} " , 70 , break_long_words = False )
672
680
)
673
- return text
674
-
675
- def describe (self ):
676
- """
677
- Print a string repr to screen.
678
- """
679
- print (self ._describe ())
681
+ print (text )
680
682
681
683
def get_valid_keys (self ) -> Set [str ]:
682
684
"""
0 commit comments