pyfemtet 1.0.0a0__tar.gz → 1.0.0b0__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 (174) hide show
  1. {pyfemtet-1.0.0a0 → pyfemtet-1.0.0b0}/PKG-INFO +3 -2
  2. pyfemtet-1.0.0b0/pyfemtet/_i18n/locales/ja/LC_MESSAGES/messages.mo +0 -0
  3. {pyfemtet-1.0.0a0 → pyfemtet-1.0.0b0}/pyfemtet/_i18n/locales/ja/LC_MESSAGES/messages.po +1 -1
  4. {pyfemtet-1.0.0a0 → pyfemtet-1.0.0b0}/pyfemtet/_util/dask_util.py +1 -1
  5. {pyfemtet-1.0.0a0 → pyfemtet-1.0.0b0}/pyfemtet/opt/__init__.py +3 -1
  6. {pyfemtet-1.0.0a0 → pyfemtet-1.0.0b0}/pyfemtet/opt/femopt.py +9 -3
  7. {pyfemtet-1.0.0a0 → pyfemtet-1.0.0b0}/pyfemtet/opt/history/_history.py +1 -1
  8. {pyfemtet-1.0.0a0 → pyfemtet-1.0.0b0}/pyfemtet/opt/interface/_femtet_interface/femtet_interface.py +21 -7
  9. {pyfemtet-1.0.0a0 → pyfemtet-1.0.0b0}/pyfemtet/opt/interface/_femtet_with_nx_interface/femtet_with_nx_interface.py +1 -1
  10. {pyfemtet-1.0.0a0 → pyfemtet-1.0.0b0}/pyfemtet/opt/interface/_femtet_with_solidworks/femtet_with_solidworks_interface.py +1 -1
  11. pyfemtet-1.0.0b0/pyfemtet/opt/interface/_surrogate_model_interface/base_surrogate_interface.py +150 -0
  12. {pyfemtet-1.0.0a0 → pyfemtet-1.0.0b0}/pyfemtet/opt/interface/_surrogate_model_interface/botorch_interface.py +30 -3
  13. {pyfemtet-1.0.0a0 → pyfemtet-1.0.0b0}/pyfemtet/opt/optimizer/_base_optimizer.py +10 -1
  14. {pyfemtet-1.0.0a0 → pyfemtet-1.0.0b0}/pyfemtet/opt/optimizer/optuna_optimizer/_pof_botorch/pof_botorch_sampler.py +1 -1
  15. {pyfemtet-1.0.0a0 → pyfemtet-1.0.0b0}/pyproject.toml +3 -2
  16. pyfemtet-1.0.0a0/pyfemtet/_i18n/locales/ja/LC_MESSAGES/messages.mo +0 -0
  17. pyfemtet-1.0.0a0/pyfemtet/opt/interface/_surrogate/_base.py +0 -0
  18. pyfemtet-1.0.0a0/pyfemtet/opt/interface/_surrogate_model_interface/base_surrogate_interface.py +0 -59
  19. {pyfemtet-1.0.0a0 → pyfemtet-1.0.0b0}/LICENSE +0 -0
  20. {pyfemtet-1.0.0a0 → pyfemtet-1.0.0b0}/LICENSE_THIRD_PARTY.txt +0 -0
  21. {pyfemtet-1.0.0a0 → pyfemtet-1.0.0b0}/README.md +0 -0
  22. {pyfemtet-1.0.0a0 → pyfemtet-1.0.0b0}/pyfemtet/__init__.py +0 -0
  23. {pyfemtet-1.0.0a0 → pyfemtet-1.0.0b0}/pyfemtet/_i18n/1. make_pot_and_update_po.bat +0 -0
  24. {pyfemtet-1.0.0a0 → pyfemtet-1.0.0b0}/pyfemtet/_i18n/2. build_mo.bat +0 -0
  25. {pyfemtet-1.0.0a0 → pyfemtet-1.0.0b0}/pyfemtet/_i18n/__init__.py +0 -0
  26. {pyfemtet-1.0.0a0 → pyfemtet-1.0.0b0}/pyfemtet/_i18n/babel.cfg +0 -0
  27. {pyfemtet-1.0.0a0 → pyfemtet-1.0.0b0}/pyfemtet/_i18n/i18n.py +0 -0
  28. {pyfemtet-1.0.0a0 → pyfemtet-1.0.0b0}/pyfemtet/_i18n/locales/messages.pot +0 -0
  29. {pyfemtet-1.0.0a0 → pyfemtet-1.0.0b0}/pyfemtet/_i18n/messages.py +0 -0
  30. {pyfemtet-1.0.0a0 → pyfemtet-1.0.0b0}/pyfemtet/_util/__init__.py +0 -0
  31. {pyfemtet-1.0.0a0 → pyfemtet-1.0.0b0}/pyfemtet/_util/closing.py +0 -0
  32. {pyfemtet-1.0.0a0 → pyfemtet-1.0.0b0}/pyfemtet/_util/df_util.py +0 -0
  33. {pyfemtet-1.0.0a0 → pyfemtet-1.0.0b0}/pyfemtet/_util/excel_macro_util.py +0 -0
  34. {pyfemtet-1.0.0a0 → pyfemtet-1.0.0b0}/pyfemtet/_util/excel_parse_util.py +0 -0
  35. {pyfemtet-1.0.0a0 → pyfemtet-1.0.0b0}/pyfemtet/_util/femtet_access_inspection.py +0 -0
  36. {pyfemtet-1.0.0a0 → pyfemtet-1.0.0b0}/pyfemtet/_util/femtet_autosave.py +0 -0
  37. {pyfemtet-1.0.0a0 → pyfemtet-1.0.0b0}/pyfemtet/_util/femtet_exit.py +0 -0
  38. {pyfemtet-1.0.0a0 → pyfemtet-1.0.0b0}/pyfemtet/_util/femtet_version.py +0 -0
  39. {pyfemtet-1.0.0a0 → pyfemtet-1.0.0b0}/pyfemtet/_util/helper.py +0 -0
  40. {pyfemtet-1.0.0a0 → pyfemtet-1.0.0b0}/pyfemtet/_util/process_util.py +0 -0
  41. {pyfemtet-1.0.0a0 → pyfemtet-1.0.0b0}/pyfemtet/_util/sample.xlsx +0 -0
  42. {pyfemtet-1.0.0a0 → pyfemtet-1.0.0b0}/pyfemtet/_util/str_enum.py +0 -0
  43. {pyfemtet-1.0.0a0 → pyfemtet-1.0.0b0}/pyfemtet/core.py +0 -0
  44. {pyfemtet-1.0.0a0 → pyfemtet-1.0.0b0}/pyfemtet/dispatch_extensions/__init__.py +0 -0
  45. {pyfemtet-1.0.0a0 → pyfemtet-1.0.0b0}/pyfemtet/dispatch_extensions/_impl.py +0 -0
  46. {pyfemtet-1.0.0a0 → pyfemtet-1.0.0b0}/pyfemtet/logger/__init__.py +0 -0
  47. {pyfemtet-1.0.0a0 → pyfemtet-1.0.0b0}/pyfemtet/logger/_impl.py +0 -0
  48. {pyfemtet-1.0.0a0 → pyfemtet-1.0.0b0}/pyfemtet/opt/exceptions.py +0 -0
  49. {pyfemtet-1.0.0a0 → pyfemtet-1.0.0b0}/pyfemtet/opt/history/__init__.py +0 -0
  50. {pyfemtet-1.0.0a0 → pyfemtet-1.0.0b0}/pyfemtet/opt/history/_hypervolume.py +0 -0
  51. {pyfemtet-1.0.0a0 → pyfemtet-1.0.0b0}/pyfemtet/opt/history/_optimality.py +0 -0
  52. {pyfemtet-1.0.0a0 → pyfemtet-1.0.0b0}/pyfemtet/opt/interface/__init__.py +0 -0
  53. {pyfemtet-1.0.0a0 → pyfemtet-1.0.0b0}/pyfemtet/opt/interface/_base_interface.py +0 -0
  54. {pyfemtet-1.0.0a0 → pyfemtet-1.0.0b0}/pyfemtet/opt/interface/_excel_interface/__init__.py +0 -0
  55. {pyfemtet-1.0.0a0 → pyfemtet-1.0.0b0}/pyfemtet/opt/interface/_excel_interface/debug-excel-interface.xlsm +0 -0
  56. {pyfemtet-1.0.0a0 → pyfemtet-1.0.0b0}/pyfemtet/opt/interface/_excel_interface/excel_interface.py +0 -0
  57. {pyfemtet-1.0.0a0 → pyfemtet-1.0.0b0}/pyfemtet/opt/interface/_femtet_interface/__init__.py +0 -0
  58. {pyfemtet-1.0.0a0 → pyfemtet-1.0.0b0}/pyfemtet/opt/interface/_femtet_interface/_femtet_parametric.py +0 -0
  59. {pyfemtet-1.0.0a0 → pyfemtet-1.0.0b0}/pyfemtet/opt/interface/_femtet_with_nx_interface/__init__.py +0 -0
  60. {pyfemtet-1.0.0a0 → pyfemtet-1.0.0b0}/pyfemtet/opt/interface/_femtet_with_nx_interface/model1.prt +0 -0
  61. {pyfemtet-1.0.0a0 → pyfemtet-1.0.0b0}/pyfemtet/opt/interface/_femtet_with_nx_interface/model1.x_t +0 -0
  62. {pyfemtet-1.0.0a0 → pyfemtet-1.0.0b0}/pyfemtet/opt/interface/_femtet_with_nx_interface/update_model.py +0 -0
  63. {pyfemtet-1.0.0a0 → pyfemtet-1.0.0b0}/pyfemtet/opt/interface/_femtet_with_solidworks/__init__.py +0 -0
  64. {pyfemtet-1.0.0a0 → pyfemtet-1.0.0b0}/pyfemtet/opt/interface/_solidworks_interface/__init__.py +0 -0
  65. {pyfemtet-1.0.0a0 → pyfemtet-1.0.0b0}/pyfemtet/opt/interface/_solidworks_interface/solidworks_interface.py +0 -0
  66. {pyfemtet-1.0.0a0 → pyfemtet-1.0.0b0}/pyfemtet/opt/interface/_surrogate_model_interface/__init__.py +0 -0
  67. {pyfemtet-1.0.0a0 → pyfemtet-1.0.0b0}/pyfemtet/opt/interface/_surrogate_model_interface/debug-pof-botorch.reccsv +0 -0
  68. {pyfemtet-1.0.0a0 → pyfemtet-1.0.0b0}/pyfemtet/opt/interface/_with_excel_settings/__init__.py +0 -0
  69. {pyfemtet-1.0.0a0 → pyfemtet-1.0.0b0}/pyfemtet/opt/interface/_with_excel_settings/with_excel_settings.py +0 -0
  70. {pyfemtet-1.0.0a0 → pyfemtet-1.0.0b0}/pyfemtet/opt/meta_script/YAML_Generator.xlsm +0 -0
  71. {pyfemtet-1.0.0a0 → pyfemtet-1.0.0b0}/pyfemtet/opt/meta_script/__init__.py +0 -0
  72. {pyfemtet-1.0.0a0 → pyfemtet-1.0.0b0}/pyfemtet/opt/meta_script/__main__.py +0 -0
  73. {pyfemtet-1.0.0a0 → pyfemtet-1.0.0b0}/pyfemtet/opt/meta_script/sample/sample.bas +0 -0
  74. {pyfemtet-1.0.0a0 → pyfemtet-1.0.0b0}/pyfemtet/opt/meta_script/sample/sample.femprj +0 -0
  75. {pyfemtet-1.0.0a0 → pyfemtet-1.0.0b0}/pyfemtet/opt/optimizer/__init__.py +0 -0
  76. {pyfemtet-1.0.0a0 → pyfemtet-1.0.0b0}/pyfemtet/opt/optimizer/optuna_optimizer/__init__.py +0 -0
  77. {pyfemtet-1.0.0a0 → pyfemtet-1.0.0b0}/pyfemtet/opt/optimizer/optuna_optimizer/_optuna_attribute.py +0 -0
  78. {pyfemtet-1.0.0a0 → pyfemtet-1.0.0b0}/pyfemtet/opt/optimizer/optuna_optimizer/_optuna_optimizer.py +0 -0
  79. {pyfemtet-1.0.0a0 → pyfemtet-1.0.0b0}/pyfemtet/opt/optimizer/optuna_optimizer/_pof_botorch/__init__.py +0 -0
  80. {pyfemtet-1.0.0a0 → pyfemtet-1.0.0b0}/pyfemtet/opt/optimizer/optuna_optimizer/_pof_botorch/debug-pof-botorch.reccsv +0 -0
  81. {pyfemtet-1.0.0a0 → pyfemtet-1.0.0b0}/pyfemtet/opt/optimizer/optuna_optimizer/_pof_botorch/enable_nonlinear_constraint.py +0 -0
  82. {pyfemtet-1.0.0a0 → pyfemtet-1.0.0b0}/pyfemtet/opt/optimizer/optuna_optimizer/wat_ex14_parametric_jp.femprj +0 -0
  83. {pyfemtet-1.0.0a0 → pyfemtet-1.0.0b0}/pyfemtet/opt/optimizer/scipy_optimizer/__init__.py +0 -0
  84. {pyfemtet-1.0.0a0 → pyfemtet-1.0.0b0}/pyfemtet/opt/optimizer/scipy_optimizer/_scipy_optimizer.py +0 -0
  85. {pyfemtet-1.0.0a0 → pyfemtet-1.0.0b0}/pyfemtet/opt/prediction/__init__.py +0 -0
  86. {pyfemtet-1.0.0a0 → pyfemtet-1.0.0b0}/pyfemtet/opt/prediction/_botorch_utils.py +0 -0
  87. {pyfemtet-1.0.0a0 → pyfemtet-1.0.0b0}/pyfemtet/opt/prediction/_gpytorch_modules_extension.py +0 -0
  88. {pyfemtet-1.0.0a0 → pyfemtet-1.0.0b0}/pyfemtet/opt/prediction/_helper.py +0 -0
  89. {pyfemtet-1.0.0a0 → pyfemtet-1.0.0b0}/pyfemtet/opt/prediction/_model.py +0 -0
  90. {pyfemtet-1.0.0a0 → pyfemtet-1.0.0b0}/pyfemtet/opt/problem/__init__.py +0 -0
  91. {pyfemtet-1.0.0a0 → pyfemtet-1.0.0b0}/pyfemtet/opt/problem/problem.py +0 -0
  92. {pyfemtet-1.0.0a0 → pyfemtet-1.0.0b0}/pyfemtet/opt/problem/variable_manager/__init__.py +0 -0
  93. {pyfemtet-1.0.0a0 → pyfemtet-1.0.0b0}/pyfemtet/opt/problem/variable_manager/_string_as_expression.py +0 -0
  94. {pyfemtet-1.0.0a0 → pyfemtet-1.0.0b0}/pyfemtet/opt/problem/variable_manager/_variable_manager.py +0 -0
  95. {pyfemtet-1.0.0a0 → pyfemtet-1.0.0b0}/pyfemtet/opt/visualization/__init__.py +0 -0
  96. {pyfemtet-1.0.0a0 → pyfemtet-1.0.0b0}/pyfemtet/opt/visualization/_create_wrapped_components.py +0 -0
  97. {pyfemtet-1.0.0a0 → pyfemtet-1.0.0b0}/pyfemtet/opt/visualization/history_viewer/__init__.py +0 -0
  98. {pyfemtet-1.0.0a0 → pyfemtet-1.0.0b0}/pyfemtet/opt/visualization/history_viewer/__main__.py +0 -0
  99. {pyfemtet-1.0.0a0 → pyfemtet-1.0.0b0}/pyfemtet/opt/visualization/history_viewer/_base_application.py +0 -0
  100. {pyfemtet-1.0.0a0 → pyfemtet-1.0.0b0}/pyfemtet/opt/visualization/history_viewer/_common_pages.py +0 -0
  101. {pyfemtet-1.0.0a0 → pyfemtet-1.0.0b0}/pyfemtet/opt/visualization/history_viewer/_complex_components/__init__.py +0 -0
  102. {pyfemtet-1.0.0a0 → pyfemtet-1.0.0b0}/pyfemtet/opt/visualization/history_viewer/_complex_components/alert_region.py +0 -0
  103. {pyfemtet-1.0.0a0 → pyfemtet-1.0.0b0}/pyfemtet/opt/visualization/history_viewer/_complex_components/control_femtet.py +0 -0
  104. {pyfemtet-1.0.0a0 → pyfemtet-1.0.0b0}/pyfemtet/opt/visualization/history_viewer/_complex_components/main_graph.py +0 -0
  105. {pyfemtet-1.0.0a0 → pyfemtet-1.0.0b0}/pyfemtet/opt/visualization/history_viewer/_complex_components/pm_graph.py +0 -0
  106. {pyfemtet-1.0.0a0 → pyfemtet-1.0.0b0}/pyfemtet/opt/visualization/history_viewer/_process_monitor/__init__.py +0 -0
  107. {pyfemtet-1.0.0a0 → pyfemtet-1.0.0b0}/pyfemtet/opt/visualization/history_viewer/_process_monitor/_application.py +0 -0
  108. {pyfemtet-1.0.0a0 → pyfemtet-1.0.0b0}/pyfemtet/opt/visualization/history_viewer/_process_monitor/_pages.py +0 -0
  109. {pyfemtet-1.0.0a0 → pyfemtet-1.0.0b0}/pyfemtet/opt/visualization/history_viewer/_wrapped_components/__init__.py +0 -0
  110. {pyfemtet-1.0.0a0 → pyfemtet-1.0.0b0}/pyfemtet/opt/visualization/history_viewer/_wrapped_components/dbc.py +0 -0
  111. {pyfemtet-1.0.0a0 → pyfemtet-1.0.0b0}/pyfemtet/opt/visualization/history_viewer/_wrapped_components/dcc.py +0 -0
  112. {pyfemtet-1.0.0a0 → pyfemtet-1.0.0b0}/pyfemtet/opt/visualization/history_viewer/_wrapped_components/html.py +0 -0
  113. {pyfemtet-1.0.0a0 → pyfemtet-1.0.0b0}/pyfemtet/opt/visualization/history_viewer/_wrapped_components/str_enum.py +0 -0
  114. {pyfemtet-1.0.0a0 → pyfemtet-1.0.0b0}/pyfemtet/opt/visualization/history_viewer/result_viewer/.gitignore +0 -0
  115. {pyfemtet-1.0.0a0 → pyfemtet-1.0.0b0}/pyfemtet/opt/visualization/history_viewer/result_viewer/__init__.py +0 -0
  116. {pyfemtet-1.0.0a0 → pyfemtet-1.0.0b0}/pyfemtet/opt/visualization/history_viewer/result_viewer/__main__.py +0 -0
  117. {pyfemtet-1.0.0a0 → pyfemtet-1.0.0b0}/pyfemtet/opt/visualization/history_viewer/result_viewer/_application.py +0 -0
  118. {pyfemtet-1.0.0a0 → pyfemtet-1.0.0b0}/pyfemtet/opt/visualization/history_viewer/result_viewer/_pages.py +0 -0
  119. {pyfemtet-1.0.0a0 → pyfemtet-1.0.0b0}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08.csv +0 -0
  120. {pyfemtet-1.0.0a0 → pyfemtet-1.0.0b0}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08.db +0 -0
  121. {pyfemtet-1.0.0a0 → pyfemtet-1.0.0b0}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8.jpg +0 -0
  122. {pyfemtet-1.0.0a0 → pyfemtet-1.0.0b0}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8.log +0 -0
  123. {pyfemtet-1.0.0a0 → pyfemtet-1.0.0b0}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8.pdt +0 -0
  124. {pyfemtet-1.0.0a0 → pyfemtet-1.0.0b0}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_1.jpg +0 -0
  125. {pyfemtet-1.0.0a0 → pyfemtet-1.0.0b0}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_1.pdt +0 -0
  126. {pyfemtet-1.0.0a0 → pyfemtet-1.0.0b0}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_10.jpg +0 -0
  127. {pyfemtet-1.0.0a0 → pyfemtet-1.0.0b0}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_10.pdt +0 -0
  128. {pyfemtet-1.0.0a0 → pyfemtet-1.0.0b0}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_11.jpg +0 -0
  129. {pyfemtet-1.0.0a0 → pyfemtet-1.0.0b0}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_11.pdt +0 -0
  130. {pyfemtet-1.0.0a0 → pyfemtet-1.0.0b0}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_12.jpg +0 -0
  131. {pyfemtet-1.0.0a0 → pyfemtet-1.0.0b0}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_12.pdt +0 -0
  132. {pyfemtet-1.0.0a0 → pyfemtet-1.0.0b0}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_13.jpg +0 -0
  133. {pyfemtet-1.0.0a0 → pyfemtet-1.0.0b0}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_13.pdt +0 -0
  134. {pyfemtet-1.0.0a0 → pyfemtet-1.0.0b0}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_14.jpg +0 -0
  135. {pyfemtet-1.0.0a0 → pyfemtet-1.0.0b0}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_14.pdt +0 -0
  136. {pyfemtet-1.0.0a0 → pyfemtet-1.0.0b0}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_15.jpg +0 -0
  137. {pyfemtet-1.0.0a0 → pyfemtet-1.0.0b0}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_15.pdt +0 -0
  138. {pyfemtet-1.0.0a0 → pyfemtet-1.0.0b0}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_16.jpg +0 -0
  139. {pyfemtet-1.0.0a0 → pyfemtet-1.0.0b0}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_16.pdt +0 -0
  140. {pyfemtet-1.0.0a0 → pyfemtet-1.0.0b0}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_17.jpg +0 -0
  141. {pyfemtet-1.0.0a0 → pyfemtet-1.0.0b0}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_17.pdt +0 -0
  142. {pyfemtet-1.0.0a0 → pyfemtet-1.0.0b0}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_18.jpg +0 -0
  143. {pyfemtet-1.0.0a0 → pyfemtet-1.0.0b0}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_18.pdt +0 -0
  144. {pyfemtet-1.0.0a0 → pyfemtet-1.0.0b0}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_19.jpg +0 -0
  145. {pyfemtet-1.0.0a0 → pyfemtet-1.0.0b0}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_19.pdt +0 -0
  146. {pyfemtet-1.0.0a0 → pyfemtet-1.0.0b0}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_2.jpg +0 -0
  147. {pyfemtet-1.0.0a0 → pyfemtet-1.0.0b0}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_2.pdt +0 -0
  148. {pyfemtet-1.0.0a0 → pyfemtet-1.0.0b0}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_20.jpg +0 -0
  149. {pyfemtet-1.0.0a0 → pyfemtet-1.0.0b0}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_20.pdt +0 -0
  150. {pyfemtet-1.0.0a0 → pyfemtet-1.0.0b0}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_3.jpg +0 -0
  151. {pyfemtet-1.0.0a0 → pyfemtet-1.0.0b0}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_3.pdt +0 -0
  152. {pyfemtet-1.0.0a0 → pyfemtet-1.0.0b0}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_4.bgr +0 -0
  153. {pyfemtet-1.0.0a0 → pyfemtet-1.0.0b0}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_4.bnd +0 -0
  154. {pyfemtet-1.0.0a0 → pyfemtet-1.0.0b0}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_4.btr +0 -0
  155. {pyfemtet-1.0.0a0 → pyfemtet-1.0.0b0}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_4.jpg +0 -0
  156. {pyfemtet-1.0.0a0 → pyfemtet-1.0.0b0}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_4.mtl +0 -0
  157. {pyfemtet-1.0.0a0 → pyfemtet-1.0.0b0}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_4.pdt +0 -0
  158. {pyfemtet-1.0.0a0 → pyfemtet-1.0.0b0}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_4.prm +0 -0
  159. {pyfemtet-1.0.0a0 → pyfemtet-1.0.0b0}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_5.jpg +0 -0
  160. {pyfemtet-1.0.0a0 → pyfemtet-1.0.0b0}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_5.pdt +0 -0
  161. {pyfemtet-1.0.0a0 → pyfemtet-1.0.0b0}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_6.jpg +0 -0
  162. {pyfemtet-1.0.0a0 → pyfemtet-1.0.0b0}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_6.pdt +0 -0
  163. {pyfemtet-1.0.0a0 → pyfemtet-1.0.0b0}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_7.jpg +0 -0
  164. {pyfemtet-1.0.0a0 → pyfemtet-1.0.0b0}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_7.pdt +0 -0
  165. {pyfemtet-1.0.0a0 → pyfemtet-1.0.0b0}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_8.jpg +0 -0
  166. {pyfemtet-1.0.0a0 → pyfemtet-1.0.0b0}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_8.pdt +0 -0
  167. {pyfemtet-1.0.0a0 → pyfemtet-1.0.0b0}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_9.jpg +0 -0
  168. {pyfemtet-1.0.0a0 → pyfemtet-1.0.0b0}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_9.pdt +0 -0
  169. {pyfemtet-1.0.0a0 → pyfemtet-1.0.0b0}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.femprj +0 -0
  170. {pyfemtet-1.0.0a0 → pyfemtet-1.0.0b0}/pyfemtet/opt/visualization/plotter/__init__.py +0 -0
  171. {pyfemtet-1.0.0a0 → pyfemtet-1.0.0b0}/pyfemtet/opt/visualization/plotter/main_figure_creator.py +0 -0
  172. {pyfemtet-1.0.0a0 → pyfemtet-1.0.0b0}/pyfemtet/opt/visualization/plotter/pm_graph_creator.py +0 -0
  173. {pyfemtet-1.0.0a0 → pyfemtet-1.0.0b0}/pyfemtet/opt/wat_ex14_parametric_jp.femprj +0 -0
  174. {pyfemtet-1.0.0a0 → pyfemtet-1.0.0b0}/pyfemtet/opt/worker_status.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: pyfemtet
