(self, data, precision, floatmode, suppress_small, sign=False,
*, legacy=None)
| 905 | class FloatingFormat: |
| 906 | """ Formatter for subtypes of np.floating """ |
| 907 | def __init__(self, data, precision, floatmode, suppress_small, sign=False, |
| 908 | *, legacy=None): |
| 909 | # for backcompatibility, accept bools |
| 910 | if isinstance(sign, bool): |
| 911 | sign = '+' if sign else '-' |
| 912 | |
| 913 | self._legacy = legacy |
| 914 | if self._legacy <= 113: |
| 915 | # when not 0d, legacy does not support '-' |
| 916 | if data.shape != () and sign == '-': |
| 917 | sign = ' ' |
| 918 | |
| 919 | self.floatmode = floatmode |
| 920 | if floatmode == 'unique': |
| 921 | self.precision = None |
| 922 | else: |
| 923 | self.precision = precision |
| 924 | |
| 925 | self.precision = _none_or_positive_arg(self.precision, 'precision') |
| 926 | |
| 927 | self.suppress_small = suppress_small |
| 928 | self.sign = sign |
| 929 | self.exp_format = False |
| 930 | self.large_exponent = False |
| 931 | |
| 932 | self.fillFormat(data) |
| 933 | |
| 934 | def fillFormat(self, data): |
| 935 | # only the finite values are used to compute the number of digits |
nothing calls this directly
no test coverage detected