omniopt2 7099__tar.gz → 7100__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.
Files changed (39) hide show
  1. {omniopt2-7099 → omniopt2-7100}/.omniopt.py +80 -35
  2. {omniopt2-7099 → omniopt2-7100}/PKG-INFO +1 -1
  3. {omniopt2-7099 → omniopt2-7100}/omniopt2.egg-info/PKG-INFO +1 -1
  4. {omniopt2-7099 → omniopt2-7100}/pyproject.toml +1 -1
  5. {omniopt2-7099 → omniopt2-7100}/.colorfunctions.sh +0 -0
  6. {omniopt2-7099 → omniopt2-7100}/.dockerignore +0 -0
  7. {omniopt2-7099 → omniopt2-7100}/.general.sh +0 -0
  8. {omniopt2-7099 → omniopt2-7100}/.gitignore +0 -0
  9. {omniopt2-7099 → omniopt2-7100}/.helpers.py +0 -0
  10. {omniopt2-7099 → omniopt2-7100}/.omniopt_plot_cpu_ram_usage.py +0 -0
  11. {omniopt2-7099 → omniopt2-7100}/.omniopt_plot_general.py +0 -0
  12. {omniopt2-7099 → omniopt2-7100}/.omniopt_plot_gpu_usage.py +0 -0
  13. {omniopt2-7099 → omniopt2-7100}/.omniopt_plot_kde.py +0 -0
  14. {omniopt2-7099 → omniopt2-7100}/.omniopt_plot_scatter.py +0 -0
  15. {omniopt2-7099 → omniopt2-7100}/.omniopt_plot_scatter_generation_method.py +0 -0
  16. {omniopt2-7099 → omniopt2-7100}/.omniopt_plot_scatter_hex.py +0 -0
  17. {omniopt2-7099 → omniopt2-7100}/.omniopt_plot_time_and_exit_code.py +0 -0
  18. {omniopt2-7099 → omniopt2-7100}/.omniopt_plot_trial_index_result.py +0 -0
  19. {omniopt2-7099 → omniopt2-7100}/.omniopt_plot_worker.py +0 -0
  20. {omniopt2-7099 → omniopt2-7100}/.random_generator.py +0 -0
  21. {omniopt2-7099 → omniopt2-7100}/.shellscript_functions +0 -0
  22. {omniopt2-7099 → omniopt2-7100}/.tpe.py +0 -0
  23. {omniopt2-7099 → omniopt2-7100}/LICENSE +0 -0
  24. {omniopt2-7099 → omniopt2-7100}/MANIFEST.in +0 -0
  25. {omniopt2-7099 → omniopt2-7100}/README.md +0 -0
  26. {omniopt2-7099 → omniopt2-7100}/apt-dependencies.txt +0 -0
  27. {omniopt2-7099 → omniopt2-7100}/omniopt +0 -0
  28. {omniopt2-7099 → omniopt2-7100}/omniopt2.egg-info/SOURCES.txt +0 -0
  29. {omniopt2-7099 → omniopt2-7100}/omniopt2.egg-info/dependency_links.txt +0 -0
  30. {omniopt2-7099 → omniopt2-7100}/omniopt2.egg-info/requires.txt +0 -0
  31. {omniopt2-7099 → omniopt2-7100}/omniopt2.egg-info/top_level.txt +0 -0
  32. {omniopt2-7099 → omniopt2-7100}/omniopt_docker +0 -0
  33. {omniopt2-7099 → omniopt2-7100}/omniopt_evaluate +0 -0
  34. {omniopt2-7099 → omniopt2-7100}/omniopt_plot +0 -0
  35. {omniopt2-7099 → omniopt2-7100}/omniopt_share +0 -0
  36. {omniopt2-7099 → omniopt2-7100}/requirements.txt +0 -0
  37. {omniopt2-7099 → omniopt2-7100}/setup.cfg +0 -0
  38. {omniopt2-7099 → omniopt2-7100}/setup.py +0 -0
  39. {omniopt2-7099 → omniopt2-7100}/test_requirements.txt +0 -0
@@ -5562,54 +5562,99 @@ def parse_csv(csv_path: str) -> Tuple[List, List]:
5562
5562
 
5563
5563
  return arm_params_list, results_list
5564
5564
 
5565
+
5565
5566
  @beartype
5566
- def get_generation_node_for_index(this_csv_file_path: str, arm_params_list: list, results_list: list, index: int) -> str:
5567
+ def get_generation_node_for_index(
5568
+ this_csv_file_path: str,
5569
+ arm_params_list: List[Dict[str, Any]],
5570
+ results_list: List[Dict[str, Any]],
5571
+ index: int
5572
+ ) -> str:
5567
5573
  try:
5568
- if index < 0 or index >= len(arm_params_list) or index >= len(results_list):
5574
+ if not _get_generation_node_for_index_index_valid(index, arm_params_list, results_list):
5569
5575
  return "MANUAL"
5570
5576
 
5571
5577
  target_arm_params = arm_params_list[index]
5572
5578
  target_result = results_list[index]
5573
5579
 
