ivoryos 1.3.8__py3-none-any.whl → 1.3.9__py3-none-any.whl
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.
Potentially problematic release.
This version of ivoryos might be problematic. Click here for more details.
- ivoryos/optimizer/nimo_optimizer.py +10 -8
- ivoryos/utils/script_runner.py +14 -6
- ivoryos/version.py +1 -1
- {ivoryos-1.3.8.dist-info → ivoryos-1.3.9.dist-info}/METADATA +1 -1
- {ivoryos-1.3.8.dist-info → ivoryos-1.3.9.dist-info}/RECORD +8 -8
- {ivoryos-1.3.8.dist-info → ivoryos-1.3.9.dist-info}/WHEEL +0 -0
- {ivoryos-1.3.8.dist-info → ivoryos-1.3.9.dist-info}/licenses/LICENSE +0 -0
- {ivoryos-1.3.8.dist-info → ivoryos-1.3.9.dist-info}/top_level.txt +0 -0
|
@@ -17,14 +17,14 @@ class NIMOOptimizer(OptimizerBase):
|
|
|
17
17
|
{"name": "param_3", "type": "range", "bounds": [0 10], "value_type": "int"},
|
|
18
18
|
]
|
|
19
19
|
:param objective_config: objective configuration
|
|
20
|
-
|
|
20
|
+
[
|
|
21
21
|
{"name": "obj_1", "minimize": True, "weight": 1},
|
|
22
22
|
{"name": "obj_2", "minimize": False, "weight": 1}
|
|
23
23
|
]
|
|
24
24
|
:param optimizer_config: optimizer configuration
|
|
25
|
-
|
|
26
|
-
"step_1": {"model": "
|
|
27
|
-
"step_2": {"model": "
|
|
25
|
+
{
|
|
26
|
+
"step_1": {"model": "RE", "num_samples": 10},
|
|
27
|
+
"step_2": {"model": "PDC"}
|
|
28
28
|
}
|
|
29
29
|
"""
|
|
30
30
|
self.current_step = 0
|
|
@@ -35,13 +35,15 @@ class NIMOOptimizer(OptimizerBase):
|
|
|
35
35
|
|
|
36
36
|
super().__init__(experiment_name, parameter_space, objective_config, optimizer_config, datapath)
|
|
37
37
|
|
|
38
|
+
os.makedirs(os.path.join(self.datapath, "nimo_data"), exist_ok=True)
|
|
39
|
+
|
|
38
40
|
step_1 = optimizer_config.get("step_1", {})
|
|
39
41
|
step_2 = optimizer_config.get("step_2", {})
|
|
40
42
|
self.step_1_generator = step_1.get("model", "RE")
|
|
41
43
|
self.step_1_batch_num = step_1.get("num_samples", 1)
|
|
42
44
|
self.step_2_generator = step_2.get("model", "PDC")
|
|
43
|
-
self.candidates = os.path.join(self.datapath, f"{self.experiment_name}_candidates.csv")
|
|
44
|
-
self.proposals = os.path.join(self.datapath, f"{self.experiment_name}_proposals.csv")
|
|
45
|
+
self.candidates = os.path.join(self.datapath, "nimo_data", f"{self.experiment_name}_candidates.csv")
|
|
46
|
+
self.proposals = os.path.join(self.datapath, "nimo_data", f"{self.experiment_name}_proposals.csv")
|
|
45
47
|
self.n_objectives = len(self.objective_config)
|
|
46
48
|
self._create_candidates_csv()
|
|
47
49
|
|
|
@@ -129,8 +131,8 @@ class NIMOOptimizer(OptimizerBase):
|
|
|
129
131
|
"parameter_types": ["choice"],
|
|
130
132
|
"multiple_objectives": True,
|
|
131
133
|
"optimizer_config": {
|
|
132
|
-
"step_1": {"model": ["RE", "ES"
|
|
133
|
-
"step_2": {"model": ["PHYSBO", "BLOX", "PTR", "SLESA", "BOMP", "COMBI"]}
|
|
134
|
+
"step_1": {"model": ["RE", "ES"], "num_samples": 5},
|
|
135
|
+
"step_2": {"model": ["PHYSBO", "PDC", "BLOX", "PTR", "SLESA", "BOMP", "COMBI"]}
|
|
134
136
|
},
|
|
135
137
|
}
|
|
136
138
|
|
ivoryos/utils/script_runner.py
CHANGED
|
@@ -110,6 +110,8 @@ class ScriptRunner:
|
|
|
110
110
|
:return: The final result of the function execution
|
|
111
111
|
"""
|
|
112
112
|
_func_str = script.python_script or script.compile()
|
|
113
|
+
_, return_list = script.config_return()
|
|
114
|
+
|
|
113
115
|
step_list: list = script.convert_to_lines(_func_str).get(section_name, [])
|
|
114
116
|
global deck
|
|
115
117
|
# global deck, registered_workflows
|
|
@@ -230,8 +232,8 @@ class ScriptRunner:
|
|
|
230
232
|
# step_list: list = script.convert_to_lines(_func_str).get(section_name, [])
|
|
231
233
|
if not step.run_error or not self.retry:
|
|
232
234
|
index += 1
|
|
233
|
-
|
|
234
|
-
return
|
|
235
|
+
output = {key: value for key, value in exec_locals.items() if key in return_list}
|
|
236
|
+
return output # Return the 'results' variable
|
|
235
237
|
|
|
236
238
|
def _run_with_stop_check(self, script: Script, repeat_count: int, run_name: str, logger, socketio, config, bo_args,
|
|
237
239
|
output_path, current_app, compiled, history=None, optimizer=None):
|
|
@@ -250,6 +252,8 @@ class ScriptRunner:
|
|
|
250
252
|
db.session.add(run)
|
|
251
253
|
db.session.flush()
|
|
252
254
|
run_id = run.id # Save the ID
|
|
255
|
+
db.session.commit()
|
|
256
|
+
|
|
253
257
|
try:
|
|
254
258
|
|
|
255
259
|
global_config.runner_status = {"id":run_id, "type": "workflow"}
|
|
@@ -281,10 +285,13 @@ class ScriptRunner:
|
|
|
281
285
|
self.lock.release()
|
|
282
286
|
with current_app.app_context():
|
|
283
287
|
run = db.session.get(WorkflowRun, run_id)
|
|
284
|
-
run
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
+
if run is None:
|
|
289
|
+
logger.info("Error: Run not found in database.")
|
|
290
|
+
else:
|
|
291
|
+
run.end_time = datetime.now()
|
|
292
|
+
run.data_path = filename
|
|
293
|
+
run.run_error = error_flag
|
|
294
|
+
db.session.commit()
|
|
288
295
|
|
|
289
296
|
|
|
290
297
|
def _run_actions(self, script, section_name="", logger=None, socketio=None, run_id=None):
|
|
@@ -422,6 +429,7 @@ class ScriptRunner:
|
|
|
422
429
|
except Exception as e:
|
|
423
430
|
logger.info(f'Optimization error: {e}')
|
|
424
431
|
break
|
|
432
|
+
# Optimizer for UI
|
|
425
433
|
elif optimizer:
|
|
426
434
|
try:
|
|
427
435
|
parameters = optimizer.suggest(1)
|
ivoryos/version.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
__version__ = "1.3.
|
|
1
|
+
__version__ = "1.3.9"
|
|
@@ -3,11 +3,11 @@ ivoryos/app.py,sha256=G6kzEOVzCduj7Fc2r1rMbMFHgDzZQV0lC20Oxps7RSM,4839
|
|
|
3
3
|
ivoryos/config.py,sha256=y3RxNjiIola9tK7jg-mHM8EzLMwiLwOzoisXkDvj0gA,2174
|
|
4
4
|
ivoryos/server.py,sha256=Idr41Boa8rPsh3bVJ8xy2Flwfxa1Xu6f2T0oMp4qBEk,7121
|
|
5
5
|
ivoryos/socket_handlers.py,sha256=VWVWiIdm4jYAutwGu6R0t1nK5MuMyOCL0xAnFn06jWQ,1302
|
|
6
|
-
ivoryos/version.py,sha256=
|
|
6
|
+
ivoryos/version.py,sha256=SaWgUI6v92kVfF_Qdoxbfc38bwA34RuDGZmXMqa5g3c,22
|
|
7
7
|
ivoryos/optimizer/ax_optimizer.py,sha256=k7RzhNMjh3MseOE-_FADVX72lYLDyXz-XE3juSBRWTk,7116
|
|
8
8
|
ivoryos/optimizer/base_optimizer.py,sha256=gNBX9m3RxoYklwEBkqeDGZlU7c6e9e5kN0ZeTtnxnCE,2044
|
|
9
9
|
ivoryos/optimizer/baybe_optimizer.py,sha256=EdrrRiYO-IOx610cPXiQhH4qG8knUP0uiZ0YoyaGIU8,7954
|
|
10
|
-
ivoryos/optimizer/nimo_optimizer.py,sha256=
|
|
10
|
+
ivoryos/optimizer/nimo_optimizer.py,sha256=kewmRM8wteFROUMdlQeCLanaBfBMCfP8gXSb3kTjYLM,6767
|
|
11
11
|
ivoryos/optimizer/registry.py,sha256=dLMo5cszcwa06hfBxdINQIGpkHtRe5-J3J7t76Jq6X0,306
|
|
12
12
|
ivoryos/routes/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
13
13
|
ivoryos/routes/api/api.py,sha256=97Y7pqTwOaWgZgI5ovEPxEBm6Asrt0Iy0VhBkVp2xqA,2304
|
|
@@ -93,12 +93,12 @@ ivoryos/utils/form.py,sha256=f1yXHlOQX1YnJ2j_UW6iHmh4pTAGAs9sAlhyQB8yBIo,22505
|
|
|
93
93
|
ivoryos/utils/global_config.py,sha256=leYoEXvAS0AH4xQpYsqu4HI9CJ9-wiLM-pIh_bEG4Ak,3087
|
|
94
94
|
ivoryos/utils/llm_agent.py,sha256=-lVCkjPlpLues9sNTmaT7bT4sdhWvV2DiojNwzB2Lcw,6422
|
|
95
95
|
ivoryos/utils/py_to_json.py,sha256=ZtejHgwdEAUCVVMYeVNR8G7ceLINue294q6WpiJ6jn0,9734
|
|
96
|
-
ivoryos/utils/script_runner.py,sha256=
|
|
96
|
+
ivoryos/utils/script_runner.py,sha256=9xlUOhb9G27jksNsu1SDAlosnfb-0K0xXOHgLsxFwjw,21073
|
|
97
97
|
ivoryos/utils/serilize.py,sha256=lkBhkz8r2bLmz2_xOb0c4ptSSOqjIu6krj5YYK4Nvj8,6784
|
|
98
98
|
ivoryos/utils/task_runner.py,sha256=xiMzK8gQ0mHsg0A1Ah8fmXe3azpaJh4hJiQJLHA11ZQ,3682
|
|
99
99
|
ivoryos/utils/utils.py,sha256=dIc4BO55eS3lCA0nhbIncS5d7sLaKZy5hJS1I_Sm45o,14949
|
|
100
|
-
ivoryos-1.3.
|
|
101
|
-
ivoryos-1.3.
|
|
102
|
-
ivoryos-1.3.
|
|
103
|
-
ivoryos-1.3.
|
|
104
|
-
ivoryos-1.3.
|
|
100
|
+
ivoryos-1.3.9.dist-info/licenses/LICENSE,sha256=p2c8S8i-8YqMpZCJnadLz1-ofxnRMILzz6NCMIypRag,1084
|
|
101
|
+
ivoryos-1.3.9.dist-info/METADATA,sha256=XgdSDR0_DjiA3C_WxAvSBsLZIKCBsb-bq_gw6WPwg7M,8516
|
|
102
|
+
ivoryos-1.3.9.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
103
|
+
ivoryos-1.3.9.dist-info/top_level.txt,sha256=FRIWWdiEvRKqw-XfF_UK3XV0CrnNb6EmVbEgjaVazRM,8
|
|
104
|
+
ivoryos-1.3.9.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|