MCPcopy Index your code
hub / github.com/numpy/numpy / __init__

Method __init__

numpy/_core/arrayprint.py:1343–1361  ·  view source on GitHub ↗
(self, x, precision, floatmode, suppress_small,
                 sign=False, *, legacy=None)

Source from the content-addressed store, hash-verified

1341class 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)

Callers

nothing calls this directly

Calls 1

FloatingFormatClass · 0.85

Tested by

no test coverage detected