pyfemtet 0.9.5__py3-none-any.whl → 1.0.0b0__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 pyfemtet might be problematic. Click here for more details.

Files changed (272) hide show
  1. pyfemtet/__init__.py +6 -1
  2. pyfemtet/_i18n/1. make_pot_and_update_po.bat +8 -0
  3. pyfemtet/_i18n/2. build_mo.bat +5 -0
  4. pyfemtet/_i18n/__init__.py +4 -0
  5. pyfemtet/_i18n/babel.cfg +2 -0
  6. pyfemtet/_i18n/i18n.py +37 -0
  7. pyfemtet/_i18n/locales/ja/LC_MESSAGES/messages.mo +0 -0
  8. pyfemtet/_i18n/locales/ja/LC_MESSAGES/messages.po +1020 -0
  9. pyfemtet/_i18n/locales/messages.pot +987 -0
  10. pyfemtet/{_message → _i18n}/messages.py +128 -41
  11. pyfemtet/_util/closing.py +19 -0
  12. pyfemtet/_util/dask_util.py +89 -7
  13. pyfemtet/_util/df_util.py +29 -0
  14. pyfemtet/_util/excel_macro_util.py +8 -3
  15. pyfemtet/_util/excel_parse_util.py +43 -23
  16. pyfemtet/_util/femtet_access_inspection.py +120 -0
  17. pyfemtet/{_femtet_config_util/autosave.py → _util/femtet_autosave.py} +7 -0
  18. pyfemtet/_util/femtet_exit.py +105 -0
  19. pyfemtet/_util/femtet_version.py +20 -0
  20. pyfemtet/_util/helper.py +94 -0
  21. pyfemtet/_util/process_util.py +107 -0
  22. pyfemtet/_util/str_enum.py +44 -0
  23. pyfemtet/core.py +15 -47
  24. pyfemtet/dispatch_extensions/__init__.py +8 -11
  25. pyfemtet/dispatch_extensions/_impl.py +42 -198
  26. pyfemtet/logger/__init__.py +8 -1
  27. pyfemtet/logger/_impl.py +5 -6
  28. pyfemtet/opt/__init__.py +3 -17
  29. pyfemtet/opt/exceptions.py +45 -0
  30. pyfemtet/opt/femopt.py +608 -0
  31. pyfemtet/opt/history/__init__.py +11 -0
  32. pyfemtet/opt/history/_history.py +1404 -0
  33. pyfemtet/opt/history/_hypervolume.py +169 -0
  34. pyfemtet/opt/history/_optimality.py +79 -0
  35. pyfemtet/opt/interface/__init__.py +17 -24
  36. pyfemtet/opt/interface/_base_interface.py +222 -0
  37. pyfemtet/opt/interface/_excel_interface/__init__.py +3 -0
  38. pyfemtet/opt/interface/_excel_interface/debug-excel-interface.xlsm +0 -0
  39. pyfemtet/opt/interface/_excel_interface/excel_interface.py +999 -0
  40. pyfemtet/opt/interface/_femtet_interface/__init__.py +3 -0
  41. pyfemtet/opt/interface/{_femtet_parametric.py → _femtet_interface/_femtet_parametric.py} +20 -12
  42. pyfemtet/opt/interface/{_femtet.py → _femtet_interface/femtet_interface.py} +505 -349
  43. pyfemtet/opt/interface/_femtet_with_nx_interface/__init__.py +5 -0
  44. pyfemtet/opt/interface/_femtet_with_nx_interface/femtet_with_nx_interface.py +230 -0
  45. pyfemtet/opt/interface/_femtet_with_nx_interface/model1.prt +0 -0
  46. pyfemtet/opt/interface/_femtet_with_nx_interface/model1.x_t +98 -0
  47. pyfemtet/opt/interface/{_femtet_with_nx → _femtet_with_nx_interface}/update_model.py +1 -3
  48. pyfemtet/opt/interface/_femtet_with_solidworks/__init__.py +5 -0
  49. pyfemtet/opt/interface/_femtet_with_solidworks/femtet_with_solidworks_interface.py +122 -0
  50. pyfemtet/opt/interface/_solidworks_interface/__init__.py +5 -0
  51. pyfemtet/opt/interface/_solidworks_interface/solidworks_interface.py +206 -0
  52. pyfemtet/opt/interface/_surrogate_model_interface/__init__.py +8 -0
  53. pyfemtet/opt/interface/_surrogate_model_interface/base_surrogate_interface.py +150 -0
  54. pyfemtet/opt/interface/_surrogate_model_interface/botorch_interface.py +298 -0
  55. pyfemtet/opt/interface/_surrogate_model_interface/debug-pof-botorch.reccsv +18 -0
  56. pyfemtet/opt/interface/_with_excel_settings/__init__.py +61 -0
  57. pyfemtet/opt/interface/_with_excel_settings/with_excel_settings.py +134 -0
  58. pyfemtet/opt/meta_script/YAML_Generator.xlsm +0 -0
  59. pyfemtet/opt/meta_script/__main__.py +58 -36
  60. pyfemtet/opt/optimizer/__init__.py +7 -9
  61. pyfemtet/opt/optimizer/_base_optimizer.py +885 -0
  62. pyfemtet/opt/optimizer/optuna_optimizer/__init__.py +9 -0
  63. pyfemtet/opt/optimizer/optuna_optimizer/_optuna_attribute.py +73 -0
  64. pyfemtet/opt/optimizer/optuna_optimizer/_optuna_optimizer.py +678 -0
  65. pyfemtet/opt/optimizer/optuna_optimizer/_pof_botorch/__init__.py +7 -0
  66. pyfemtet/opt/optimizer/optuna_optimizer/_pof_botorch/debug-pof-botorch.reccsv +18 -0
  67. pyfemtet/opt/optimizer/optuna_optimizer/_pof_botorch/enable_nonlinear_constraint.py +244 -0
  68. pyfemtet/opt/optimizer/optuna_optimizer/_pof_botorch/pof_botorch_sampler.py +1249 -0
  69. pyfemtet/opt/optimizer/optuna_optimizer/wat_ex14_parametric_jp.femprj +0 -0
  70. pyfemtet/opt/optimizer/scipy_optimizer/__init__.py +1 -0
  71. pyfemtet/opt/optimizer/scipy_optimizer/_scipy_optimizer.py +364 -0
  72. pyfemtet/opt/prediction/__init__.py +7 -0
  73. pyfemtet/opt/prediction/_botorch_utils.py +133 -0
  74. pyfemtet/opt/prediction/_gpytorch_modules_extension.py +142 -0
  75. pyfemtet/opt/prediction/_helper.py +155 -0
  76. pyfemtet/opt/prediction/_model.py +118 -0
  77. pyfemtet/opt/problem/problem.py +304 -0
  78. pyfemtet/opt/problem/variable_manager/__init__.py +20 -0
  79. pyfemtet/opt/problem/variable_manager/_string_as_expression.py +115 -0
  80. pyfemtet/opt/problem/variable_manager/_variable_manager.py +295 -0
  81. pyfemtet/opt/visualization/history_viewer/__main__.py +5 -0
  82. pyfemtet/opt/visualization/{_base.py → history_viewer/_base_application.py} +18 -13
  83. pyfemtet/opt/visualization/history_viewer/_common_pages.py +150 -0
  84. pyfemtet/opt/visualization/{_complex_components → history_viewer/_complex_components}/alert_region.py +10 -5
  85. pyfemtet/opt/visualization/{_complex_components → history_viewer/_complex_components}/control_femtet.py +16 -13
  86. pyfemtet/opt/visualization/{_complex_components → history_viewer/_complex_components}/main_graph.py +117 -47
  87. pyfemtet/opt/visualization/{_complex_components → history_viewer/_complex_components}/pm_graph.py +159 -138
  88. pyfemtet/opt/visualization/history_viewer/_process_monitor/_application.py +173 -0
  89. pyfemtet/opt/visualization/history_viewer/_process_monitor/_pages.py +291 -0
  90. pyfemtet/opt/visualization/{_wrapped_components → history_viewer/_wrapped_components}/dbc.py +1 -1
  91. pyfemtet/opt/visualization/{_wrapped_components → history_viewer/_wrapped_components}/dcc.py +1 -1
  92. pyfemtet/opt/visualization/{_wrapped_components → history_viewer/_wrapped_components}/html.py +1 -1
  93. pyfemtet/opt/visualization/history_viewer/result_viewer/__main__.py +5 -0
  94. pyfemtet/opt/visualization/{result_viewer/application.py → history_viewer/result_viewer/_application.py} +6 -6
  95. pyfemtet/opt/visualization/{result_viewer/pages.py → history_viewer/result_viewer/_pages.py} +106 -82
  96. pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08.csv +18 -0
  97. pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08.db +0 -0
  98. pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8.jpg +0 -0
  99. pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8.log +45 -0
  100. pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8.pdt +0 -0
  101. pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_1.jpg +0 -0
  102. pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_1.pdt +0 -0
  103. pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_10.jpg +0 -0
  104. pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_10.pdt +0 -0
  105. pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_11.jpg +0 -0
  106. pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_11.pdt +0 -0
  107. pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_12.jpg +0 -0
  108. pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_12.pdt +0 -0
  109. pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_13.jpg +0 -0
  110. pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_13.pdt +0 -0
  111. pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_14.jpg +0 -0
  112. pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_14.pdt +0 -0
  113. pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_15.jpg +0 -0
  114. pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_15.pdt +0 -0
  115. pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_16.jpg +0 -0
  116. pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_16.pdt +0 -0
  117. pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_17.jpg +0 -0
  118. pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_17.pdt +0 -0
  119. pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_18.jpg +0 -0
  120. pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_18.pdt +0 -0
  121. pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_19.jpg +0 -0
  122. pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_19.pdt +0 -0
  123. pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_2.jpg +0 -0
  124. pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_2.pdt +0 -0
  125. pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_20.jpg +0 -0
  126. pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_20.pdt +0 -0
  127. pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_3.jpg +0 -0
  128. pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_3.pdt +0 -0
  129. pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_4.bgr +0 -0
  130. pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_4.bnd +0 -0
  131. pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_4.btr +0 -0
  132. pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_4.jpg +0 -0
  133. pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_4.mtl +0 -0
  134. pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_4.pdt +0 -0
  135. pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_4.prm +0 -0
  136. pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_5.jpg +0 -0
  137. pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_5.pdt +0 -0
  138. pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_6.jpg +0 -0
  139. pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_6.pdt +0 -0
  140. pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_7.jpg +0 -0
  141. pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_7.pdt +0 -0
  142. pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_8.jpg +0 -0
  143. pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_8.pdt +0 -0
  144. pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_9.jpg +0 -0
  145. pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_9.pdt +0 -0
  146. pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.femprj +0 -0
  147. pyfemtet/opt/visualization/plotter/main_figure_creator.py +536 -0
  148. pyfemtet/opt/visualization/plotter/pm_graph_creator.py +359 -0
  149. pyfemtet/opt/worker_status.py +120 -0
  150. {pyfemtet-0.9.5.dist-info → pyfemtet-1.0.0b0.dist-info}/METADATA +23 -24
  151. pyfemtet-1.0.0b0.dist-info/RECORD +172 -0
  152. pyfemtet-1.0.0b0.dist-info/entry_points.txt +3 -0
  153. pyfemtet/_femtet_config_util/exit.py +0 -59
  154. pyfemtet/_message/1. make_pot.bat +0 -11
  155. pyfemtet/_message/2. make_mo.bat +0 -6
  156. pyfemtet/_message/__init__.py +0 -5
  157. pyfemtet/_message/babel.cfg +0 -2
  158. pyfemtet/_message/locales/ja/LC_MESSAGES/messages.mo +0 -0
  159. pyfemtet/_message/locales/ja/LC_MESSAGES/messages.po +0 -570
  160. pyfemtet/_message/locales/messages.pot +0 -551
  161. pyfemtet/_warning.py +0 -87
  162. pyfemtet/brep/_impl.py +0 -18
  163. pyfemtet/opt/_femopt.py +0 -1007
  164. pyfemtet/opt/_femopt_core.py +0 -1169
  165. pyfemtet/opt/_test_utils/control_femtet.py +0 -39
  166. pyfemtet/opt/_test_utils/hyper_sphere.py +0 -24
  167. pyfemtet/opt/_test_utils/record_history.py +0 -130
  168. pyfemtet/opt/advanced_samples/excel_ui/(ref) original_project.femprj +0 -0
  169. pyfemtet/opt/advanced_samples/excel_ui/femtet-macro.xlsm +0 -0
  170. pyfemtet/opt/advanced_samples/excel_ui/pyfemtet-core.py +0 -291
  171. pyfemtet/opt/advanced_samples/excel_ui/test-pyfemtet-core.cmd +0 -22
  172. pyfemtet/opt/advanced_samples/restart/gal_ex13_parametric.femprj +0 -0
  173. pyfemtet/opt/advanced_samples/restart/gal_ex13_parametric_restart.py +0 -99
  174. pyfemtet/opt/advanced_samples/restart/gal_ex13_parametric_restart_jp.py +0 -102
  175. pyfemtet/opt/advanced_samples/surrogate_model/gal_ex13_create_training_data.py +0 -60
  176. pyfemtet/opt/advanced_samples/surrogate_model/gal_ex13_create_training_data_jp.py +0 -57
  177. pyfemtet/opt/advanced_samples/surrogate_model/gal_ex13_optimize_with_surrogate.py +0 -100
  178. pyfemtet/opt/advanced_samples/surrogate_model/gal_ex13_optimize_with_surrogate_jp.py +0 -90
  179. pyfemtet/opt/advanced_samples/surrogate_model/gal_ex13_parametric.femprj +0 -0
  180. pyfemtet/opt/interface/_base.py +0 -101
  181. pyfemtet/opt/interface/_excel_interface.py +0 -984
  182. pyfemtet/opt/interface/_femtet_excel.py +0 -141
  183. pyfemtet/opt/interface/_femtet_with_nx/__init__.py +0 -3
  184. pyfemtet/opt/interface/_femtet_with_nx/_interface.py +0 -178
  185. pyfemtet/opt/interface/_femtet_with_sldworks.py +0 -298
  186. pyfemtet/opt/interface/_surrogate/__init__.py +0 -5
  187. pyfemtet/opt/interface/_surrogate/_base.py +0 -129
  188. pyfemtet/opt/interface/_surrogate/_chaospy.py +0 -71
  189. pyfemtet/opt/interface/_surrogate/_singletaskgp.py +0 -71
  190. pyfemtet/opt/interface/_surrogate_excel.py +0 -102
  191. pyfemtet/opt/optimizer/_base.py +0 -376
  192. pyfemtet/opt/optimizer/_optuna/_botorch_patch/enable_nonlinear_constraint.py +0 -220
  193. pyfemtet/opt/optimizer/_optuna/_optuna.py +0 -434
  194. pyfemtet/opt/optimizer/_optuna/_pof_botorch.py +0 -1914
  195. pyfemtet/opt/optimizer/_scipy.py +0 -159
  196. pyfemtet/opt/optimizer/_scipy_scalar.py +0 -127
  197. pyfemtet/opt/optimizer/parameter.py +0 -113
  198. pyfemtet/opt/prediction/_base.py +0 -61
  199. pyfemtet/opt/prediction/single_task_gp.py +0 -119
  200. pyfemtet/opt/samples/femprj_sample/ParametricIF.femprj +0 -0
  201. pyfemtet/opt/samples/femprj_sample/ParametricIF.py +0 -29
  202. pyfemtet/opt/samples/femprj_sample/ParametricIF_test_result.reccsv +0 -13
  203. pyfemtet/opt/samples/femprj_sample/cad_ex01_NX.femprj +0 -0
  204. pyfemtet/opt/samples/femprj_sample/cad_ex01_NX.prt +0 -0
  205. pyfemtet/opt/samples/femprj_sample/cad_ex01_NX.py +0 -135
  206. pyfemtet/opt/samples/femprj_sample/cad_ex01_NX_test_result.reccsv +0 -23
  207. pyfemtet/opt/samples/femprj_sample/cad_ex01_SW.SLDPRT +0 -0
  208. pyfemtet/opt/samples/femprj_sample/cad_ex01_SW.femprj +0 -0
  209. pyfemtet/opt/samples/femprj_sample/cad_ex01_SW.py +0 -131
  210. pyfemtet/opt/samples/femprj_sample/cad_ex01_SW_test_result.reccsv +0 -23
  211. pyfemtet/opt/samples/femprj_sample/constrained_pipe.femprj +0 -0
  212. pyfemtet/opt/samples/femprj_sample/constrained_pipe.py +0 -96
  213. pyfemtet/opt/samples/femprj_sample/constrained_pipe_test_result.reccsv +0 -13
  214. pyfemtet/opt/samples/femprj_sample/gal_ex58_parametric.femprj +0 -0
  215. pyfemtet/opt/samples/femprj_sample/gal_ex58_parametric.py +0 -74
  216. pyfemtet/opt/samples/femprj_sample/gal_ex58_parametric_test_result.reccsv +0 -13
  217. pyfemtet/opt/samples/femprj_sample/gau_ex08_parametric.femprj +0 -0
  218. pyfemtet/opt/samples/femprj_sample/gau_ex08_parametric.py +0 -58
  219. pyfemtet/opt/samples/femprj_sample/gau_ex08_parametric_test_result.reccsv +0 -23
  220. pyfemtet/opt/samples/femprj_sample/gau_ex12_parametric.femprj +0 -0
  221. pyfemtet/opt/samples/femprj_sample/gau_ex12_parametric.py +0 -52
  222. pyfemtet/opt/samples/femprj_sample/her_ex40_parametric.femprj +0 -0
  223. pyfemtet/opt/samples/femprj_sample/her_ex40_parametric.py +0 -138
  224. pyfemtet/opt/samples/femprj_sample/her_ex40_parametric_test_result.reccsv +0 -18
  225. pyfemtet/opt/samples/femprj_sample/paswat_ex1_parametric.femprj +0 -0
  226. pyfemtet/opt/samples/femprj_sample/paswat_ex1_parametric.py +0 -60
  227. pyfemtet/opt/samples/femprj_sample/paswat_ex1_parametric_parallel.py +0 -61
  228. pyfemtet/opt/samples/femprj_sample/paswat_ex1_parametric_test_result.reccsv +0 -18
  229. pyfemtet/opt/samples/femprj_sample/wat_ex14_parametric.femprj +0 -0
  230. pyfemtet/opt/samples/femprj_sample/wat_ex14_parametric.py +0 -58
  231. pyfemtet/opt/samples/femprj_sample/wat_ex14_parametric_parallel.py +0 -58
  232. pyfemtet/opt/samples/femprj_sample/wat_ex14_parametric_test_result.reccsv +0 -18
  233. pyfemtet/opt/samples/femprj_sample_jp/ParametricIF_jp.femprj +0 -0
  234. pyfemtet/opt/samples/femprj_sample_jp/ParametricIF_jp.py +0 -29
  235. pyfemtet/opt/samples/femprj_sample_jp/cad_ex01_NX_jp.femprj +0 -0
  236. pyfemtet/opt/samples/femprj_sample_jp/cad_ex01_NX_jp.py +0 -129
  237. pyfemtet/opt/samples/femprj_sample_jp/cad_ex01_SW_jp.femprj +0 -0
  238. pyfemtet/opt/samples/femprj_sample_jp/cad_ex01_SW_jp.py +0 -125
  239. pyfemtet/opt/samples/femprj_sample_jp/constrained_pipe_jp.py +0 -93
  240. pyfemtet/opt/samples/femprj_sample_jp/gal_ex58_parametric_jp.femprj +0 -0
  241. pyfemtet/opt/samples/femprj_sample_jp/gal_ex58_parametric_jp.py +0 -70
  242. pyfemtet/opt/samples/femprj_sample_jp/gau_ex08_parametric_jp.femprj +0 -0
  243. pyfemtet/opt/samples/femprj_sample_jp/gau_ex08_parametric_jp.py +0 -57
  244. pyfemtet/opt/samples/femprj_sample_jp/gau_ex12_parametric_jp.py +0 -52
  245. pyfemtet/opt/samples/femprj_sample_jp/her_ex40_parametric_jp.femprj +0 -0
  246. pyfemtet/opt/samples/femprj_sample_jp/her_ex40_parametric_jp.py +0 -138
  247. pyfemtet/opt/samples/femprj_sample_jp/paswat_ex1_parametric_jp.femprj +0 -0
  248. pyfemtet/opt/samples/femprj_sample_jp/paswat_ex1_parametric_jp.py +0 -58
  249. pyfemtet/opt/samples/femprj_sample_jp/paswat_ex1_parametric_parallel_jp.py +0 -59
  250. pyfemtet/opt/samples/femprj_sample_jp/wat_ex14_parametric_jp.py +0 -56
  251. pyfemtet/opt/samples/femprj_sample_jp/wat_ex14_parametric_parallel_jp.py +0 -56
  252. pyfemtet/opt/visualization/_complex_components/main_figure_creator.py +0 -332
  253. pyfemtet/opt/visualization/_complex_components/pm_graph_creator.py +0 -201
  254. pyfemtet/opt/visualization/_process_monitor/application.py +0 -226
  255. pyfemtet/opt/visualization/_process_monitor/pages.py +0 -406
  256. pyfemtet/opt/visualization/_wrapped_components/__init__.py +0 -0
  257. pyfemtet/opt/visualization/result_viewer/__init__.py +0 -0
  258. pyfemtet-0.9.5.dist-info/RECORD +0 -158
  259. pyfemtet-0.9.5.dist-info/entry_points.txt +0 -3
  260. /pyfemtet/{_femtet_config_util → opt/problem}/__init__.py +0 -0
  261. /pyfemtet/{brep → opt/visualization/history_viewer}/__init__.py +0 -0
  262. /pyfemtet/opt/{_test_utils → visualization/history_viewer/_complex_components}/__init__.py +0 -0
  263. /pyfemtet/opt/{optimizer/_optuna → visualization/history_viewer/_process_monitor}/__init__.py +0 -0
  264. /pyfemtet/opt/{optimizer/_optuna/_botorch_patch → visualization/history_viewer/_wrapped_components}/__init__.py +0 -0
  265. /pyfemtet/opt/visualization/{_wrapped_components → history_viewer/_wrapped_components}/str_enum.py +0 -0
  266. /pyfemtet/opt/visualization/{result_viewer → history_viewer/result_viewer}/.gitignore +0 -0
  267. /pyfemtet/opt/visualization/{_complex_components → history_viewer/result_viewer}/__init__.py +0 -0
  268. /pyfemtet/opt/visualization/{_process_monitor → plotter}/__init__.py +0 -0
  269. /pyfemtet/opt/{samples/femprj_sample_jp/wat_ex14_parametric_jp.femprj → wat_ex14_parametric_jp.femprj} +0 -0
  270. {pyfemtet-0.9.5.dist-info → pyfemtet-1.0.0b0.dist-info}/LICENSE +0 -0
  271. {pyfemtet-0.9.5.dist-info → pyfemtet-1.0.0b0.dist-info}/LICENSE_THIRD_PARTY.txt +0 -0
  272. {pyfemtet-0.9.5.dist-info → pyfemtet-1.0.0b0.dist-info}/WHEEL +0 -0
