find the right formatting function for the dtype_
(data, **options)
| 450 | return formatdict |
| 451 | |
| 452 | def _get_format_function(data, **options): |
| 453 | """ |
| 454 | find the right formatting function for the dtype_ |
| 455 | """ |
| 456 | dtype_ = data.dtype |
| 457 | dtypeobj = dtype_.type |
| 458 | formatdict = _get_formatdict(data, **options) |
| 459 | if dtypeobj is None: |
| 460 | return formatdict["numpystr"]() |
| 461 | elif issubclass(dtypeobj, _nt.bool_): |
| 462 | return formatdict['bool']() |
| 463 | elif issubclass(dtypeobj, _nt.integer): |
| 464 | if issubclass(dtypeobj, _nt.timedelta64): |
| 465 | return formatdict['timedelta']() |
| 466 | else: |
| 467 | return formatdict['int']() |
| 468 | elif issubclass(dtypeobj, _nt.floating): |
| 469 | if issubclass(dtypeobj, _nt.longfloat): |
| 470 | return formatdict['longfloat']() |
| 471 | else: |
| 472 | return formatdict['float']() |
| 473 | elif issubclass(dtypeobj, _nt.complexfloating): |
| 474 | if issubclass(dtypeobj, _nt.clongfloat): |
| 475 | return formatdict['longcomplexfloat']() |
| 476 | else: |
| 477 | return formatdict['complexfloat']() |
| 478 | elif issubclass(dtypeobj, (_nt.str_, _nt.bytes_)): |
| 479 | return formatdict['numpystr']() |
| 480 | elif issubclass(dtypeobj, _nt.datetime64): |
| 481 | return formatdict['datetime']() |
| 482 | elif issubclass(dtypeobj, _nt.object_): |
| 483 | return formatdict['object']() |
| 484 | elif issubclass(dtypeobj, _nt.void): |
| 485 | if dtype_.names is not None: |
| 486 | return StructuredVoidFormat.from_data(data, **options) |
| 487 | else: |
| 488 | return formatdict['void']() |
| 489 | else: |
| 490 | return formatdict['numpystr']() |
| 491 | |
| 492 | |
| 493 | def _recursive_guard(fillvalue='...'): |
no test coverage detected