aap-utils 0.1.7__tar.gz → 0.1.11__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {aap_utils-0.1.7 → aap_utils-0.1.11}/PKG-INFO +1 -1
- aap_utils-0.1.11/aap_utils/__init__.py +2 -0
- aap_utils-0.1.11/aap_utils/config_loader.py +26 -0
- {aap_utils-0.1.7 → aap_utils-0.1.11}/aap_utils/register.py +1 -3
- {aap_utils-0.1.7 → aap_utils-0.1.11}/aap_utils.egg-info/PKG-INFO +1 -1
- {aap_utils-0.1.7 → aap_utils-0.1.11}/aap_utils.egg-info/SOURCES.txt +1 -0
- {aap_utils-0.1.7 → aap_utils-0.1.11}/setup.py +1 -1
- aap_utils-0.1.7/aap_utils/__init__.py +0 -1
- {aap_utils-0.1.7 → aap_utils-0.1.11}/README.md +0 -0
- {aap_utils-0.1.7 → aap_utils-0.1.11}/aap_utils.egg-info/dependency_links.txt +0 -0
- {aap_utils-0.1.7 → aap_utils-0.1.11}/aap_utils.egg-info/requires.txt +0 -0
- {aap_utils-0.1.7 → aap_utils-0.1.11}/aap_utils.egg-info/top_level.txt +0 -0
- {aap_utils-0.1.7 → aap_utils-0.1.11}/pyproject.toml +0 -0
- {aap_utils-0.1.7 → aap_utils-0.1.11}/setup.cfg +0 -0
@@ -0,0 +1,26 @@
|
|
1
|
+
import os
|
2
|
+
from hydra import initialize, compose
|
3
|
+
from omegaconf import DictConfig
|
4
|
+
|
5
|
+
class ConfigLoader:
|
6
|
+
def __init__(self):
|
7
|
+
self.kcn_params = "config.yaml"
|
8
|
+
self.config_path = "configs/"
|
9
|
+
self.overrides = []
|
10
|
+
|
11
|
+
def _load_env_variables(self):
|
12
|
+
"""Load environment variables for config parameters and overrides."""
|
13
|
+
if os.environ.get("KCN_PARAMS"):
|
14
|
+
full_path = os.getenv("KCN_PARAMS")
|
15
|
+
self.kcn_params = os.path.basename(full_path) # Extract the filename
|
16
|
+
|
17
|
+
if os.environ.get("KCN_OVERRIDES"):
|
18
|
+
overrides_env = os.getenv("KCN_OVERRIDES")
|
19
|
+
self.overrides = overrides_env.split("|") if overrides_env else []
|
20
|
+
|
21
|
+
def get_args(self) -> DictConfig:
|
22
|
+
"""Load and return the Hydra configuration."""
|
23
|
+
self._load_env_variables()
|
24
|
+
with initialize(version_base=None, config_path=self.config_path):
|
25
|
+
args = compose(config_name=self.kcn_params, overrides=self.overrides)
|
26
|
+
return args
|
@@ -63,9 +63,7 @@ def create_url(domain_name = "aiplatform.vcntt.tech"):
|
|
63
63
|
|
64
64
|
def get_args():
|
65
65
|
kcn_params = "config.yaml"
|
66
|
-
|
67
|
-
run_py_path = os.path.abspath(os.path.dirname(__file__)) # Get the directory of this script
|
68
|
-
config_path = os.path.join(run_py_path, "configs") # Set config_path relative to run.py
|
66
|
+
config_path="configs/"
|
69
67
|
overrides = []
|
70
68
|
|
71
69
|
if os.environ.get('KCN_PARAMS') and os.environ.get('KCN_PARAMS') != '':
|
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
|
|
2
2
|
|
3
3
|
setup(
|
4
4
|
name="aap_utils", # The name of your library
|
5
|
-
version="0.1.
|
5
|
+
version="0.1.11",
|
6
6
|
description="A Python library for registering an IP address for AAP",
|
7
7
|
author="Minh Dang",
|
8
8
|
author_email="danghoangminh86@gmail.com",
|
@@ -1 +0,0 @@
|
|
1
|
-
from .register import register_demo, get_args
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|