phenotypic.sdk_.atomic_write_bytes#

phenotypic.sdk_.atomic_write_bytes(path: str | Path, data: bytes) None[source]#

Atomically write data to path (temp sibling + os.replace).

The bytes counterpart of atomic_write_text() for binary payloads (e.g. a serialized parquet buffer). Same crash-safety guarantees: an all-or-nothing replace and no partial/leftover temp file on failure.

Parameters:
  • path (str | Path) – The destination file path.

  • data (bytes) – The full binary payload to write.

Raises:

OSError – If the write or rename fails (the temp file is removed first).

Return type:

None