(self, x, precision, floatmode, suppress_small,
sign=False, *, legacy=None)
| 1341 | class ComplexFloatingFormat: |
| 1342 | """ Formatter for subtypes of np.complexfloating """ |
| 1343 | def __init__(self, x, precision, floatmode, suppress_small, |
| 1344 | sign=False, *, legacy=None): |
| 1345 | # for backcompatibility, accept bools |
| 1346 | if isinstance(sign, bool): |
| 1347 | sign = '+' if sign else '-' |
| 1348 | |
| 1349 | floatmode_real = floatmode_imag = floatmode |
| 1350 | if legacy <= 113: |
| 1351 | floatmode_real = 'maxprec_equal' |
| 1352 | floatmode_imag = 'maxprec' |
| 1353 | |
| 1354 | self.real_format = FloatingFormat( |
| 1355 | x.real, precision, floatmode_real, suppress_small, |
| 1356 | sign=sign, legacy=legacy |
| 1357 | ) |
| 1358 | self.imag_format = FloatingFormat( |
| 1359 | x.imag, precision, floatmode_imag, suppress_small, |
| 1360 | sign='+', legacy=legacy |
| 1361 | ) |
| 1362 | |
| 1363 | def __call__(self, x): |
| 1364 | r = self.real_format(x.real) |
nothing calls this directly
no test coverage detected