omniopt2 8712__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-8712 → omniopt2-8721}/.omniopt.py +72 -10
- {omniopt2-8712 → omniopt2-8721}/PKG-INFO +1 -1
- {omniopt2-8712 → omniopt2-8721}/omniopt +1 -1
- {omniopt2-8712 → omniopt2-8721}/omniopt2.egg-info/PKG-INFO +1 -1
- {omniopt2-8712 → omniopt2-8721}/pyproject.toml +1 -1
- {omniopt2-8712 → omniopt2-8721}/.colorfunctions.sh +0 -0
- {omniopt2-8712 → omniopt2-8721}/.dockerignore +0 -0
- {omniopt2-8712 → omniopt2-8721}/.general.sh +0 -0
- {omniopt2-8712 → omniopt2-8721}/.gitignore +0 -0
- {omniopt2-8712 → omniopt2-8721}/.helpers.py +0 -0
- {omniopt2-8712 → omniopt2-8721}/.omniopt_plot_cpu_ram_usage.py +0 -0
- {omniopt2-8712 → omniopt2-8721}/.omniopt_plot_general.py +0 -0
- {omniopt2-8712 → omniopt2-8721}/.omniopt_plot_gpu_usage.py +0 -0
- {omniopt2-8712 → omniopt2-8721}/.omniopt_plot_kde.py +0 -0
- {omniopt2-8712 → omniopt2-8721}/.omniopt_plot_scatter.py +0 -0
- {omniopt2-8712 → omniopt2-8721}/.omniopt_plot_scatter_generation_method.py +0 -0
- {omniopt2-8712 → omniopt2-8721}/.omniopt_plot_scatter_hex.py +0 -0
- {omniopt2-8712 → omniopt2-8721}/.omniopt_plot_time_and_exit_code.py +0 -0
- {omniopt2-8712 → omniopt2-8721}/.omniopt_plot_trial_index_result.py +0 -0
- {omniopt2-8712 → omniopt2-8721}/.omniopt_plot_worker.py +0 -0
- {omniopt2-8712 → omniopt2-8721}/.random_generator.py +0 -0
- {omniopt2-8712 → omniopt2-8721}/.shellscript_functions +0 -0
- {omniopt2-8712 → omniopt2-8721}/.tests/pylint.rc +0 -0
- {omniopt2-8712 → omniopt2-8721}/.tpe.py +0 -0
- {omniopt2-8712 → omniopt2-8721}/LICENSE +0 -0
- {omniopt2-8712 → omniopt2-8721}/MANIFEST.in +0 -0
- {omniopt2-8712 → omniopt2-8721}/README.md +0 -0
- {omniopt2-8712 → omniopt2-8721}/apt-dependencies.txt +0 -0
- {omniopt2-8712 → omniopt2-8721}/omniopt2.egg-info/SOURCES.txt +0 -0
- {omniopt2-8712 → omniopt2-8721}/omniopt2.egg-info/dependency_links.txt +0 -0
- {omniopt2-8712 → omniopt2-8721}/omniopt2.egg-info/requires.txt +0 -0
- {omniopt2-8712 → omniopt2-8721}/omniopt2.egg-info/top_level.txt +0 -0
- {omniopt2-8712 → omniopt2-8721}/omniopt_docker +0 -0
- {omniopt2-8712 → omniopt2-8721}/omniopt_evaluate +0 -0
- {omniopt2-8712 → omniopt2-8721}/omniopt_plot +0 -0
- {omniopt2-8712 → omniopt2-8721}/omniopt_share +0 -0
- {omniopt2-8712 → omniopt2-8721}/requirements.txt +0 -0
- {omniopt2-8712 → omniopt2-8721}/setup.cfg +0 -0
- {omniopt2-8712 → omniopt2-8721}/setup.py +0 -0
- {omniopt2-8712 → omniopt2-8721}/test_requirements.txt +0 -0
|
@@ -5773,7 +5773,7 @@ def get_generate_and_test_random_function_str() -> str:
|
|
|
5773
5773
|
)
|
|
5774
5774
|
|
|
5775
5775
|
return f"""
|
|
5776
|
-
def generate_and_test_random_parameters(n):
|
|
5776
|
+
def generate_and_test_random_parameters(n: int) -> None:
|
|
5777
5777
|
for _ in range(n):
|
|
5778
5778
|
print("======================================")
|
|
5779
5779
|
parameters, trial_index = ax_client.get_next_trial()
|
|
@@ -7316,15 +7316,41 @@ def mark_trial_as_failed(trial_index: int, _trial: Any) -> None:
|
|
|
7316
7316
|
|
|
7317
7317
|
return None
|
|
7318
7318
|
|
|
7319
|
-
def check_valid_result(result: Union[None,
|
|
7319
|
+
def check_valid_result(result: Union[None, dict]) -> bool:
|
|
7320
7320
|
possible_val_not_found_values = [
|
|
7321
7321
|
VAL_IF_NOTHING_FOUND,
|
|
7322
7322
|
-VAL_IF_NOTHING_FOUND,
|
|
7323
7323
|
-99999999999999997168788049560464200849936328366177157906432,
|
|
7324
7324
|
99999999999999997168788049560464200849936328366177157906432
|
|
7325
7325
|
]
|
|
7326
|
-
|
|
7327
|
-
|
|
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
|
|
7328
7354
|
|
|
7329
7355
|
def update_ax_client_trial(trial_idx: int, result: Union[list, dict]) -> None:
|
|
7330
7356
|
if not ax_client:
|
|
@@ -7365,13 +7391,52 @@ def _finish_job_core_helper_complete_trial(trial_index: int, raw_result: dict) -
|
|
|
7365
7391
|
|
|
7366
7392
|
return None
|
|
7367
7393
|
|
|
7368
|
-
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:
|
|
7369
7434
|
print_debug(f"Marking trial {_trial} as completed")
|
|
7370
7435
|
_trial.mark_completed(unsafe=True)
|
|
7371
7436
|
|
|
7372
7437
|
succeeded_jobs(1)
|
|
7373
7438
|
|
|
7374
|
-
progressbar_description(f"new result: {result}")
|
|
7439
|
+
progressbar_description(f"new result: {format_result_for_display(result)}")
|
|
7375
7440
|
update_progress_bar(1)
|
|
7376
7441
|
|
|
7377
7442
|
save_results_csv()
|
|
@@ -7403,9 +7468,6 @@ def finish_job_core(job: Any, trial_index: int, this_jobs_finished: int) -> int:
|
|
|
7403
7468
|
result = job.result()
|
|
7404
7469
|
print_debug(f"finish_job_core: trial-index: {trial_index}, job.result(): {result}, state: {state_from_job(job)}")
|
|
7405
7470
|
|
|
7406
|
-
raw_result = result
|
|
7407
|
-
result_keys = list(result.keys())
|
|
7408
|
-
result = result[result_keys[0]]
|
|
7409
7471
|
this_jobs_finished += 1
|
|
7410
7472
|
|
|
7411
7473
|
if ax_client:
|
|
@@ -7415,7 +7477,7 @@ def finish_job_core(job: Any, trial_index: int, this_jobs_finished: int) -> int:
|
|
|
7415
7477
|
return 0
|
|
7416
7478
|
|
|
7417
7479
|
if check_valid_result(result):
|
|
7418
|
-
_finish_job_core_helper_complete_trial(trial_index,
|
|
7480
|
+
_finish_job_core_helper_complete_trial(trial_index, result)
|
|
7419
7481
|
|
|
7420
7482
|
try:
|
|
7421
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
|