@@ -1,58 +0,0 @@
1
- """多目的の最適化: プリント基板上ICの空冷(強制対流)
2
-
3
- Femtet の簡易熱流体解析ソルバを利用して、強制対流を受ける
4
- プリント基板上のICチップについて、チップ温度を低減しつつ
5
- 基板サイズを小さくする設計を行います。
6
-
7
- 対応プロジェクト:paswat_ex1_parametric_jp.femprj
8
- """
9
- from pyfemtet.opt import FEMOpt
10
-
11
-
12
- def chip_temp(Femtet, chip_name):
13
- """チップの最高温度を取得します。
14
-
15
- Note:
16
- 目的関数または制約関数は、
17
- 第一引数としてFemtetを受け取り、
18
- 戻り値としてfloat型を返す必要があります。
19
-
20
- Params:
21
- Femtet: Femtet をマクロで操作するためのインスタンスです。詳細な情報については、「Femtet マクロヘルプ」をご覧ください。
22
- chip_name (str): femprj 内で定義されているボディ属性名です。有効な値は 'MAINCHIP' 又は 'SUBCHIP' です。
23
-
24
- Returns:
25
- float: 指定されたボディ属性名のボディの最高温度です。
26
- """
27
- Gogh = Femtet.Gogh
28
-
29
- max_temperature, min_temperature, mean_temperature = Gogh.Watt.GetTemp(chip_name)
30
-
31
- return max_temperature # 単位: 度
32
-
33
-
34
- def substrate_size(Femtet):
35
- """基板のXY平面上での専有面積を計算します。"""
36
- substrate_w = Femtet.GetVariableValue('substrate_w')
37
- substrate_d = Femtet.GetVariableValue('substrate_d')
38
- return substrate_w * substrate_d # 単位: mm2
39
-
40
-
41
- if __name__ == '__main__':
42
-
43
- # FEMOpt オブジェクトの初期化 (最適化問題とFemtetとの接続を行います)
44
- femopt = FEMOpt()
45
-
46
- # 設計変数を最適化問題に追加 (femprj ファイルに登録されている変数を指定してください)
47
- femopt.add_parameter("substrate_w", 40, lower_bound=22, upper_bound=60)
48
- femopt.add_parameter("substrate_d", 60, lower_bound=34, upper_bound=60)
49
- femopt.add_parameter("rot", 0, lower_bound=0, upper_bound=180)
50
-
51
- # 目的関数を最適化問題に追加
52
- femopt.add_objective(chip_temp, name='MAINCHIP<br>最高温度(度)', direction='minimize', args=('MAINCHIP',))
53
- femopt.add_objective(chip_temp, name='SUBCHIP<br>最高温度(度)', direction='minimize', args=('SUBCHIP',))
54
- femopt.add_objective(substrate_size, name='基板サイズ(mm2)', direction='minimize')
55
-
56
- # 最適化を実行
57
- femopt.set_random_seed(42)
58
- femopt.optimize(n_trials=15)
@@ -1,59 +0,0 @@
1
- """多目的の最適化: プリント基板上ICの空冷(強制対流)
2
-
3
- Femtet の簡易熱流体解析ソルバを利用して、強制対流を受ける
4
- プリント基板上のICチップについて、チップ温度を低減しつつ
5
- 基板サイズを小さくする設計を行います。
6
-
7
- 対応プロジェクト:paswat_ex1_parametric_jp.femprj
8
- """
9
- from pyfemtet.opt import FEMOpt
10
-
11
-
12
- def chip_temp(Femtet, chip_name):
13
- """チップの最高温度を取得します。
14
-
15
- Note:
16
- 目的関数または制約関数は、
17
- 第一引数としてFemtetを受け取り、
18
- 戻り値としてfloat型を返す必要があります。
19
-
20
- Params:
21
- Femtet: Femtet をマクロで操作するためのインスタンスです。詳細な情報については、「Femtet マクロヘルプ」をご覧ください。
22
- chip_name (str): femprj 内で定義されているボディ属性名です。有効な値は 'MAINCHIP' 又は 'SUBCHIP' です。
23
-
24
- Returns:
25
- float: 指定されたボディ属性名のボディの最高温度です。
26
- """
27
- Gogh = Femtet.Gogh
28
-
29
- max_temperature, min_temperature, mean_temperature = Gogh.Watt.GetTemp(chip_name)
30
-
31
- return max_temperature # 単位: 度
32
-
33
-
34
- def substrate_size(Femtet):
35
- """基板のXY平面上での専有面積を計算します。"""
36
- substrate_w = Femtet.GetVariableValue('substrate_w')
37
- substrate_d = Femtet.GetVariableValue('substrate_d')
38
- return substrate_w * substrate_d # 単位: mm2
39
-
40
-
41
- if __name__ == '__main__':
42
-
43
- # FEMOpt オブジェクトの初期化 (最適化問題とFemtetとの接続を行います)
44
- femopt = FEMOpt()
45
-
46
- # 設計変数を最適化問題に追加 (femprj ファイルに登録されている変数を指定してください)
47
- femopt.add_parameter("substrate_w", 40, lower_bound=22, upper_bound=60)
48
- femopt.add_parameter("substrate_d", 60, lower_bound=34, upper_bound=60)
49
- femopt.add_parameter("rot", 0, lower_bound=0, upper_bound=180)
50
-
51
- # 目的関数を最適化問題に追加
52
- femopt.add_objective(chip_temp, name='MAINCHIP<br>最高温度(度)', direction='minimize', args=('MAINCHIP',))
53
- femopt.add_objective(chip_temp, name='SUBCHIP<br>最高温度(度)', direction='minimize', args=('SUBCHIP',))
54
- femopt.add_objective(substrate_size, name='基板サイズ(mm2)', direction='minimize')
55
-
56
- # 最適化を実行
57
- femopt.set_random_seed(42)
58
- # femopt.optimize(n_trials=15)
59
- femopt.optimize(n_trials=30, n_parallel=3) # 並列計算しない場合との差はこの行のみです。
@@ -1,56 +0,0 @@
1
- """多目的最適化: プリント基板上ICの発熱
2
-
3
- Femtetの熱伝導解析ソルバを使用して、ICチップの発熱を抑えつつ
4
- 基板サイズを小さくする設計を行います。
5
-
6
- 対応プロジェクト: wat_ex14_parametric_jp.femprj
7
- """
8
- from pyfemtet.opt import FEMOpt
9
-
10
-
11
- def chip_temp(Femtet, chip_name):
12
- """チップの最高温度を取得します。
13
-
14
- Note:
15
- 目的関数または制約関数は、
16
- 第一引数としてFemtetを受け取り、
17
- 戻り値としてfloat型を返す必要があります。
18
-
19
- Params:
20
- Femtet: Femtet をマクロで操作するためのインスタンスです。詳細な情報については、「Femtet マクロヘルプ」をご覧ください。
21
- chip_name (str): femprj 内で定義されているボディ属性名です。有効な値は 'MAINCHIP' 又は 'SUBCHIP' です。
22
-
23
- Returns:
24
- float: 指定されたボディ属性名のボディの最高温度です。
25
- """
26
- Gogh = Femtet.Gogh
27
-
28
- max_temperature, min_temperature, mean_temperature = Gogh.Watt.GetTemp(chip_name)
29
-
30
- return max_temperature # 単位: 度
31
-
32
-
33
- def substrate_size(Femtet):
34
- """基板のXY平面上での専有面積を計算します。"""
35
- substrate_w = Femtet.GetVariableValue('substrate_w')
36
- substrate_d = Femtet.GetVariableValue('substrate_d')
37
- return substrate_w * substrate_d # 単位: mm2
38
-
39
-
40
- if __name__ == '__main__':
41
-
42
- # FEMOpt オブジェクトの初期化 (最適化問題とFemtetとの接続を行います)
43
- femopt = FEMOpt()
44
-
45
- # 設計変数を最適化問題に追加 (femprj ファイルに登録されている変数を指定してください)
46
- femopt.add_parameter("substrate_w", 40, lower_bound=22, upper_bound=60)
47
- femopt.add_parameter("substrate_d", 60, lower_bound=34, upper_bound=60)
48
-
49
- # 目的関数を最適化問題に追加
50
- femopt.add_objective(chip_temp, name='MAINCHIP<br>最高温度(度)', direction='minimize', args=('MAINCHIP',))
51
- femopt.add_objective(chip_temp, name='SUBCHIP<br>最高温度(度)', direction='minimize', args=('SUBCHIP',))
52
- femopt.add_objective(substrate_size, name='基板サイズ(mm2)')
53
-
54
- # 最適化を実行
55
- femopt.set_random_seed(42)
56
- femopt.optimize(n_trials=15)
@@ -1,56 +0,0 @@
1
- """多目的最適化: プリント基板上ICの発熱
2
-
3
- Femtetの熱伝導解析ソルバを使用して、ICチップの発熱を抑えつつ
4
- 基板サイズを小さくする設計を行います。
5
-
6
- 対応プロジェクト: wat_ex14_parametric_jp.femprj
7
- """
8
- from pyfemtet.opt import FEMOpt
9
-
10
-
11
- def chip_temp(Femtet, chip_name):
12
- """チップの最高温度を取得します。
13
-
14
- Note:
15
- 目的関数または制約関数は、
16
- 第一引数としてFemtetを受け取り、
17
- 戻り値としてfloat型を返す必要があります。
18
-
19
- Params:
20
- Femtet: Femtet をマクロで操作するためのインスタンスです。詳細な情報については、「Femtet マクロヘルプ」をご覧ください。
21
- chip_name (str): femprj 内で定義されているボディ属性名です。有効な値は 'MAINCHIP' 又は 'SUBCHIP' です。
22
-
23
- Returns:
24
- float: 指定されたボディ属性名のボディの最高温度です。
25
- """
26
- Gogh = Femtet.Gogh
27
-
28
- max_temperature, min_temperature, mean_temperature = Gogh.Watt.GetTemp(chip_name)
29
-
30
- return max_temperature # 単位: 度
31
-
32
-
33
- def substrate_size(Femtet):
34
- """基板のXY平面上での専有面積を計算します。"""
35
- substrate_w = Femtet.GetVariableValue('substrate_w')
36
- substrate_d = Femtet.GetVariableValue('substrate_d')
37
- return substrate_w * substrate_d # 単位: mm2
38
-
39
-
40
- if __name__ == '__main__':
41
-
42
- # FEMOpt オブジェクトの初期化 (最適化問題とFemtetとの接続を行います)
43
- femopt = FEMOpt()
44
-
45
- # 設計変数を最適化問題に追加 (femprj ファイルに登録されている変数を指定してください)
46
- femopt.add_parameter("substrate_w", 40, lower_bound=22, upper_bound=60)
47
- femopt.add_parameter("substrate_d", 60, lower_bound=34, upper_bound=60)
48
-
49
- # 目的関数を最適化問題に追加
50
- femopt.add_objective(chip_temp, name='MAINCHIP<br>最高温度(度)', direction='minimize', args=('MAINCHIP',))
51
- femopt.add_objective(chip_temp, name='SUBCHIP<br>最高温度(度)', direction='minimize', args=('SUBCHIP',))
52
- femopt.add_objective(substrate_size, name='基板サイズ(mm2)')
53
-
54
- # 最適化を実行
55
- femopt.set_random_seed(42)
56
- femopt.optimize(n_trials=15, n_parallel=3) # この部分のみ変更します
@@ -1,332 +0,0 @@
1
- import pandas as pd
2
- import plotly.graph_objs as go
3
- import plotly.express as px
4
-
5
- from pyfemtet.opt._femopt_core import History
6
- from pyfemtet._message import Msg
7
-
8
-
9
- class _ColorSet:
10
- non_domi = {True: '#007bff', False: '#6c757d'} # color
11
-
12
-
13
- class _SymbolSet:
14
- feasible = {True: 'circle', False: 'circle-open'} # style
15
-
16
-
17
- class _LanguageSet:
18
-
19
- feasible = {'label': 'feasible', True: True, False: False}
20
- non_domi = {'label': 'non_domi', True: True, False: False}
21
-
22
- def __init__(self):
23
- self.feasible = {
24
- 'label': Msg.LEGEND_LABEL_CONSTRAINT,
25
- True: Msg.LEGEND_LABEL_FEASIBLE,
26
- False: Msg.LEGEND_LABEL_INFEASIBLE,
27
- }
28
- self.non_domi = {
29
- 'label': Msg.LEGEND_LABEL_OPTIMAL,
30
- True: Msg.LEGEND_LABEL_NON_DOMI,
31
- False: Msg.LEGEND_LABEL_DOMI,
32
- }
33
-
34
- def localize(self, df):
35
- # 元のオブジェクトを変更しないようにコピー
36
- cdf = df.copy()
37
-
38
- # feasible, non_domi の localize
39
- cdf[self.feasible['label']] = [self.feasible[v] for v in cdf['feasible']]
40
- cdf[self.non_domi['label']] = [self.non_domi[v] for v in cdf['non_domi']]
41
-
42
- return cdf
43
-
44
-
45
- _ls = _LanguageSet()
46
- _cs = _ColorSet()
47
- _ss = _SymbolSet()
48
-
49
-
50
- def get_hypervolume_plot(_: History, df):
51
- df = _ls.localize(df)
52
-
53
- # create figure
54
- fig = px.line(
55
- df,
56
- x="trial",
57
- y="hypervolume",
58
- markers=True,
59
- custom_data=['trial'],
60
- )
61
-
62
- fig.update_layout(
63
- dict(
64
- title_text=Msg.GRAPH_TITLE_HYPERVOLUME,
65
- # transition_duration=1000, # Causes graph freeze on tab change
66
- xaxis_title=Msg.GRAPH_AXIS_LABEL_TRIAL,
67
- yaxis_title='hypervolume',
68
- )
69
- )
70
-
71
- return fig
72
-
73
-
74
- def get_default_figure(history, df):
75
- # df = history.local_data # monitor process and history process is different workers, so history.local_data is not updated in monitor process.
76
- # df = history.actor_data.copy() # access to actor from flask callback makes termination unstable.
77
-
78
- # data setting
79
- obj_names = history.obj_names
80
-
81
- fig = go.Figure()
82
-
83
- if len(obj_names) == 1:
84
- fig = _get_single_objective_plot(history, df)
85
-
86
- elif len(obj_names) >= 2:
87
- fig = _get_multi_objective_pairplot(history, df)
88
-
89
- fig.update_traces(hoverinfo="none", hovertemplate=None)
90
- fig.update_layout(
91
- clickmode='event+select',
92
- transition_duration=1000,
93
- )
94
-
95
- return fig
96
-
97
-
98
- def _get_single_objective_plot(history, df):
99
-
100
- df = _ls.localize(df)
101
- obj_name = history.obj_names[0]
102
-
103
- df.columns = [c.replace(' / ', '<BR>/ ') for c in df.columns]
104
- obj_name = obj_name.replace(' / ', '<BR>/ ')
105
-
106
- # ===== base figure =====
107
- fig = go.Figure()
108
-
109
- # ===== i 番目が、その時点までで最適かどうか =====
110
- # その時点までの最適な点 index
111
- indices = []
112
- anti_indices = []
113
- objectives = df[obj_name].values
114
- objective_directions = df[f'{obj_name}_direction'].values
115
- for i, (obj, direction) in enumerate(zip(objectives, objective_directions)):
116
- # DESCRIPTION: 最適化中に direction は変化しない前提
117
- if direction == 'maximize':
118
- if obj == max(objectives[:i+1]):
119
- indices.append(i)
120
- else:
121
- anti_indices.append(i)
122
- elif direction == 'minimize':
123
- if obj == min(objectives[:i+1]):
124
- indices.append(i)
125
- else:
126
- anti_indices.append(i)
127
- else:
128
- residuals = (objectives - objective_directions) ** 2
129
- residual = residuals[i]
130
- if residual == min(residuals[:i+1]):
131
- indices.append(i)
132
- else:
133
- anti_indices.append(i)
134
-
135
- # ===== 最適でない点を灰色で打つ =====
136
- fig.add_trace(
137
- go.Scatter(
138
- x=df['trial'],
139
- y=df[obj_name],
140
- customdata=df['trial'].values.reshape((-1, 1)),
141
- # x=df['trial'][anti_indices],
142
- # y=df[obj_name][anti_indices],
143
- # customdata=df['trial'][anti_indices].values.reshape((-1, 1)),
144
- mode="markers",
145
- marker=dict(color='#6c757d', size=6),
146
- name=Msg.LEGEND_LABEL_ALL_SOLUTIONS,
147
- )
148
- )
149
-
150
- # ===== その時点までの最小の点を青で打つ =====
151
- fig.add_trace(
152
- go.Scatter(
153
- x=df['trial'].iloc[indices],
154
- y=df[obj_name].iloc[indices],
155
- mode="markers+lines",
156
- marker=dict(color='#007bff', size=9),
157
- name=Msg.LEGEND_LABEL_OPTIMAL_SOLUTIONS,
158
- line=dict(width=1, color='#6c757d',),
159
- customdata=df['trial'].iloc[indices].values.reshape((-1, 1)),
160
- legendgroup='optimal',
161
- )
162
- )
163
-
164
- # ===== その時点までの最小の点から現在までの平行点線を引く =====
165
- if len(indices) > 1:
166
- x = [df['trial'].iloc[indices].iloc[-1], df['trial'].iloc[-1]]
167
- y = [df[obj_name].iloc[indices].iloc[-1]] * 2
168
- fig.add_trace(
169
- go.Scatter(
170
- x=x,
171
- y=y,
172
- mode="lines",
173
- line=dict(width=0.5, color='#6c757d', dash='dash'),
174
- showlegend=False,
175
- legendgroup='optimal',
176
- )
177
- )
178
-
179
- # ===== direction が float の場合、目標値を描く =====
180
- if len(df) > 1:
181
- if isinstance(objective_directions[0], float):
182
- x = [df['trial'].iloc[0], df['trial'].iloc[-1]]
183
- y = [objective_directions[0]] * 2
184
- fig.add_trace(
185
- go.Scatter(
186
- x=x,
187
- y=y,
188
- mode="lines",
189
- line=dict(width=0.5, color='#FF2400', dash='dash'),
190
- name=Msg.LEGEND_LABEL_OBJECTIVE_TARGET,
191
- )
192
- )
193
-
194
-
195
- # ===== layout =====
196
- fig.update_layout(
197
- dict(
198
- title_text=Msg.GRAPH_TITLE_SINGLE_OBJECTIVE,
199
- xaxis_title=Msg.GRAPH_AXIS_LABEL_TRIAL,
200
- yaxis_title=obj_name,
201
- )
202
- )
203
-
204
- return fig
205
-
206
-
207
- def _get_multi_objective_pairplot(history, df):
208
- df = _ls.localize(df)
209
-
210
- obj_names = history.obj_names
211
-
212
- df.columns = [c.replace(' / ', '<BR>/ ') for c in df.columns]
213
- obj_names = [o.replace(' / ', '<BR>/ ') for o in obj_names]
214
-
215
- common_kwargs = dict(
216
- color=_ls.non_domi['label'],
217
- color_discrete_map={
218
- _ls.non_domi[True]: _cs.non_domi[True],
219
- _ls.non_domi[False]: _cs.non_domi[False],
220
- },
221
- symbol=_ls.feasible['label'],
222
- symbol_map={
223
- _ls.feasible[True]: _ss.feasible[True],
224
- _ls.feasible[False]: _ss.feasible[False],
225
- },
226
- custom_data=['trial'],
227
- category_orders={
228
- _ls.feasible['label']: (_ls.feasible[False], _ls.feasible[True]),
229
- _ls.non_domi['label']: (_ls.non_domi[False], _ls.non_domi[True]),
230
- },
231
- )
232
-
233
- if len(obj_names) == 2:
234
- fig = px.scatter(
235
- data_frame=df,
236
- x=obj_names[0],
237
- y=obj_names[1],
238
- **common_kwargs,
239
- )
240
- fig.update_layout(
241
- dict(
242
- xaxis_title=obj_names[0],
243
- yaxis_title=obj_names[1],
244
- )
245
- )
246
-
247
- else:
248
- fig = px.scatter_matrix(
249
- data_frame=df,
250
- dimensions=obj_names,
251
- **common_kwargs,
252
- )
253
- fig.update_traces(
254
- patch={'diagonal.visible': False},
255
- showupperhalf=False,
256
- )
257
-
258
- fig.update_layout(
259
- dict(
260
- title_text=Msg.GRAPH_TITLE_MULTI_OBJECTIVE,
261
- )
262
- )
263
-
264
- return fig
265
-
266
-
267
- def get_objective_plot(history: History, df: pd.DataFrame, obj_names: list[str]) -> go.Figure:
268
- df = _ls.localize(df)
269
- df.columns = [c.replace(' / ', '<BR>/ ') for c in df.columns]
270
- obj_names = [o.replace(' / ', '<BR>/ ') for o in obj_names]
271
-
272
- common_kwargs = dict(
273
- color=_ls.non_domi['label'],
274
- color_discrete_map={
275
- _ls.non_domi[True]: _cs.non_domi[True],
276
- _ls.non_domi[False]: _cs.non_domi[False],
277
- },
278
- symbol=_ls.feasible['label'],
279
- symbol_map={
280
- _ls.feasible[True]: _ss.feasible[True],
281
- _ls.feasible[False]: _ss.feasible[False],
282
- },
283
- custom_data=['trial'],
284
- category_orders={
285
- _ls.feasible['label']: (_ls.feasible[False], _ls.feasible[True]),
286
- _ls.non_domi['label']: (_ls.non_domi[False], _ls.non_domi[True]),
287
- },
288
- )
289
-
290
- if len(obj_names) == 2:
291
- fig = px.scatter(
292
- data_frame=df,
293
- x=obj_names[0],
294
- y=obj_names[1],
295
- **common_kwargs,
296
- )
297
- fig.update_layout(
298
- dict(
299
- xaxis_title=obj_names[0],
300
- yaxis_title=obj_names[1],
301
- )
302
- )
303
-
304
- elif len(obj_names) == 3:
305
- fig = px.scatter_3d(
306
- df,
307
- x=obj_names[0],
308
- y=obj_names[1],
309
- z=obj_names[2],
310
- **common_kwargs,
311
- )
312
- fig.update_layout(
313
- margin=dict(l=0, r=0, b=0, t=30),
314
- )
315
- fig.update_traces(
316
- marker=dict(
317
- size=3,
318
- ),
319
- )
320
-
321
- else:
322
- raise Exception
323
-
324
- fig.update_layout(
325
- dict(
326
- title_text="Objective plot",
327
- )
328
- )
329
-
330
- fig.update_traces(hoverinfo="none", hovertemplate=None)
331
-
332
- return fig