(self, data, precision, floatmode, suppress_small, sign=False,
*, legacy=None)
| 985 | class FloatingFormat: |
| 986 | """ Formatter for subtypes of np.floating """ |
| 987 | def __init__(self, data, precision, floatmode, suppress_small, sign=False, |
| 988 | *, legacy=None): |
| 989 | # for backcompatibility, accept bools |
| 990 | if isinstance(sign, bool): |
| 991 | sign = '+' if sign else '-' |
| 992 | |
| 993 | self._legacy = legacy |
| 994 | if self._legacy <= 113: |
| 995 | # when not 0d, legacy does not support '-' |
| 996 | if data.shape != () and sign == '-': |
| 997 | sign = ' ' |
| 998 | |
| 999 | self.floatmode = floatmode |
| 1000 | if floatmode == 'unique': |
| 1001 | self.precision = None |
| 1002 | else: |
| 1003 | self.precision = precision |
| 1004 | |
| 1005 | self.precision = _none_or_positive_arg(self.precision, 'precision') |
| 1006 | |
| 1007 | self.suppress_small = suppress_small |
| 1008 | self.sign = sign |
| 1009 | self.exp_format = False |
| 1010 | self.large_exponent = False |
| 1011 | self.fillFormat(data) |
| 1012 | |
| 1013 | def fillFormat(self, data): |
| 1014 | # only the finite values are used to compute the number of digits |
nothing calls this directly
no test coverage detected