This is a second way to initialize StructuredVoidFormat, using the raw data as input. Added to avoid changing the signature of __init__.
(cls, data, **options)
| 1377 | |
| 1378 | @classmethod |
| 1379 | def from_data(cls, data, **options): |
| 1380 | """ |
| 1381 | This is a second way to initialize StructuredVoidFormat, using the raw data |
| 1382 | as input. Added to avoid changing the signature of __init__. |
| 1383 | """ |
| 1384 | format_functions = [] |
| 1385 | for field_name in data.dtype.names: |
| 1386 | format_function = _get_format_function(data[field_name], **options) |
| 1387 | if data.dtype[field_name].shape != (): |
| 1388 | format_function = SubArrayFormat(format_function, **options) |
| 1389 | format_functions.append(format_function) |
| 1390 | return cls(format_functions) |
| 1391 | |
| 1392 | def __call__(self, x): |
| 1393 | str_fields = [ |
no test coverage detected