rr-ml-config
This package is a Config System which allows easy manipulation of config files for safe, clear and repeatable experiments.
DISCLAIMER: This repository is the public version of a repository that is the property of Reactive Reality. This repository IS NOT OFFICIAL and can not to be maintained in the future. Some minor changed* are applied from the official repository (GitLab) (under lesser GNU license).
*documentation and other PyPI related changes
Installation
The package can be installed from our registry using pip: pip install rr-ml-config
Getting started
This package is adapted to a project where you need to run a number of experiments. In this setup, it can be useful to gather all the parameters in the project to a common location, some "config files", so you can access and modify them easily. This package is based on YAML, therefore your config files should be YAML files. One such YAML file could be :
gpu: true
data_path: "./data"
learning_rate: 0.01
Those will be the default values for those three parameters, so we will keep them in the file
my_project/configs/default.yaml. Then, we just need to subclass the Configuration class in this package
so your project-specific subclass knows where to find the default values for your project. A minimalistic
project-specific subclass looks like:
from rr.ml.config import Configuration
class ProjectSpecific(Configuration):
@staticmethod
def get_default_config_path():
return "./configs/default.yaml"
def parameters_pre_processing(self):
return {}
That's all there is to it! Now if we use config = ProjectSpecific.load_config(), we can then call
config.data_path or config.learning_rate to get their values as defined in the default config. We
don't need to specify where to get the default config because a project should only ever have one default
config, which centralizes all the parameters in that project. Since the location of the default config is
a project constant, it is defined in your project-specific subclass and there is no need to clutter your
main code with it. Now, for example, your main.py could look like:
from project_config import ProjectSpecific
if __name__ == "__main__":
config = ProjectSpecific.load_config()
print(config.details())
Then, calling python main.py --learning_rate=0.001 would parse
the command line and find the pre-existing parameter learning_rate, then change its value to 0.001.
Contribution
We welcome contributions to this repository via the GitLab repository.
License
This repository is licensed under the GNU Lesser General Public License. It is free to use and distribute but modifications are not allowed.
Metadata
Release files for rr-ml-config 1.11.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| rr-ml-config-1.11.1.tar.gz | 56.7 kB | Without provenance | Details for rr-ml-config-1.11.1.tar.gz |
Release files / rr-ml-config-1.11.1.tar.gz
| Download URL | rr-ml-config-1.11.1.tar.gz |
|---|---|
| Size | 56.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0263d0713c39f766ff6ee5324fbf51cbc57cb9f26d9842232bfcfc00399d7101
|
|
BLAKE2b-256 checksum How to use checksums |
0116dc0dbebe58a3e14062af56463fd64297f884816eaf2b8efb5b1140adfce5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.8.0 colorama/0.4.4 importlib-metadata/4.6.4 keyring/23.5.0 pkginfo/1.8.2 readme-renderer/34.0 requests-toolbelt/0.9.1 requests/2.25.1 rfc3986/1.5.0 tqdm/4.57.0 urllib3/1.26.5 CPython/3.10.4
|
Security for rr-ml-config 1.11.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.