##// END OF EJS Templates
add local numpy import
Peter Corke -
Show More
@@ -636,7 +636,6 b' class PlainTextFormatter(BaseFormatter):'
636 636
637 637 This parameter can be set via the '%precision' magic.
638 638 """
639
640 639 new = change['new']
641 640 if '%' in new:
642 641 # got explicit format string
@@ -678,7 +677,9 b' class PlainTextFormatter(BaseFormatter):'
678 677 def _type_printers_default(self):
679 678 d = pretty._type_pprinters.copy()
680 679 d[float] = lambda obj,p,cycle: p.text(self.float_format%obj)
680 # if NumPy is used, set precision for its float64 type
681 681 if 'numpy' in sys.modules:
682 import numpy
682 683 d[numpy.float64] = lambda obj,p,cycle: p.text(self.float_format%obj)
683 684 return d
684 685
General Comments 0
You need to be logged in to leave comments. Login now