omniopt2 8331__tar.gz → 8341__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.

Files changed (40) hide show
  1. {omniopt2-8331 → omniopt2-8341}/.omniopt.py +21 -64
  2. {omniopt2-8331 → omniopt2-8341}/PKG-INFO +1 -1
  3. {omniopt2-8331 → omniopt2-8341}/omniopt +13 -11
  4. {omniopt2-8331 → omniopt2-8341}/omniopt2.egg-info/PKG-INFO +1 -1
  5. {omniopt2-8331 → omniopt2-8341}/pyproject.toml +1 -1
  6. {omniopt2-8331 → omniopt2-8341}/.colorfunctions.sh +0 -0
  7. {omniopt2-8331 → omniopt2-8341}/.dockerignore +0 -0
  8. {omniopt2-8331 → omniopt2-8341}/.general.sh +0 -0
  9. {omniopt2-8331 → omniopt2-8341}/.gitignore +0 -0
  10. {omniopt2-8331 → omniopt2-8341}/.helpers.py +0 -0
  11. {omniopt2-8331 → omniopt2-8341}/.omniopt_plot_cpu_ram_usage.py +0 -0
  12. {omniopt2-8331 → omniopt2-8341}/.omniopt_plot_general.py +0 -0
  13. {omniopt2-8331 → omniopt2-8341}/.omniopt_plot_gpu_usage.py +0 -0
  14. {omniopt2-8331 → omniopt2-8341}/.omniopt_plot_kde.py +0 -0
  15. {omniopt2-8331 → omniopt2-8341}/.omniopt_plot_scatter.py +0 -0
  16. {omniopt2-8331 → omniopt2-8341}/.omniopt_plot_scatter_generation_method.py +0 -0
  17. {omniopt2-8331 → omniopt2-8341}/.omniopt_plot_scatter_hex.py +0 -0
  18. {omniopt2-8331 → omniopt2-8341}/.omniopt_plot_time_and_exit_code.py +0 -0
  19. {omniopt2-8331 → omniopt2-8341}/.omniopt_plot_trial_index_result.py +0 -0
  20. {omniopt2-8331 → omniopt2-8341}/.omniopt_plot_worker.py +0 -0
  21. {omniopt2-8331 → omniopt2-8341}/.random_generator.py +0 -0
  22. {omniopt2-8331 → omniopt2-8341}/.shellscript_functions +0 -0
  23. {omniopt2-8331 → omniopt2-8341}/.tests/pylint.rc +0 -0
  24. {omniopt2-8331 → omniopt2-8341}/.tpe.py +0 -0
  25. {omniopt2-8331 → omniopt2-8341}/LICENSE +0 -0
  26. {omniopt2-8331 → omniopt2-8341}/MANIFEST.in +0 -0
  27. {omniopt2-8331 → omniopt2-8341}/README.md +0 -0
  28. {omniopt2-8331 → omniopt2-8341}/apt-dependencies.txt +0 -0
  29. {omniopt2-8331 → omniopt2-8341}/omniopt2.egg-info/SOURCES.txt +0 -0
  30. {omniopt2-8331 → omniopt2-8341}/omniopt2.egg-info/dependency_links.txt +0 -0
  31. {omniopt2-8331 → omniopt2-8341}/omniopt2.egg-info/requires.txt +0 -0
  32. {omniopt2-8331 → omniopt2-8341}/omniopt2.egg-info/top_level.txt +0 -0
  33. {omniopt2-8331 → omniopt2-8341}/omniopt_docker +0 -0
  34. {omniopt2-8331 → omniopt2-8341}/omniopt_evaluate +0 -0
  35. {omniopt2-8331 → omniopt2-8341}/omniopt_plot +0 -0
  36. {omniopt2-8331 → omniopt2-8341}/omniopt_share +0 -0
  37. {omniopt2-8331 → omniopt2-8341}/requirements.txt +0 -0
  38. {omniopt2-8331 → omniopt2-8341}/setup.cfg +0 -0
  39. {omniopt2-8331 → omniopt2-8341}/setup.py +0 -0
  40. {omniopt2-8331 → omniopt2-8341}/test_requirements.txt +0 -0
@@ -2133,25 +2133,25 @@ def try_saving_to_db() -> None:
2133
2133
  except Exception as e:
