aiauto-client 0.1.3__tar.gz → 0.1.5__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: aiauto-client
3
- Version: 0.1.3
3
+ Version: 0.1.5
4
4
  Summary: AI Auto HPO (Hyperparameter Optimization) Client Library
5
5
  Author-email: AIAuto Team <ainode@zeroone.ai>
6
6
  Project-URL: Homepage, https://aiauto.cloude.ainode.ai
@@ -31,15 +31,8 @@ AIAuto는 Kubernetes 기반의 분산 HPO(Hyperparameter Optimization) 시스템
31
31
  사용자 python lib <-> Next.js 서버 사이 gRPC 통신 담당
32
32
 
33
33
  ## lib build
34
- - pypi build, upload 종속성 다운로드 `uv add --dev twine`
35
- - build lib `uv build`
36
- - `aiauto_client-0.1.1-py3-none-any.whl` 생성
37
- - `aiauto_client-0.1.1.tar.gz` 생성
38
- - `aiauto_client.egg-info` 생성
39
- - `~/.pypirc` 파일에 설정 확인
40
- - `uv run twine upload --repository aiauto-client dist/*`
41
- - upload 시 pypi token 을 입력하라고 나옴, pypi 로그인 계정 설정가면 있다
42
-
34
+ - `make build push`
35
+
43
36
  ## 설치
44
37
  - `uv add aiauto-client`
45
38
 
@@ -4,15 +4,8 @@ AIAuto는 Kubernetes 기반의 분산 HPO(Hyperparameter Optimization) 시스템
4
4
  사용자 python lib <-> Next.js 서버 사이 gRPC 통신 담당
5
5
 
6
6
  ## lib build
7
- - pypi build, upload 종속성 다운로드 `uv add --dev twine`
8
- - build lib `uv build`
9
- - `aiauto_client-0.1.1-py3-none-any.whl` 생성
10
- - `aiauto_client-0.1.1.tar.gz` 생성
11
- - `aiauto_client.egg-info` 생성
12
- - `~/.pypirc` 파일에 설정 확인
13
- - `uv run twine upload --repository aiauto-client dist/*`
14
- - upload 시 pypi token 을 입력하라고 나옴, pypi 로그인 계정 설정가면 있다
15
-
7
+ - `make build push`
8
+
16
9
  ## 설치
17
10
  - `uv add aiauto-client`
18
11
 
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "aiauto-client"
7
- version = "0.1.3"
7
+ version = "0.1.5"
8
8
  description = "AI Auto HPO (Hyperparameter Optimization) Client Library"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.8"
@@ -1,5 +1,4 @@
1
1
  from .core import AIAutoController, TrialController, CallbackTopNArtifact, StudyWrapper
2
- from .api import create_study
3
2
  from ._config import AIAUTO_API_TARGET
4
3
  from .constants import RUNTIME_IMAGES
5
4
 
@@ -10,7 +9,6 @@ __all__ = [
10
9
  'TrialController',
11
10
  'CallbackTopNArtifact',
12
11
  'StudyWrapper',
13
- 'create_study',
14
12
  'AIAUTO_API_TARGET',
15
13
  'RUNTIME_IMAGES',
16
14
  ]
@@ -3,7 +3,7 @@ import tempfile
3
3
  from typing import Union, Optional, List, Dict, Callable
4
4
  import optuna
5
5
  from .http_client import ConnectRPCClient
6
- from .serializer import serialize, build_requirements
6
+ from .serializer import serialize, build_requirements, object_to_json
7
7
  from ._config import AIAUTO_API_TARGET
8
8
 
9
9
 
@@ -39,7 +39,10 @@ class AIAutoController:
39
39
  self.dashboard_url = response.get('dashboardUrl', '')
40
40
 
41
41
  except Exception as e:
42
- raise RuntimeError(f"Failed to initialize workspace: {e}") from e
42
+ raise RuntimeError(
43
+ f"Failed to initialize workspace: {e}\n"
44
+ "Please delete and reissue your token from the web dashboard at https://dashboard.aiauto.pangyo.ainode.ai"
45
+ ) from e
43
46
 
44
47
  # artifact storage
45
48
  makedirs('./artifacts', exist_ok=True)
@@ -59,6 +62,46 @@ class AIAutoController:
59
62
  def get_artifact_tmp_dir(self):
60
63
  return self.tmp_dir
61
64
 