3
- Version: 1.0.0a0
3
+ Version: 1.0.0b0
4
4
  Summary: Design parameter optimization using Femtet.
5
5
  License: MIT
6
6
  Author: kazuma.naito
@@ -28,7 +28,8 @@ Requires-Dist: optuna-integration (>=3.6.0,<5.0.0)
28
28
  Requires-Dist: pandas (>=2.2.3,<3)
29
29
  Requires-Dist: plotly (>=5.22.0,<6)
30
30
  Requires-Dist: psutil (>=5.9.6,<6)
31
- Requires-Dist: pywin32 (>=306,<311) ; sys_platform == "win32"
31
+ Requires-Dist: pywin32 (<307) ; sys_platform == "win32" and python_version < "3.13"
32
+ Requires-Dist: pywin32 (>=309) ; sys_platform == "win32" and python_version >= "3.13"
32
33
  Requires-Dist: pyyaml (>=6.0.2,<7)
33
34
  Requires-Dist: scipy (>=1.11.4,<2)
34
35
  Requires-Dist: torch
@@ -491,7 +491,7 @@ msgstr "グラフを自動更新"
491
491
 
492
492
  #: pyfemtet/_i18n/messages.py:242
493
493
  msgid "Interrupt Optimization"
494
- msgstr "最適化を中断しました"
494
+ msgstr "最適化を中断"
495
495
 