2134
2134
  print_debug(f"Failed trying to save sqlite3-DB: {e}")
2135
2135
 
2136
- def merge_with_job_infos(pd_frame: pd.DataFrame) -> pd.DataFrame:
2136
+ def merge_with_job_infos(df: pd.DataFrame) -> pd.DataFrame:
2137
2137
  job_infos_path = os.path.join(get_current_run_folder(), "job_infos.csv")
2138
2138
  if not os.path.exists(job_infos_path):
2139
- return pd_frame
2139
+ return df
2140
2140
 
2141
2141
  job_df = pd.read_csv(job_infos_path)
2142
2142
 
2143
- if 'trial_index' not in pd_frame.columns or 'trial_index' not in job_df.columns:
2143
+ if 'trial_index' not in df.columns or 'trial_index' not in job_df.columns:
2144
2144
  raise ValueError("Both DataFrames must contain a 'trial_index' column.")
2145
2145
 
2146
- job_df_filtered = job_df[job_df['trial_index'].isin(pd_frame['trial_index'])]
2146
+ job_df_filtered = job_df[job_df['trial_index'].isin(df['trial_index'])]
2147
2147
 
2148
- new_cols = [col for col in job_df_filtered.columns if col != 'trial_index' and col not in pd_frame.columns]
2148
+ new_cols = [col for col in job_df_filtered.columns if col != 'trial_index' and col not in df.columns]
2149
2149
 
2150
2150
  job_df_reduced = job_df_filtered[['trial_index'] + new_cols]
2151
2151
 
2152
- merged = pd.merge(pd_frame, job_df_reduced, on='trial_index', how='left')
2152
+ merged = pd.merge(df, job_df_reduced, on='trial_index', how='left')
2153
2153
 
2154
- old_cols = [col for col in pd_frame.columns if col != 'trial_index']
2154
+ old_cols = [col for col in df.columns if col != 'trial_index']
2155
2155
 
2156
2156
  new_order = ['trial_index'] + new_cols + old_cols
2157
2157
 
@@ -2159,47 +2159,6 @@ def merge_with_job_infos(pd_frame: pd.DataFrame) -> pd.DataFrame:
2159
2159
 
2160
2160
  return merged
2161
2161
 
2162
- def reindex_trials(df: pd.DataFrame) -> pd.DataFrame:
2163
- """
2164
- Ensure trial_index is sequential and arm_name unique.
2165
- Keep arm_name unless all parameters except 'order', 'hostname', 'queue_time' match.
2166
- """
2167
- if "trial_index" not in df.columns or "arm_name" not in df.columns:
2168
- return df
2169
-
2170
- # Sort by something stable (queue_time if available)
2171
- sort_cols = ["queue_time"] if "queue_time" in df.columns else df.columns.tolist()
2172
- df = df.sort_values(by=sort_cols, ignore_index=True)
2173
-
2174
- # Mapping from "parameter signature" to assigned arm_name
2175
- seen_signatures = {}
2176
- new_arm_names = []
2177
-
2178
- for new_idx, row in df.iterrows():
2179
- # Create signature without 'order', 'hostname', 'queue_time', 'trial_index', 'arm_name'
2180
- ignore_cols = {"order", "hostname", "queue_time", "trial_index", "arm_name"}
2181
- signature = tuple((col, row[col]) for col in df.columns if col not in ignore_cols)
2182
-
2183
- if signature in seen_signatures:
2184
- # Collision → make a unique name
2185
- base_name = seen_signatures[signature]
2186
- suffix = 1
2187
- new_name = f"{base_name}_{suffix}"
2188
- while new_name in new_arm_names:
2189
- suffix += 1
2190
- new_name = f"{base_name}_{suffix}"
2191
- new_arm_names.append(new_name)
2192
- else:
2193
- # First occurrence → use new_idx as trial index in name
2194
- new_name = f"{new_idx}_0"
2195
- seen_signatures[signature] = f"{new_idx}_0"
2196
- new_arm_names.append(new_name)
2197
-
2198
- df.at[new_idx, "trial_index"] = new_idx
2199
- df.at[new_idx, "arm_name"] = new_name
2200
-
2201
- return df
2202
-
2203
2162
  def save_results_csv() -> Optional[str]:
2204
2163
  if args.dryrun:
