Utilities for hydra-core library
Project description
hydra-utils
Wrapper for (hydra-core to add flexible configuration treatment.
Requirement
- Python 3.13, 3.12, 3.11, 3.10
Installation
pip install hydra-utils
Usage
@hydra_utils.hydra_wrapper(
app_name='my_app', app_version='0.1.0', app_file=__file__
)
def main(conf: dict[Any, Any]) -> None: ...
if __name__ == '__main__':
main()
app_nameandapp_versionare used to log information of current version.- It is useful if app_version is set to
__version__of the app.
- It is useful if app_version is set to
app_fileis used to check the file place's git status to log the git commit hash and diff from the last commit.- The argument which the main function takes is
dict[Any, Any]instead ofDictConfig. - Configuration file can be passed by the first argument or
conf=...at the command line. - Configuration file can have
includekeyword which has the list of configuration files to include.- Included files are merged to the main configuration file.
- It is resolved at the place of
include. If the main file has other configurations after theinclude, they will overwrite the included configurations.
n_jobsis fixed to the number of CPUs.- It is used to set the number of jobs for parallel processing.
- If
n_jobsis set to 0 or 1, it is set to 1. - If
n_jobsis set to -1, it is set to the number of logical cores. - If
n_jobsis set to None, it is set to the number of physical cores. - If
n_jobsis set to a negative number, it is set to the number of logical cores + 1 + n_jobs, i.e. -1 is the same as the number of logical cores.
There is also wrapper function for to_absolute_path.
from hydra_utils import to_absolute_path
- It returns empty string if the input is empty.
- It returns the input as is if the input includes
:(e.g.,http://,s3://, ...).
Based on rcmdnk/python-template, v0.1.2
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
hydra_utils-0.1.0.tar.gz
(77.6 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file hydra_utils-0.1.0.tar.gz.
File metadata
- Download URL: hydra_utils-0.1.0.tar.gz
- Upload date:
- Size: 77.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.5.22
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
95680a28da387e1439976e2bfe8d7f7d13f3e392f6ace484a2d72b85dec685f3
|
|
| MD5 |
5476aeade312bdc07cb41974c2de992f
|
|
| BLAKE2b-256 |
4b0b03290f14c6068a041e84d9503379d23c147c38a02e4f33437fb42d358690
|
File details
Details for the file hydra_utils-0.1.0-py3-none-any.whl.
File metadata
- Download URL: hydra_utils-0.1.0-py3-none-any.whl
- Upload date:
- Size: 9.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.5.22
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
288d26d0d818294b5df71516fb307a4f55519cf602a33d8ac30a6f30852d7940
|
|
| MD5 |
6932b93d7d95c8c406ac7fe668f5d44a
|
|
| BLAKE2b-256 |
ddd737f17f38a7266ded131d36be67b42b611f5d0d40f4342063aac65cd9eba0
|