65
+ def create_study(
66
+ self,
67
+ study_name: str,
68
+ direction: Optional[str] = None,
69
+ directions: Optional[List[str]] = None,
70
+ sampler: Union[object, dict, None] = None,
71
+ pruner: Union[object, dict, None] = None
72
+ ) -> 'StudyWrapper':
73
+ """Create a new study using the controller's token."""
74
+ if not direction and not directions:
75
+ raise ValueError("Either 'direction' or 'directions' must be specified")
76
+
77
+ if direction and directions:
78
+ raise ValueError("Cannot specify both 'direction' and 'directions'")
79
+
80
+ try:
81
+ # Prepare request data for CreateStudy
82
+ request_data = {
83
+ "spec": {
84
+ "studyName": study_name,
85
+ "direction": direction or "",
86
+ "directions": directions or [],
87
+ "samplerJson": object_to_json(sampler),
88
+ "prunerJson": object_to_json(pruner)
89
+ }
90
+ }
91
+
92
+ # Call CreateStudy RPC
93
+ response = self.client.call_rpc("CreateStudy", request_data)
94
+
95
+ # Return StudyWrapper
96
+ return StudyWrapper(
97
+ study_name=response.get("studyName", study_name),
98
+ storage=self.storage,
99
+ controller=self
100
+ )
101
+
102
+ except Exception as e:
103
+ raise RuntimeError(f"Failed to create study: {e}") from e
104
+
62
105
 
63
106
  class TrialController:
64
107
  def __init__(self, trial: optuna.trial.Trial):
@@ -132,7 +175,10 @@ class StudyWrapper:
132
175
  load_if_exists=True
133
176
  )
134
177
  except Exception as e:
135
- raise RuntimeError("Study not ready. Call get_status() and wait for phase=Ready.") from e
178
+ raise RuntimeError(
179
+ "Failed to get study. If this persists, please delete and reissue your token "
180
+ "from the web dashboard at https://dashboard.aiauto.pangyo.ainode.ai"
181
+ ) from e
136
182
  return self._study
137
183
 
138
184
  def optimize(
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: aiauto-client
3
- Version: 0.1.3
3
+ Version: 0.1.5
4
4
  Summary: AI Auto HPO (Hyperparameter Optimization) Client Library
5
5
  Author-email: AIAuto Team <ainode@zeroone.ai>
6
6
  Project-URL: Homepage, https://aiauto.cloude.ainode.ai
@@ -31,15 +31,8 @@ AIAuto는 Kubernetes 기반의 분산 HPO(Hyperparameter Optimization) 시스템
31
31
  사용자 python lib <-> Next.js 서버 사이 gRPC 통신 담당
32
32
 
33
33
  ## lib build
34
- - pypi build, upload 종속성 다운로드 `uv add --dev twine`
35
- - build lib `uv build`
36
- - `aiauto_client-0.1.1-py3-none-any.whl` 생성
37
- - `aiauto_client-0.1.1.tar.gz` 생성
38
- - `aiauto_client.egg-info` 생성
39
- - `~/.pypirc` 파일에 설정 확인
40
- - `uv run twine upload --repository aiauto-client dist/*`
41
- - upload 시 pypi token 을 입력하라고 나옴, pypi 로그인 계정 설정가면 있다
42
-
34
+ - `make build push`
35
+
43
36
  ## 설치
44
37
  - `uv add aiauto-client`
45
38
 
@@ -2,7 +2,6 @@ README.md
2
2
  pyproject.toml
3
3
  src/aiauto/__init__.py
4
4
  src/aiauto/_config.py
5
- src/aiauto/api.py
6
5
  src/aiauto/constants.py
7
6
  src/aiauto/core.py
8
7
  src/aiauto/http_client.py
@@ -1,46 +0,0 @@
1
- from typing import Optional, List, Union
2
- from .serializer import object_to_json
3
- from .core import StudyWrapper, AIAutoController
4
-
5
-
6
- def create_study(
7
- study_name: str,
8
- token: str,
9
- direction: Optional[str] = None,
10
- directions: Optional[List[str]] = None,
11
- sampler: Union[object, dict, None] = None,
12
- pruner: Union[object, dict, None] = None
13
- ) -> StudyWrapper:
14
- if not direction and not directions:
15
- raise ValueError("Either 'direction' or 'directions' must be specified")
16
-
17
- if direction and directions:
18
- raise ValueError("Cannot specify both 'direction' and 'directions'")
19
-
20
- try:
21
- # Initialize controller (which ensures workspace)
22
- controller = AIAutoController(token)
23
-
24
- # Prepare request data for CreateStudy
25
- request_data = {
26
- "spec": {
27
- "studyName": study_name,
28
- "direction": direction or "",
29
- "directions": directions or [],
30
- "samplerJson": object_to_json(sampler),
31
- "prunerJson": object_to_json(pruner)
32
- }
33
- }
34
-
35
- # Call CreateStudy RPC
36
- response = controller.client.call_rpc("CreateStudy", request_data)
37
-
38
- # Return StudyWrapper
39
- return StudyWrapper(
40
- study_name=response.get("studyName", study_name),
41
- storage=controller.storage,
42
- controller=controller
43
- )
44
-
45
- except Exception as e:
46
- raise RuntimeError(f"Failed to create study: {e}") from e
File without changes