2205
2164
  return None
@@ -2214,8 +2173,8 @@ def save_results_csv() -> Optional[str]:
2214
2173
  save_checkpoint()
2215
2174
 
2216
2175
  try:
2217
- pd_frame = fetch_and_prepare_trials()
2218
- write_csv(pd_frame, pd_csv)
2176
+ df = fetch_and_prepare_trials()
2177
+ write_csv(df, pd_csv)
2219
2178
  write_json_snapshot(pd_json)
2220
2179
  save_experiment_to_file()
2221
2180
 
@@ -2237,10 +2196,21 @@ def get_results_paths() -> tuple[str, str]:
2237
2196
  def fetch_and_prepare_trials() -> pd.DataFrame:
2238
2197
  ax_client.experiment.fetch_data()
2239
2198
  df = ax_client.get_trials_data_frame()
2199
+
2200
+ #print("========================")
2201
+ #print("BEFORE merge_with_job_infos:")
2202
+ #print(df["generation_node"])
2240
2203
  df = merge_with_job_infos(df)
2241
- return reindex_trials(df)
2204
+ #print("AFTER merge_with_job_infos:")
2205
+ #print(df["generation_node"])
2206
+
2207
+ return df
2242
2208
 
2243
2209
  def write_csv(df, path: str) -> None:
2210
+ try:
2211
+ df = df.sort_values(by=["trial_index"], kind="stable").reset_index(drop=True)
2212
+ except KeyError:
2213
+ pass
2244
2214
  df.to_csv(path, index=False, float_format="%.30f")
2245
2215
 
2246
2216
  def write_json_snapshot(path: str) -> None:
@@ -5051,8 +5021,6 @@ def end_program(_force: Optional[bool] = False, exit_code: Optional[int] = None)
5051
5021
 
5052
5022
  abandon_all_jobs()
5053
5023
 
5054
- save_results_csv()
5055
-
5056
5024
  if exit_code:
5057
5025
  _exit = exit_code
5058
5026
 
@@ -7590,8 +7558,6 @@ def execute_evaluation(_params: list) -> Optional[int]:
7590
7558
  trial_counter += 1
7591
7559
 
7592
7560
  progressbar_description("started new job")
7593
-
7594
- save_results_csv()
7595
7561
  except submitit.core.utils.FailedJobError as error:
7596
7562
  handle_failed_job(error, trial_index, new_job)
7597
7563
  trial_counter += 1
@@ -7882,8 +7848,6 @@ def get_batched_arms(nr_of_jobs_to_get: int) -> list:
7882
7848
 
7883
7849
  print_debug(f"get_batched_arms: Finished with {len(batched_arms)} arm(s) after {attempts} attempt(s).")
7884
7850
 
7885
- save_results_csv()
7886
-
7887
7851
  return batched_arms
7888
7852
 
7889
7853
  def fetch_next_trials(nr_of_jobs_to_get: int, recursion: bool = False) -> Tuple[Dict[int, Any], bool]:
@@ -7938,8 +7902,6 @@ def generate_trials(n: int, recursion: bool) -> Tuple[Dict[int, Any], bool]:
7938
7902
  cnt += 1
7939
7903
  trials_dict[trial_index] = arm.parameters
7940
7904
 
7941
- save_results_csv()
7942
-
7943
7905
  return _finalize_generation(trials_dict, cnt, n, start_time)
7944
7906
 
7945
7907
  except Exception as e:
