Configuration¶
hydrodatasource uses a central YAML configuration file to manage data paths and connections to remote services. It shares the same file and storage.* format as hydrodataset and hydromodel, so all three repositories resolve against one deterministic contract.
The hydro_setting.yml File¶
The configuration is managed through a file named hydro_setting.yml located in your user home directory (e.g., C:\Users\YourUser on Windows or /home/YourUser on Linux).
If this file does not exist, hydrodatasource will use a default directory named hydrodatasource_data in your home directory (with a warning).
Unified storage.* Format¶
1 2 3 4 5 6 7 8 9 10 11 | |
storage.default_source: The storage backend used byresolve_data_path()/open_dataset()when the caller does not passsource. Eitherlocalorcloud.storage.local.root: The top-level directory for local data. Registered datasets resolve relative to this root.storage.cache: Where cached NetCDF files (generated bySelfMadeHydroDataset) are stored. This speeds up data loading on subsequent runs.storage.s3: Cloud (MinIO/S3) credentials and bucket. Used whendefault_source: cloud(orsource="cloud").
How Resolution Uses It¶
resolve_data_path(dataset_id) / open_dataset(dataset_id) follow this contract, shared with hydrodataset:
- Look up the dataset id in the registry (
HDS_DATASETS+ hydrodataset's datasets) to get the reader alias and relative path. - Resolve the storage root from
storage.local.root(local) orstorage.s3(cloud), persource/default_source. - Validate that the resulting absolute path exists.
1 2 3 4 5 6 7 8 9 10 11 12 13 | |
Legacy Config¶
The old local_data_path.root / datasets-origin / datasets-interim format, and the minio.* /
postgres.* blocks, are no longer supported. A non-empty hydro_setting.yml that is missing the
storage section is rejected with a warning and falls back to the default data root.