data_io
orchard.core.io.data_io
¶
Data Integrity & Dataset I/O Utilities.
Provides tools for verifying file integrity via checksums and validating the structure of NPZ dataset archives.
validate_npz_keys(data)
¶
Validates that the loaded NPZ dataset contains all required dataset keys.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
NpzFile
|
The loaded NPZ file object. |
required |
Raises:
| Type | Description |
|---|---|
OrchardDatasetError
|
If any required key (images/labels) is missing. |
Source code in orchard/core/io/data_io.py
md5_checksum(path, chunk_size=_MD5_CHUNK_SIZE)
¶
Calculates the MD5 checksum of a file using buffered reading.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
Path
|
Path to the file to verify. |
required |
chunk_size
|
int
|
Read buffer size in bytes. |
_MD5_CHUNK_SIZE
|
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The calculated hexadecimal MD5 hash. |