omniopt2 8710__tar.gz → 8721__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.
Potentially problematic release.
This version of omniopt2 might be problematic. Click here for more details.
- {omniopt2-8710 → omniopt2-8721}/.omniopt.py +85 -16
- {omniopt2-8710 → omniopt2-8721}/PKG-INFO +1 -1
- {omniopt2-8710 → omniopt2-8721}/omniopt +1 -1
- {omniopt2-8710 → omniopt2-8721}/omniopt2.egg-info/PKG-INFO +1 -1
- {omniopt2-8710 → omniopt2-8721}/pyproject.toml +1 -1
- {omniopt2-8710 → omniopt2-8721}/.colorfunctions.sh +0 -0
- {omniopt2-8710 → omniopt2-8721}/.dockerignore +0 -0
- {omniopt2-8710 → omniopt2-8721}/.general.sh +0 -0
- {omniopt2-8710 → omniopt2-8721}/.gitignore +0 -0
- {omniopt2-8710 → omniopt2-8721}/.helpers.py +0 -0
- {omniopt2-8710 → omniopt2-8721}/.omniopt_plot_cpu_ram_usage.py +0 -0
- {omniopt2-8710 → omniopt2-8721}/.omniopt_plot_general.py +0 -0
- {omniopt2-8710 → omniopt2-8721}/.omniopt_plot_gpu_usage.py +0 -0
- {omniopt2-8710 → omniopt2-8721}/.omniopt_plot_kde.py +0 -0
- {omniopt2-8710 → omniopt2-8721}/.omniopt_plot_scatter.py +0 -0
- {omniopt2-8710 → omniopt2-8721}/.omniopt_plot_scatter_generation_method.py +0 -0
- {omniopt2-8710 → omniopt2-8721}/.omniopt_plot_scatter_hex.py +0 -0
- {omniopt2-8710 → omniopt2-8721}/.omniopt_plot_time_and_exit_code.py +0 -0
- {omniopt2-8710 → omniopt2-8721}/.omniopt_plot_trial_index_result.py +0 -0
- {omniopt2-8710 → omniopt2-8721}/.omniopt_plot_worker.py +0 -0
- {omniopt2-8710 → omniopt2-8721}/.random_generator.py +0 -0
- {omniopt2-8710 → omniopt2-8721}/.shellscript_functions +0 -0
- {omniopt2-8710 → omniopt2-8721}/.tests/pylint.rc +0 -0
- {omniopt2-8710 → omniopt2-8721}/.tpe.py +0 -0
- {omniopt2-8710 → omniopt2-8721}/LICENSE +0 -0
- {omniopt2-8710 → omniopt2-8721}/MANIFEST.in +0 -0
- {omniopt2-8710 → omniopt2-8721}/README.md +0 -0
- {omniopt2-8710 → omniopt2-8721}/apt-dependencies.txt +0 -0
- {omniopt2-8710 → omniopt2-8721}/omniopt2.egg-info/SOURCES.txt +0 -0
- {omniopt2-8710 → omniopt2-8721}/omniopt2.egg-info/dependency_links.txt +0 -0
- {omniopt2-8710 → omniopt2-8721}/omniopt2.egg-info/requires.txt +0 -0
- {omniopt2-8710 → omniopt2-8721}/omniopt2.egg-info/top_level.txt +0 -0
- {omniopt2-8710 → omniopt2-8721}/omniopt_docker +0 -0
- {omniopt2-8710 → omniopt2-8721}/omniopt_evaluate +0 -0
- {omniopt2-8710 → omniopt2-8721}/omniopt_plot +0 -0
- {omniopt2-8710 → omniopt2-8721}/omniopt_share +0 -0
- {omniopt2-8710 → omniopt2-8721}/requirements.txt +0 -0
- {omniopt2-8710 → omniopt2-8721}/setup.cfg +0 -0
- {omniopt2-8710 → omniopt2-8721}/setup.py +0 -0
- {omniopt2-8710 → omniopt2-8721}/test_requirements.txt +0 -0
|
@@ -32,6 +32,8 @@ import psutil
|
|
|
32
32
|
FORCE_EXIT: bool = False
|
|
33
33
|
|
|
34
34
|
last_msg_progressbar = ""
|
|
35
|
+
last_msg_raw = None
|
|
36
|
+
last_lock = threading.Lock()
|
|
35
37
|
|
|
36
38
|
def force_exit(signal_number: Any, frame: Any) -> Any:
|
|
37
39
|
global FORCE_EXIT
|
|
@@ -2839,15 +2841,20 @@ def print_debug_get_next_trials(got: int, requested: int, _line: int) -> None:
|
|
|
2839
2841
|
log_message_to_file(LOGFILE_DEBUG_GET_NEXT_TRIALS, msg, 0, "")
|
|
2840
2842
|
|
|
2841
2843
|
def print_debug_progressbar(msg: str) -> None:
|
|
2842
|
-
global last_msg_progressbar
|
|
2844
|
+
global last_msg_progressbar, last_msg_raw
|
|
2843
2845
|
|
|
2844
|
-
|
|
2845
|
-
|
|
2846
|
-
|
|
2846
|
+
try:
|
|
2847
|
+
with last_lock:
|
|
2848
|
+
if msg != last_msg_raw:
|
|
2849
|
+
time_str = datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S")
|
|
2850
|
+
full_msg = f"{time_str} ({worker_generator_uuid}): {msg}"
|
|
2847
2851
|
|
|
2848
|
-
|
|
2852
|
+
_debug_progressbar(full_msg)
|
|
2849
2853
|
|
|
2850
|
-
|
|
2854
|
+
last_msg_raw = msg
|
|
2855
|
+
last_msg_progressbar = full_msg
|
|
2856
|
+
except Exception as e:
|
|
2857
|
+
print(f"Error in print_debug_progressbar: {e}", flush=True)
|
|
2851
2858
|
|
|
2852
2859
|
def get_process_info(pid: Any) -> str:
|
|
2853
2860
|
try:
|
|
@@ -5766,7 +5773,7 @@ def get_generate_and_test_random_function_str() -> str:
|
|
|
5766
5773
|
)
|
|
5767
5774
|
|
|
5768
5775
|
return f"""
|
|
5769
|
-
def generate_and_test_random_parameters(n):
|
|
5776
|
+
def generate_and_test_random_parameters(n: int) -> None:
|
|
5770
5777
|
for _ in range(n):
|
|
5771
5778
|
print("======================================")
|
|
5772
5779
|
parameters, trial_index = ax_client.get_next_trial()
|
|
@@ -7309,15 +7316,41 @@ def mark_trial_as_failed(trial_index: int, _trial: Any) -> None:
|
|
|
7309
7316
|
|
|
7310
7317
|
return None
|
|
7311
7318
|
|
|
7312
|
-
def check_valid_result(result: Union[None,
|
|
7319
|
+
def check_valid_result(result: Union[None, dict]) -> bool:
|
|
7313
7320
|
possible_val_not_found_values = [
|
|
7314
7321
|
VAL_IF_NOTHING_FOUND,
|
|
7315
7322
|
-VAL_IF_NOTHING_FOUND,
|
|
7316
7323
|
-99999999999999997168788049560464200849936328366177157906432,
|
|
7317
7324
|
99999999999999997168788049560464200849936328366177157906432
|
|
7318
7325
|
]
|
|
7319
|
-
|
|
7320
|
-
|
|
7326
|
+
|
|
7327
|
+
def flatten_values(obj: Any) -> Any:
|
|
7328
|
+
values = []
|
|
7329
|
+
try:
|
|
7330
|
+
if isinstance(obj, dict):
|
|
7331
|
+
for v in obj.values():
|
|
7332
|
+
values.extend(flatten_values(v))
|
|
7333
|
+
elif isinstance(obj, (list, tuple, set)):
|
|
7334
|
+
for v in obj:
|
|
7335
|
+
values.extend(flatten_values(v))
|
|
7336
|
+
else:
|
|
7337
|
+
values.append(obj)
|
|
7338
|
+
except Exception as e:
|
|
7339
|
+
print(f"Error while flattening values: {e}")
|
|
7340
|
+
return values
|
|
7341
|
+
|
|
7342
|
+
if result is None:
|
|
7343
|
+
return False
|
|
7344
|
+
|
|
7345
|
+
try:
|
|
7346
|
+
all_values = flatten_values(result)
|
|
7347
|
+
for val in all_values:
|
|
7348
|
+
if val in possible_val_not_found_values:
|
|
7349
|
+
return False
|
|
7350
|
+
return True
|
|
7351
|
+
except Exception as e:
|
|
7352
|
+
print(f"Error while checking result validity: {e}")
|
|
7353
|
+
return False
|
|
7321
7354
|
|
|
7322
7355
|
def update_ax_client_trial(trial_idx: int, result: Union[list, dict]) -> None:
|
|
7323
7356
|
if not ax_client:
|
|
@@ -7358,13 +7391,52 @@ def _finish_job_core_helper_complete_trial(trial_index: int, raw_result: dict) -
|
|
|
7358
7391
|
|
|
7359
7392
|
return None
|
|
7360
7393
|
|
|
7361
|
-
def
|
|
7394
|
+
def format_result_for_display(result: dict) -> str:
|
|
7395
|
+
def safe_float(v: Any) -> str:
|
|
7396
|
+
try:
|
|
7397
|
+
if v is None:
|
|
7398
|
+
return "None"
|
|
7399
|
+
if isinstance(v, (int, float)):
|
|
7400
|
+
if math.isnan(v):
|
|
7401
|
+
return "NaN"
|
|
7402
|
+
if math.isinf(v):
|
|
7403
|
+
return "∞" if v > 0 else "-∞"
|
|
7404
|
+
return f"{v:.6f}"
|
|
7405
|
+
return str(v)
|
|
7406
|
+
except Exception as e:
|
|
7407
|
+
return f"<error: {e}>"
|
|
7408
|
+
|
|
7409
|
+
try:
|
|
7410
|
+
if not isinstance(result, dict):
|
|
7411
|
+
return safe_float(result)
|
|
7412
|
+
|
|
7413
|
+
parts = []
|
|
7414
|
+
for key, val in result.items():
|
|
7415
|
+
try:
|
|
7416
|
+
if isinstance(val, (list, tuple)) and len(val) == 2:
|
|
7417
|
+
main, sem = val
|
|
7418
|
+
main_str = safe_float(main)
|
|
7419
|
+
if sem is not None:
|
|
7420
|
+
sem_str = safe_float(sem)
|
|
7421
|
+
parts.append(f"{key}: {main_str} (SEM: {sem_str})")
|
|
7422
|
+
else:
|
|
7423
|
+
parts.append(f"{key}: {main_str}")
|
|
7424
|
+
else:
|
|
7425
|
+
parts.append(f"{key}: {safe_float(val)}")
|
|
7426
|
+
except Exception as e:
|
|
7427
|
+
parts.append(f"{key}: <error: {e}>")
|
|
7428
|
+
|
|
7429
|
+
return ", ".join(parts)
|
|
7430
|
+
except Exception as e:
|
|
7431
|
+
return f"<error formatting result: {e}>"
|
|
7432
|
+
|
|
7433
|
+
def _finish_job_core_helper_mark_success(_trial: ax.core.trial.Trial, result: dict) -> None:
|
|
7362
7434
|
print_debug(f"Marking trial {_trial} as completed")
|
|
7363
7435
|
_trial.mark_completed(unsafe=True)
|
|
7364
7436
|
|
|
7365
7437
|
succeeded_jobs(1)
|
|
7366
7438
|
|
|
7367
|
-
progressbar_description(f"new result: {result}")
|
|
7439
|
+
progressbar_description(f"new result: {format_result_for_display(result)}")
|
|
7368
7440
|
update_progress_bar(1)
|
|
7369
7441
|
|
|
7370
7442
|
save_results_csv()
|
|
@@ -7396,9 +7468,6 @@ def finish_job_core(job: Any, trial_index: int, this_jobs_finished: int) -> int:
|
|
|
7396
7468
|
result = job.result()
|
|
7397
7469
|
print_debug(f"finish_job_core: trial-index: {trial_index}, job.result(): {result}, state: {state_from_job(job)}")
|
|
7398
7470
|
|
|
7399
|
-
raw_result = result
|
|
7400
|
-
result_keys = list(result.keys())
|
|
7401
|
-
result = result[result_keys[0]]
|
|
7402
7471
|
this_jobs_finished += 1
|
|
7403
7472
|
|
|
7404
7473
|
if ax_client:
|
|
@@ -7408,7 +7477,7 @@ def finish_job_core(job: Any, trial_index: int, this_jobs_finished: int) -> int:
|
|
|
7408
7477
|
return 0
|
|
7409
7478
|
|
|
7410
7479
|
if check_valid_result(result):
|
|
7411
|
-
_finish_job_core_helper_complete_trial(trial_index,
|
|
7480
|
+
_finish_job_core_helper_complete_trial(trial_index, result)
|
|
7412
7481
|
|
|
7413
7482
|
try:
|
|
7414
7483
|
_finish_job_core_helper_mark_success(_trial, result)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|