Utilities and Visualization
Common helpers and visualization tools.
Utilities
project_name.utils
Utility functions for data loading and environment detection.
get_data_path
get_data_path(config_path: str | Path, gcs_bucket: str | None = None) -> Path
Get the appropriate data path based on the environment.
In cloud environments (GCP/Vertex AI), data is mounted to /gcs/
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
config_path |
str | Path
|
The data path from config (e.g., 'data' or 'data/processed'). |
required |
gcs_bucket |
str | None
|
Optional GCS bucket name. If provided and running in cloud,
will use /gcs/ |
None
|
Returns:
| Type | Description |
|---|---|
Path
|
Path object pointing to the correct data location. |
Source code in src/project_name/utils.py
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | |