Sample ID¶
sample_id ¶
Sample ID Value Object
Represents a unique identifier for a biological sample.
Classes¶
SampleId dataclass ¶
Value Object for sample identifier.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
value | str | Sample identifier name (cannot be empty) | required |
Raises:
| Type | Description |
|---|---|
ValueError | If value is empty or contains only spaces |
Notes
This object is immutable ensuring identifier consistency throughout the application lifecycle.
Functions¶
__post_init__ ¶
Validates the identifier after initialization.
Raises:
| Type | Description |
|---|---|
ValueError | If value is empty or None. |
Source code in src/domain/value_objects/sample_id.py
__str__ ¶
Returns string representation of Sample ID.
Returns:
| Type | Description |
|---|---|
str | The identifier value. |
__repr__ ¶
Returns debug representation of Sample ID.
Returns:
| Type | Description |
|---|---|
str | Representation in format "SampleId('value')". |
__hash__ ¶
Allows using SampleId as dictionary key.
Returns:
| Type | Description |
|---|---|
int | Hash of the value. |