(self, x, precision, floatmode, suppress_small,
sign=False, *, legacy=None)
| 1245 | class ComplexFloatingFormat: |
| 1246 | """ Formatter for subtypes of np.complexfloating """ |
| 1247 | def __init__(self, x, precision, floatmode, suppress_small, |
| 1248 | sign=False, *, legacy=None): |
| 1249 | # for backcompatibility, accept bools |
| 1250 | if isinstance(sign, bool): |
| 1251 | sign = '+' if sign else '-' |
| 1252 | |
| 1253 | floatmode_real = floatmode_imag = floatmode |
| 1254 | if legacy <= 113: |
| 1255 | floatmode_real = 'maxprec_equal' |
| 1256 | floatmode_imag = 'maxprec' |
| 1257 | |
| 1258 | self.real_format = FloatingFormat( |
| 1259 | x.real, precision, floatmode_real, suppress_small, |
| 1260 | sign=sign, legacy=legacy |
| 1261 | ) |
| 1262 | self.imag_format = FloatingFormat( |
| 1263 | x.imag, precision, floatmode_imag, suppress_small, |
| 1264 | sign='+', legacy=legacy |
| 1265 | ) |
| 1266 | |
| 1267 | def __call__(self, x): |
| 1268 | r = self.real_format(x.real) |
nothing calls this directly
no test coverage detected