5574
- target_combined = {}
5575
- target_combined.update(target_arm_params)
5576
- target_combined.update(target_result)
5577
-
5578
- with open(this_csv_file_path, mode='r', newline='', encoding='utf-8') as csvfile:
5579
- reader = csv.DictReader(csvfile)
5580
- if reader.fieldnames is None or "generation_node" not in reader.fieldnames:
5581
- return "MANUAL"
5580
+ target_combined = _get_generation_node_for_index_combine_dicts(target_arm_params, target_result)
5582
5581
 
5583
- for row in reader:
5584
- all_match = True
5585
- for key, val in target_combined.items():
5586
- row_val = row.get(key)
5587
- if row_val is None:
5588
- all_match = False
5589
- break
5590
-
5591
- if isinstance(val, (int, float)):
5592
- try:
5593
- row_val_num = float(row_val)
5594
- val_num = float(val)
5595
- if abs(row_val_num - val_num) > 1e-8:
5596
- all_match = False
5597
- break
5598
- except ValueError:
5599
- all_match = False
5600
- break
5601
- else:
5602
- if str(val) != row_val:
5603
- all_match = False
5604
- break
5605
-
5606
- if all_match:
5607
- return row["generation_node"]
5582
+ generation_node = _get_generation_node_for_index_find_generation_node(this_csv_file_path, target_combined)
5583
+ return generation_node
5608
5584
  except Exception as e:
5609
5585
  print(f"Error while get_generation_node_for_index: {e}")
5586
+ return "MANUAL"
5587
+
5588
+
5589
+ @beartype
5590
+ def _get_generation_node_for_index_index_valid(
5591
+ index: int,
5592
+ arm_params_list: List[Dict[str, Any]],
5593
+ results_list: List[Dict[str, Any]]
5594
+ ) -> bool:
5595
+ return 0 <= index < len(arm_params_list) and index < len(results_list)
5596
+
5597
+
5598
+ @beartype
5599
+ def _get_generation_node_for_index_combine_dicts(
5600
+ dict1: Dict[str, Any],
5601
+ dict2: Dict[str, Any]
5602
+ ) -> Dict[str, Any]:
5603
+ combined = {}
5604
+ combined.update(dict1)
5605
+ combined.update(dict2)
5606
+ return combined
5607
+
5608
+
5609
+ @beartype
5610
+ def _get_generation_node_for_index_find_generation_node(
5611
+ csv_file_path: str,
5612
+ target_combined: Dict[str, Any]
5613
+ ) -> str:
5614
+ with open(csv_file_path, mode='r', newline='', encoding='utf-8') as csvfile:
5615
+ reader = csv.DictReader(csvfile)
5616
+ if reader.fieldnames is None or "generation_node" not in reader.fieldnames:
5617
+ return "MANUAL"
5618
+
5619
+ for row in reader:
5620
+ if _get_generation_node_for_index_row_matches(row, target_combined):
5621
+ return row["generation_node"]
5610
5622
 
5611
5623
  return "MANUAL"
5612
5624
 
5625
+
5626
+ @beartype
5627
+ def _get_generation_node_for_index_row_matches(
5628
+ row: Dict[str, str],
5629
+ target_combined: Dict[str, Any]
5630
+ ) -> bool:
5631
+ for key, val in target_combined.items():
5632
+ row_val = row.get(key)
5633
+ if row_val is None:
5634
+ return False
5635
+
5636
+ if isinstance(val, (int, float)):
5637
+ if not _get_generation_node_for_index_floats_match(val, row_val):
5638
+ return False
5639
+ else:
5640
+ if str(val) != row_val:
5641
+ return False
5642
+
5643
+ return True
5644
+
5645
+
5646
+ @beartype
5647
+ def _get_generation_node_for_index_floats_match(
5648
+ val: float,
5649
+ row_val_str: str,
5650
+ tolerance: float = 1e-8
5651
+ ) -> bool:
5652
+ try:
5653
+ row_val_num = float(row_val_str)
5654
+ except ValueError:
5655
+ return False
5656
+ return abs(row_val_num - val) <= tolerance
5657
+
5613
5658
  @beartype
5614
5659
  def insert_jobs_from_csv(this_csv_file_path: str, experiment_parameters: Optional[Union[List[Any], dict]]) -> None:
5615
5660
  if not os.path.exists(this_csv_file_path):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: omniopt2
3
- Version: 7099
3
+ Version: 7100
4
4
  Summary: Automatic highly parallelized hyperparameter optimizer based on Ax/Botorch
5
5
  Home-page: https://scads.ai/transfer-2/verfuegbare-software-dienste-en/omniopt/
6
6
  Author: Norman Koch
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: omniopt2
3
- Version: 7099
3
+ Version: 7100
4
4
  Summary: Automatic highly parallelized hyperparameter optimizer based on Ax/Botorch
5
5
  Home-page: https://scads.ai/transfer-2/verfuegbare-software-dienste-en/omniopt/
6
6
  Author: Norman Koch
@@ -5,7 +5,7 @@ authors = [
5
5
  {email = "norman.koch@tu-dresden.de"},
6
6
  {name = "Norman Koch"}
7
7
  ]
8
- version = "7099"
8
+ version = "7100"
9
9
 
10
10
  readme = "README.md"
11
11
  dynamic = ["dependencies"]
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