@@ -8820,10 +8782,6 @@ def execute_trials(
8820
8782
  index_param_list.append(_args)
8821
8783
  i += 1
8822
8784
 
8823
- save_results_csv()
8824
-
8825
- save_results_csv()
8826
-
8827
8785
  start_time = time.time()
8828
8786
 
8829
8787
  cnt = 0
@@ -9655,7 +9613,6 @@ def load_experiment_state() -> None:
9655
9613
  state_path = get_current_run_folder("experiment_state.json")
9656
9614
 
9657
9615
  if not os.path.exists(state_path):
9658
- print(f"State file {state_path} does not exist, starting fresh")
9659
9616
  return
9660
9617
 
9661
9618
  if args.worker_generator_path:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: omniopt2
3
- Version: 8331
3
+ Version: 8341
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
@@ -81,7 +81,7 @@
81
81
 
82
82
  function end_all_bg_processes {
83
83
  for bg_job_id in $(jobs -p | sed -e 's#.*][[:space:]]*+[[:space:]]*##' -e 's#[[:space:]].*##'); do
84
- kill $bg_job_id 2>/dev/null >/dev/null
84
+ kill "$bg_job_id" 2>/dev/null >/dev/null
85
85
  done
86
86
  }
87
87
 
@@ -110,8 +110,8 @@
110
110
 
111
111
  if (command -v sbatch >/dev/null && [[ -n "$SLURM_JOB_ID" ]]) || ! command -v sbatch >/dev/null; then
112
112
  already_logging_this_command=1
113
- exec 1> >(tee -ia $bash_logname)
114
- exec 2> >(tee -ia $bash_logname >& 2)
113
+ exec 1> >(tee -ia "$bash_logname")
114
+ exec 2> >(tee -ia "$bash_logname" >& 2)
115
115
  fi
116
116
  else
117
117
  echo "uuidgen is not installed. It's recommended you install it." >&2
@@ -124,7 +124,7 @@
124
124
  ram_children=0
125
125
 
126
126
  for pid in $(pgrep -P $$); do
127
- child_ram=$(grep VmRSS /proc/$pid/status 2>/dev/null | awk '{print $2 / 1024}')
127
+ child_ram=$(grep VmRSS "/proc/$pid/status" 2>/dev/null | awk '{print $2 / 1024}')
128
128
  ram_children=$(awk -v a="$ram_children" -v b="$child_ram" 'BEGIN {print a + b}')
129
129
  done
130
130
 
@@ -170,7 +170,7 @@
170
170
  while true; do
171
171
  date_str=$(date +"%Y-%m-%d %H:%M:%S")
172
172
  echo -e "\n\n$date_str -> $(show_ram)\n\n" >&2
173
- sleep $n
173
+ sleep "$n"
174
174
  done
175
175
  }
176
176
 
@@ -400,7 +400,7 @@
400
400
  fi
401
401
  fi
402
402
 
403
- exit $CODE
403
+ exit "$CODE"
404
404
  }
405
405
 
406
406
  function get_anon_user_id {
@@ -1188,7 +1188,7 @@ EOF
1188
1188
  myexit 211
1189
1189
  }
1190
1190
 
1191
- bash omniopt $*
1191
+ bash omniopt "$*"
1192
1192
  exit_code=$?
1193
1193
 
1194
1194
  myexit $exit_code
@@ -1882,8 +1882,8 @@ EOF
1882
1882
  tail_log_file
1883
1883
 
1884
1884
  if [[ $already_logging_this_command -eq 0 ]]; then
1885
- exec 1> >(tee -ia $bash_logname)
1886
- exec 2> >(tee -ia $bash_logname >& 2)
1885
+ exec 1> >(tee -ia "$bash_logname")
1886
+ exec 2> >(tee -ia "$bash_logname" >& 2)
1887
1887
  fi
1888
1888
 
1889
1889
 
@@ -1894,13 +1894,15 @@ EOF
1894
1894
  fi
1895
1895
 
1896
1896
  exit_code_sed=$(echo "$exit_code_lines" | sed -e 's#Exit-Code:*[[:space:]]*##i' -e 's#,.*##')
1897
- if [ $? -ne 0 ] || [ -z "$exit_code_sed" ]; then
1897
+ exit_code_sed_sed=$?
1898
+ if [ $exit_code_sed_sed -ne 0 ] || [ -z "$exit_code_sed" ]; then
1898
1899
  echo "WARN: sed failed or no data after sed."
1899
1900
  exit_code_sed=""
1900
1901
  fi
1901
1902
 
1902
1903
  exit_code_tail=$(echo "$exit_code_sed" | tail -n1)
1903
- if [ $? -ne 0 ] || [ -z "$exit_code_tail" ]; then
1904
+ exit_code_tail_tail=$?
1905
+ if [ $exit_code_tail_tail -ne 0 ] || [ -z "$exit_code_tail" ]; then
1904
1906
  echo "WARN: tail failed or no data after tail."
1905
1907
  exit_code_tail=""
1906
1908
  fi
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: omniopt2
3
- Version: 8331
3
+ Version: 8341
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 = "8331"
8
+ version = "8341"
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