496
496
  #: pyfemtet/_i18n/messages.py:244
497
497
  msgid "Result"
@@ -24,7 +24,7 @@ warnings.filterwarnings('ignore', category=RuntimeWarning, message="Couldn't det
24
24
 
25
25
  cfg.set({'distributed.scheduler.worker-ttl': None})
26
26
 
27
- logger = get_module_logger('opt.dask', True)
27
+ logger = get_module_logger('opt.dask', False)
28
28
 
29
29
 
30
30
  __all__ = [
@@ -1,11 +1,13 @@
1
1
  from .femopt import FEMOpt
2
- from .interface import FemtetInterface
2
+ from .interface import FemtetInterface, FemtetWithNXInterface, FemtetWithSolidworksInterface
3
3
  from .optimizer import OptunaOptimizer, ScipyOptimizer
4
4
 
5
5
 
6
6
  __all__ = [
7
7
  'FEMOpt',
8
8
  'FemtetInterface',
9
+ 'FemtetWithNXInterface',
10
+ 'FemtetWithSolidworksInterface',
9
11
  'OptunaOptimizer',
10
12
  'ScipyOptimizer',
11
13
  ]
@@ -71,16 +71,20 @@ class FEMOpt:
71
71
  name: str,
72
72
  expression_string: str,
73
73
  properties: dict[str, ...] | None = None,
74
+ *,
75
+ pass_to_fem: bool = True,
74
76
  ) -> None:
75
- self.opt.add_expression_string(name, expression_string, properties)
77
+ self.opt.add_expression_string(name, expression_string, properties, pass_to_fem=pass_to_fem)
76
78
 
77
79
  def add_expression_sympy(
78
80
  self,
79
81
  name: str,
80
82
  sympy_expr: sympy.Expr,
81
83
  properties: dict[str, ...] | None = None,
84
+ *,
85
+ pass_to_fem: bool = True,
82
86
  ) -> None:
83
- self.opt.add_expression_sympy(name, sympy_expr, properties)
87
+ self.opt.add_expression_sympy(name, sympy_expr, properties, pass_to_fem=pass_to_fem)
84
88
 
85
89
  def add_expression(
86
90
  self,
@@ -89,8 +93,10 @@ class FEMOpt:
89
93
  properties: dict[str, ...] | None = None,
90
94
  args: tuple | None = None,
91
95
  kwargs: dict | None = None,
96
+ *,
97
+ pass_to_fem: bool = True,
92
98
  ) -> None:
93
- self.opt.add_expression(name, fun, properties, args, kwargs)
99
+ self.opt.add_expression(name, fun, properties, args, kwargs, pass_to_fem=pass_to_fem)
94
100
 
95
101
  def add_categorical_parameter(
96
102
  self,
@@ -46,7 +46,7 @@ __all__ = [
46
46
  MAIN_FILTER: dict = {'sub_fidelity_name': MAIN_FIDELITY_NAME}
47
47
 
48
48
 
49
- logger = get_module_logger('opt.history', True)
49
+ logger = get_module_logger('opt.history', False)
50
50
 
51
51
 
52
52
  def create_err_msg_from_exception(e: Exception):
@@ -4,7 +4,6 @@ from typing import TYPE_CHECKING
4
4
 
5
5
  import os
6
6
  import sys
7
- import warnings
8
7
  import subprocess
9
8
  from time import sleep
10
9
  from contextlib import nullcontext
@@ -119,6 +118,7 @@ class FemtetInterface(COMInterface):
119
118
  """
120
119
 
121
120
  com_members = {'Femtet': 'FemtetMacro.Femtet'}
121
+ _show_parametric_index_warning = True # for GUI
122
122
 
123
123
  def __init__(
124
124
  self,
@@ -129,14 +129,19 @@ class FemtetInterface(COMInterface):
129
129
  strictly_pid_specify: bool = True, # dask worker では True にしたいので super() の引数にしない。
130
130
  allow_without_project: bool = False, # main でのみ True を許容したいので super() の引数にしない。
131
131
  open_result_with_gui: bool = True,
132
- parametric_output_indexes_use_as_objective: dict[int, str or float] = None, # TODO: Remove this
133
132
  always_open_copy=False,
133
+ # ユーザーはメソッドを使うことを推奨。GUI などで使用。
134
+ parametric_output_indexes_use_as_objective: dict[int, str | float] = None,
134
135
  ):
135
- # warning
136
136
  if parametric_output_indexes_use_as_objective is not None:
137
- warnings.warn(
138
- "解析モデルに設定された既存のスイープテーブルは削除されます。"
139
- )
137
+ if FemtetInterface._show_parametric_index_warning:
138
+ logger.warning(_(
139
+ en_message='The argument `parametric_output_indexes_use_as_objective` is deprecated. '
140
+ 'Please use `FemtetInterface.use_parametric_output_as_objective()` instead.',
141
+ jp_message='`parametric_output_indexes_use_as_objective` は非推奨の引数です。'
142
+ '代わりに `FemtetInterface.use_parametric_output_as_objective()` '
143
+ 'を使ってください。',
144
+ ))
140
145
 
141
146
  # 引数の処理
142
147
  if femprj_path is None:
@@ -255,6 +260,13 @@ class FemtetInterface(COMInterface):
255
260
  None
256
261
 
257
262
  """
263
+
264
+ # warning
265
+ logger.warning(_(
266
+ en_message='The existing sweep table in the project will be removed.',
267
+ jp_message='解析モデルに設定された既存のスイープテーブルは削除されます。'
268
+ ))
269
+
258
270
  # check
259
271
  if isinstance(direction, str):
260
272
  if direction not in ("minimize", "maximize"):
@@ -504,6 +516,8 @@ class FemtetInterface(COMInterface):
504
516
  name = fun.__name__
505
517
  if fun.__name__ == 'Solve':
506
518
  context = nullcontext()
519
+ elif fun.__name__ == 'solve_via_parametric_dll':
520
+ context = nullcontext()
507
521
 
508
522
  elif isinstance(fun, str):
509
523
 
@@ -525,7 +539,7 @@ class FemtetInterface(COMInterface):
525
539
  'If the optimization is hanging, the most reason is '
526
540
  'a dialog is opening in Femtet and it waits for your '
527
541
  'input. Please confirm there is no dialog in Femtet.',
528
- '{name} の実行に {warning_time_sec} 以上かかっています。'
542
+ '{name} の実行に {warning_time_sec} 秒以上かかっています。'
529
543
  'もし最適化がハングしているならば、考えられる理由として、'
530
544
  'Femtet で予期せずダイアログが開いてユーザーの入力待ちをしている場合があります。'
531
545
  'もし Femtet でダイアログが開いていれば、閉じてください。',
@@ -156,7 +156,7 @@ class FemtetWithNXInterface(FemtetInterface, _NXInterface):
156
156
  strictly_pid_specify: bool = True, # dask worker では True にしたいので super() の引数にしない。
157
157
  allow_without_project: bool = False, # main でのみ True を許容したいので super() の引数にしない。
158
158
  open_result_with_gui: bool = True,
159
- parametric_output_indexes_use_as_objective: dict[int, str or float] = None, # TODO: Remove this
159
+ parametric_output_indexes_use_as_objective: dict[int, str | float] = None,
160
160
  always_open_copy=False,
161
161
  export_curves: bool or None = None,
162
162
  export_surfaces: bool or None = None,
@@ -31,7 +31,7 @@ class FemtetWithSolidworksInterface(FemtetInterface, SolidworksInterface, Abstra
31
31
  strictly_pid_specify: bool = True,
32
32
  allow_without_project: bool = False,
33
33
  open_result_with_gui: bool = True,
34
- parametric_output_indexes_use_as_objective: dict[int, str or float] = None,
34
+ parametric_output_indexes_use_as_objective: dict[int, str | float] = None,
35
35
  always_open_copy=False,
36
36
  close_solidworks_on_terminate=False,
37
37
  solidworks_visible=True,
@@ -0,0 +1,150 @@
1
+ from __future__ import annotations
2
+
3
+ from typing import TYPE_CHECKING, Sequence
4
+
5
+ from pyfemtet.opt.history import *
6
+
7
+ from pyfemtet.opt.interface import AbstractFEMInterface
8
+ from pyfemtet._i18n import _
9
+
10
+ if TYPE_CHECKING:
11
+ from pyfemtet.opt.optimizer import AbstractOptimizer
12
+
13
+
14
+ __all__ = [
15
+ 'AbstractSurrogateModelInterfaceBase',
16
+ ]
17
+
18
+
19
+ class AbstractSurrogateModelInterfaceBase(AbstractFEMInterface):
20
+ _load_problem_from_fem = True
21
+ current_obj_values: dict[str, float]
22
+ train_history: History
23
+
24
+ def __init__(
25
+ self,
26
+ history_path: str = None,
27
+ train_history: History = None,
28
+ _output_directions: (
29
+ Sequence[str | float]
30
+ | dict[str, str | float]
31
+ | dict[int, str | float]
32
+ ) = None
33
+ ):
34
+
35
+ self._output_directions = _output_directions
36
+
37
+ # history_path が与えられた場合、train_history をコンストラクトする
38
+ if history_path is not None:
39
+ train_history = History()
40
+ train_history.load_csv(history_path, with_finalize=True)
41
+
42
+ assert train_history is not None
43
+
44
+ self.train_history = train_history
45
+
46
+ self.current_obj_values = {}
47
+
48
+ def load_objectives(self, opt: AbstractOptimizer):
49
+
50
+ # output directions が与えられない場合、
51
+ # opt.add_objective との整合をチェックする
52
+ if self._output_directions is None:
53
+
54
+ # add_objective された目的のうち、
55
+ # training data に含まれる名前ならば
56
+ # fun を「その時点の current_obj_values を返す関数」で
57
+ # 上書き
58
+ obj_name: str
59
+ for obj_name, obj in opt.objectives.items():
60
+ # あれば上書き、なければ surrogate 最適化の際に
61
+ # 新しく追加した model を使わない目的関数と見做して何もしない
62
+ if obj_name in self.train_history.obj_names:
63
+ obj.fun = lambda _, obj_name_=obj_name: self.current_obj_values[obj_name_]
64
+
65
+ # dict で与えられた場合
66
+ elif isinstance(self._output_directions, dict):
67
+
68
+ # index 入力か str 入力かで統一されているか確認
69
+ keys = tuple(self._output_directions.keys())
70
+ assert all([isinstance(key, type(keys[0])) for key in keys]), _(
71
+ en_message='The keys of _output_directions must be '
72
+ 'all-int or all-str.',
73
+ jp_message='_output_directions のキーは int または str で'
74
+ '統一されていなければなりません。',
75
+ )
76
+
77
+ # index がキーである場合
78
+ if isinstance(keys[0], int):
79
+
80
+ for index, direction in self._output_directions.items():
81
+ obj_name = self.train_history.obj_names[index]
82
+
83
+ opt.add_objective(
84
+ name=obj_name,
85
+ fun=lambda _, obj_name_=obj_name: self.current_obj_values[obj_name_],
86
+ direction=direction,
87
+ args=(),
88
+ kwargs={},
89
+ )
90
+
91
+ # obj_name がキーである場合
92
+ if isinstance(keys[0], str):
93
+
94
+ for obj_name, direction in self._output_directions.items():
95
+ assert obj_name in self.train_history.obj_names, _(
96
+ en_message='The objective name passed as a key of '
97
+ '_output_direction must be one of the history\'s '
98
+ 'objective names. Passed name: {obj_name} / '
99
+ 'History\'s names: {obj_names}',
100
+ jp_message='_output_directions に目的関数名を与える場合は'
101
+ 'history に含まれる名前を指定しなければなりません。'
102
+ '与えられた目的名: {obj_name} / history に含まれる'
103
+ '目的名: {obj_names}',
104
+ obj_name=obj_name,
105
+ obj_names=', '.join(self.train_history.obj_names)
106
+ )
107
+
108
+ opt.add_objective(
109
+ name=obj_name,
110
+ fun=lambda obj_name_=obj_name: self.current_obj_values[obj_name_],
111
+ direction=direction,
112
+ args=(),
113
+ kwargs={},
114
+ )
115
+
116
+ # tuple で与えられた場合
117
+ elif isinstance(self._output_directions, list) \
118
+ or isinstance(self._output_directions, tuple):
119
+
120
+ obj_names = self.train_history.obj_names
121
+ assert len(self._output_directions) == len(obj_names), _(
122
+ en_message='The length of _output_directions passed as a list '
123
+ 'must be same with that of the history\'s objective '
124
+ 'names.',
125
+ jp_message='_output_directions をリストで渡す場合は'
126
+ 'その長さが history の目的関数数と一致して'
127
+ 'いなければなりません。'
128
+ )
129
+
130
+ for obj_name, direction in zip(obj_names, self._output_directions):
131
+ opt.add_objective(
132
+ name=obj_name,
133
+ fun=lambda _, obj_name_=obj_name: self.current_obj_values[obj_name_],
134
+ direction=direction,
135
+ args=(),
136
+ kwargs={},
137
+ )
138
+
139
+ def load_variables(self, opt: AbstractOptimizer):
140
+ # opt の変数が充分であるかのチェックのみ
141
+ parameters = opt.variable_manager.get_variables()
142
+ assert len(set(self.train_history.prm_names) - set(parameters.keys())) == 0
143
+
144
+ def _check_using_fem(self, fun: callable) -> bool:
145
+ return False
146
+
147
+ def _check_param_and_raise(self, prm_name) -> None:
148
+ if prm_name not in self.train_history.prm_names:
149
+ raise KeyError(f'Parameter name {prm_name} is not in '
150
+ f'training input {self.train_history.prm_names}.')
@@ -1,3 +1,5 @@
1
+ from typing import Sequence
2
+
1
3
  import numpy as np
2
4
  from scipy.stats.distributions import norm
3
5
 
@@ -24,8 +26,22 @@ __all__ = [
24
26
 
25
27
  class BoTorchInterface(AbstractSurrogateModelInterfaceBase):
26
28
 
27
- def __init__(self, history_path: str = None, train_history: History = None):
28
- AbstractSurrogateModelInterfaceBase.__init__(self, history_path, train_history)
29
+ def __init__(
30
+ self,
31
+ history_path: str = None,
32
+ train_history: History = None,
33
+ _output_directions: (
34
+ Sequence[str | float]
35
+ | dict[str, str | float]
36
+ | dict[int, str | float]
37
+ ) = None
38
+ ):
39
+ AbstractSurrogateModelInterfaceBase.__init__(
40
+ self,
41
+ history_path,
42
+ train_history,
43
+ _output_directions
44
+ )
29
45
 
30
46
  self.model = SingleTaskGPModel()
31
47
  self.pyfemtet_model = PyFemtetModel()
@@ -62,11 +78,22 @@ class PoFBoTorchInterface(BoTorchInterface, AbstractSurrogateModelInterfaceBase)
62
78
  def __init__(
63
79
  self,
64
80
  history_path: str,
81
+ train_history: History = None,
65
82
  observation_noise: float | str | None = None,
66
83
  feasibility_noise: float | str | None = None,
67
84
  feasibility_cdf_threshold: float | str = 0.5, # or 'sample_mean'
85
+ _output_directions: (
86
+ Sequence[str | float]
87
+ | dict[str, str | float]
88
+ | dict[int, str | float]
89
+ ) = None
68
90
  ):
69
- AbstractSurrogateModelInterfaceBase.__init__(self, history_path, None)
91
+ AbstractSurrogateModelInterfaceBase.__init__(
92
+ self,
93
+ history_path,
94
+ train_history,
95
+ _output_directions
96
+ )
70
97
 
71
98
  self.model = SingleTaskGPModel()
72
99
  self.pyfemtet_model = PyFemtetModel()
@@ -32,7 +32,7 @@ DIRECTION: TypeAlias = (
32
32
  ]
33
33
  )
34
34
 
35
- logger = get_module_logger('opt.optimizer', True)
35
+ logger = get_module_logger('opt.optimizer', False)
36
36
 
37
37
 
38
38
  def _log_hidden_constraint(e: Exception):
@@ -177,11 +177,14 @@ class AbstractOptimizer:
177
177
  name: str,
178
178
  expression_string: str,
179
179
  properties: dict[str, ...] | None = None,
180
+ *,
181
+ pass_to_fem: bool = True,
180
182
  ) -> None:
181
183
  var = ExpressionFromString()
182
184
  var.name = name
183
185
  var._expr = ExpressionFromString.InternalClass(expression_string=expression_string)
184
186
  var.properties = properties or dict()
187
+ var.pass_to_fem = pass_to_fem
185
188
  _duplicated_name_check(name, self.variable_manager.variables.keys())
186
189
  self.variable_manager.variables.update({name: var})
187
190
 
@@ -190,11 +193,14 @@ class AbstractOptimizer:
190
193
  name: str,
191
194
  sympy_expr: sympy.Expr,
192
195
  properties: dict[str, ...] | None = None,
196
+ *,
197
+ pass_to_fem: bool = True,
193
198
  ) -> None:
194
199
  var = ExpressionFromString()
195
200
  var.name = name
196
201
  var._expr = ExpressionFromString.InternalClass(sympy_expr=sympy_expr)
197
202
  var.properties = properties or dict()
203
+ var.pass_to_fem = pass_to_fem
198
204
  _duplicated_name_check(name, self.variable_manager.variables.keys())
199
205
  self.variable_manager.variables.update({name: var})
200
206
 
@@ -205,6 +211,8 @@ class AbstractOptimizer:
205
211
  properties: dict[str, ...] | None = None,
206
212
  args: tuple | None = None,
207
213
  kwargs: dict | None = None,
214
+ *,
215
+ pass_to_fem: bool = True,
208
216
  ) -> None:
209
217
  var = ExpressionFromFunction()
210
218
  var.name = name
@@ -212,6 +220,7 @@ class AbstractOptimizer:
212
220
  var.args = args or tuple()
213
221
  var.kwargs = kwargs or dict()
214
222
  var.properties = properties or dict()
223
+ var.pass_to_fem = pass_to_fem
215
224
  _duplicated_name_check(name, self.variable_manager.variables.keys())
216
225
  self.variable_manager.variables.update({name: var})
217
226
 
@@ -138,7 +138,7 @@ if TYPE_CHECKING:
138
138
  # noinspection PyTypeChecker
139
139
  _logger = get_logger(False)
140
140
 
141
- DEBUG = True
141
+ DEBUG = False
142
142
  logger = get_module_logger('opt.PoFBoTorchSampler', DEBUG)
143
143
 
144
144
  warnings.filterwarnings('ignore', category=InputDataWarning)
@@ -11,7 +11,8 @@ dependencies = [
11
11
  "tqdm>=4.66.1,<5",
12
12
  "colorlog>=6.8.0,<7",
13
13
  "psutil>=5.9.6,<6",
14
- "pywin32>=306, <311 ; sys_platform=='win32'", # python pinning
14
+ "pywin32<307 ; sys_platform == 'win32' and python_version < '3.13'",
15
+ "pywin32>=309 ; sys_platform == 'win32' and python_version >= '3.13'",
15
16
  "femtetutils>=1.0.0,<2 ; sys_platform=='win32'",
16
17
  "dask~=2024.12.1",
17
18
  "distributed~=2024.12.1",
@@ -32,7 +33,7 @@ dependencies = [
32
33
 
33
34
  #[project.optional-dependencies]
34
35
  #brep = ["brepmatching>=0.1.8,<0.2"]
35
- version = "1.0.0a0"
36
+ version = "1.0.0b0"
36
37
 
37
38
  [project.urls]
38
39
  Repository = "https://github.com/pyfemtet/pyfemtet"
@@ -1,59 +0,0 @@
1
- from __future__ import annotations
2
-
3
- from typing import TYPE_CHECKING
4
-
5
- from pyfemtet.opt.history import *
6
-
7
- from pyfemtet.opt.interface import AbstractFEMInterface
8
-
9
- if TYPE_CHECKING:
10
- from pyfemtet.opt.optimizer import AbstractOptimizer
11
-
12
-
13
- __all__ = [
14
- 'AbstractSurrogateModelInterfaceBase',
15
- ]
16
-
17
-
18
- class AbstractSurrogateModelInterfaceBase(AbstractFEMInterface):
19
- current_obj_values: dict[str, float]
20
- train_history: History
21
-
22
- def __init__(
23
- self,
24
- history_path: str = None,
25
- train_history: History = None,
26
- ):
27
-
28
- # history_path が与えられた場合、train_history をコンストラクトする
29
- if history_path is not None:
30
- train_history = History()
31
- train_history.load_csv(history_path, with_finalize=True)
32
-
33
- assert train_history is not None
34
-
35
- self.train_history = train_history
36
-
37
- self.current_obj_values = {}
38
-
39
- def load_objectives(self, opt: AbstractOptimizer):
40
- # add_objective された目的のうち、
41
- # training data に含まれる名前ならば
42
- # fun を「その時点の current_obj_values を返す関数」で
43
- # 上書き
44
- for obj_name, obj in opt.objectives.items():
45
- if obj_name in self.train_history.obj_names:
46
- obj.fun = lambda obj_name_=obj_name: self.current_obj_values[obj_name_]
47
-
48
- def load_variables(self, opt: AbstractOptimizer):
49
- # opt の変数が充分であるかのチェックのみ
50
- parameters = opt.variable_manager.get_variables()
51
- assert len(set(self.train_history.prm_names) - set(parameters.keys())) == 0
52
-
53
- def _check_using_fem(self, fun: callable) -> bool:
54
- return False
55
-
56
- def _check_param_and_raise(self, prm_name) -> None:
57
- if prm_name not in self.train_history.prm_names:
58
- raise KeyError(f'Parameter name {prm_name} is not in '
59
- f'training input {self.train_history.prm_names}.')
File without changes
File without changes
File without changes