Create a format string which will represent the provided array. It also handles the necessary alignment. E.g. for array [1,2,3] we get '3s13x', because '3s' means string of 3 bytes, and `13x` means adding 13 bytes of '0' padding at the end (for 16B alignment).
(self, array: np.ndarray)
| 281 | return f"{self.ALIGNMENT - overflow}x" |
| 282 | |
| 283 | def _format_string_for_array(self, array: np.ndarray) -> str: |
| 284 | """Create a format string which will represent the provided array. It also handles the necessary alignment. |
| 285 | E.g. for array [1,2,3] we get '3s13x', because '3s' means string of 3 bytes, and `13x` means adding 13 bytes |
| 286 | of '0' padding at the end (for 16B alignment). |
| 287 | """ |
| 288 | assert array.dtype == np.dtype("uint8") |
| 289 | |
| 290 | return f"{array.size}s{self._padding_format_string_for_array(array)}" |
| 291 | |
| 292 | def _create_payload_header( |
| 293 | self, io_formats: dict[str, list[DataFormat]], neutron_artifacts |
no test coverage detected