PyFemtet 1.0.0__tar.gz → 1.0.0a0__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.
- {pyfemtet-1.0.0 → pyfemtet-1.0.0a0}/PKG-INFO +2 -3
- pyfemtet-1.0.0a0/pyfemtet/_i18n/locales/ja/LC_MESSAGES/messages.mo +0 -0
- {pyfemtet-1.0.0 → pyfemtet-1.0.0a0}/pyfemtet/_i18n/locales/ja/LC_MESSAGES/messages.po +1 -1
- {pyfemtet-1.0.0 → pyfemtet-1.0.0a0}/pyfemtet/_util/dask_util.py +1 -1
- {pyfemtet-1.0.0 → pyfemtet-1.0.0a0}/pyfemtet/_util/df_util.py +1 -18
- {pyfemtet-1.0.0 → pyfemtet-1.0.0a0}/pyfemtet/_util/helper.py +0 -9
- {pyfemtet-1.0.0 → pyfemtet-1.0.0a0}/pyfemtet/opt/__init__.py +1 -3
- {pyfemtet-1.0.0 → pyfemtet-1.0.0a0}/pyfemtet/opt/femopt.py +3 -22
- {pyfemtet-1.0.0 → pyfemtet-1.0.0a0}/pyfemtet/opt/history/_history.py +6 -18
- {pyfemtet-1.0.0 → pyfemtet-1.0.0a0}/pyfemtet/opt/interface/_excel_interface/excel_interface.py +2 -0
- {pyfemtet-1.0.0 → pyfemtet-1.0.0a0}/pyfemtet/opt/interface/_femtet_interface/femtet_interface.py +11 -24
- {pyfemtet-1.0.0 → pyfemtet-1.0.0a0}/pyfemtet/opt/interface/_femtet_with_nx_interface/femtet_with_nx_interface.py +1 -1
- {pyfemtet-1.0.0 → pyfemtet-1.0.0a0}/pyfemtet/opt/interface/_femtet_with_solidworks/femtet_with_solidworks_interface.py +1 -21
- {pyfemtet-1.0.0 → pyfemtet-1.0.0a0}/pyfemtet/opt/interface/_solidworks_interface/solidworks_interface.py +0 -21
- pyfemtet-1.0.0a0/pyfemtet/opt/interface/_surrogate_model_interface/base_surrogate_interface.py +59 -0
- {pyfemtet-1.0.0 → pyfemtet-1.0.0a0}/pyfemtet/opt/interface/_surrogate_model_interface/botorch_interface.py +3 -30
- {pyfemtet-1.0.0 → pyfemtet-1.0.0a0}/pyfemtet/opt/optimizer/_base_optimizer.py +23 -58
- pyfemtet-1.0.0a0/pyfemtet/opt/optimizer/optuna_optimizer/_optuna_attribute.py +73 -0
- {pyfemtet-1.0.0 → pyfemtet-1.0.0a0}/pyfemtet/opt/optimizer/optuna_optimizer/_optuna_optimizer.py +20 -138
- {pyfemtet-1.0.0 → pyfemtet-1.0.0a0}/pyfemtet/opt/optimizer/optuna_optimizer/_pof_botorch/pof_botorch_sampler.py +4 -4
- {pyfemtet-1.0.0 → pyfemtet-1.0.0a0}/pyfemtet/opt/optimizer/scipy_optimizer/_scipy_optimizer.py +0 -19
- pyfemtet-1.0.0a0/pyfemtet/opt/visualization/plotter/__init__.py +0 -0
- {pyfemtet-1.0.0 → pyfemtet-1.0.0a0}/pyproject.toml +5 -5
- pyfemtet-1.0.0/pyfemtet/_i18n/locales/ja/LC_MESSAGES/messages.mo +0 -0
- pyfemtet-1.0.0/pyfemtet/opt/interface/_surrogate_model_interface/base_surrogate_interface.py +0 -150
- pyfemtet-1.0.0/pyfemtet/opt/optimizer/optuna_optimizer/_optuna_attribute.py +0 -63
- {pyfemtet-1.0.0 → pyfemtet-1.0.0a0}/LICENSE +0 -0
- {pyfemtet-1.0.0 → pyfemtet-1.0.0a0}/LICENSE_THIRD_PARTY.txt +0 -0
- {pyfemtet-1.0.0 → pyfemtet-1.0.0a0}/README.md +0 -0
- {pyfemtet-1.0.0 → pyfemtet-1.0.0a0}/pyfemtet/__init__.py +0 -0
- {pyfemtet-1.0.0 → pyfemtet-1.0.0a0}/pyfemtet/_i18n/1. make_pot_and_update_po.bat +0 -0
- {pyfemtet-1.0.0 → pyfemtet-1.0.0a0}/pyfemtet/_i18n/2. build_mo.bat +0 -0
- {pyfemtet-1.0.0 → pyfemtet-1.0.0a0}/pyfemtet/_i18n/__init__.py +0 -0
- {pyfemtet-1.0.0 → pyfemtet-1.0.0a0}/pyfemtet/_i18n/babel.cfg +0 -0
- {pyfemtet-1.0.0 → pyfemtet-1.0.0a0}/pyfemtet/_i18n/i18n.py +0 -0
- {pyfemtet-1.0.0 → pyfemtet-1.0.0a0}/pyfemtet/_i18n/locales/messages.pot +0 -0
- {pyfemtet-1.0.0 → pyfemtet-1.0.0a0}/pyfemtet/_i18n/messages.py +0 -0
- {pyfemtet-1.0.0 → pyfemtet-1.0.0a0}/pyfemtet/_util/__init__.py +0 -0
- {pyfemtet-1.0.0 → pyfemtet-1.0.0a0}/pyfemtet/_util/closing.py +0 -0
- {pyfemtet-1.0.0 → pyfemtet-1.0.0a0}/pyfemtet/_util/excel_macro_util.py +0 -0
- {pyfemtet-1.0.0 → pyfemtet-1.0.0a0}/pyfemtet/_util/excel_parse_util.py +0 -0
- {pyfemtet-1.0.0 → pyfemtet-1.0.0a0}/pyfemtet/_util/femtet_access_inspection.py +0 -0
- {pyfemtet-1.0.0 → pyfemtet-1.0.0a0}/pyfemtet/_util/femtet_autosave.py +0 -0
- {pyfemtet-1.0.0 → pyfemtet-1.0.0a0}/pyfemtet/_util/femtet_exit.py +0 -0
- {pyfemtet-1.0.0 → pyfemtet-1.0.0a0}/pyfemtet/_util/femtet_version.py +0 -0
- {pyfemtet-1.0.0 → pyfemtet-1.0.0a0}/pyfemtet/_util/process_util.py +0 -0
- {pyfemtet-1.0.0 → pyfemtet-1.0.0a0}/pyfemtet/_util/sample.xlsx +0 -0
- {pyfemtet-1.0.0 → pyfemtet-1.0.0a0}/pyfemtet/_util/str_enum.py +0 -0
- {pyfemtet-1.0.0 → pyfemtet-1.0.0a0}/pyfemtet/core.py +0 -0
- {pyfemtet-1.0.0 → pyfemtet-1.0.0a0}/pyfemtet/dispatch_extensions/__init__.py +0 -0
- {pyfemtet-1.0.0 → pyfemtet-1.0.0a0}/pyfemtet/dispatch_extensions/_impl.py +0 -0
- {pyfemtet-1.0.0 → pyfemtet-1.0.0a0}/pyfemtet/logger/__init__.py +0 -0
- {pyfemtet-1.0.0 → pyfemtet-1.0.0a0}/pyfemtet/logger/_impl.py +0 -0
- {pyfemtet-1.0.0 → pyfemtet-1.0.0a0}/pyfemtet/opt/exceptions.py +0 -0
- {pyfemtet-1.0.0 → pyfemtet-1.0.0a0}/pyfemtet/opt/history/__init__.py +0 -0
- {pyfemtet-1.0.0 → pyfemtet-1.0.0a0}/pyfemtet/opt/history/_hypervolume.py +0 -0
- {pyfemtet-1.0.0 → pyfemtet-1.0.0a0}/pyfemtet/opt/history/_optimality.py +0 -0
- {pyfemtet-1.0.0 → pyfemtet-1.0.0a0}/pyfemtet/opt/interface/__init__.py +0 -0
- {pyfemtet-1.0.0 → pyfemtet-1.0.0a0}/pyfemtet/opt/interface/_base_interface.py +0 -0
- {pyfemtet-1.0.0 → pyfemtet-1.0.0a0}/pyfemtet/opt/interface/_excel_interface/__init__.py +0 -0
- {pyfemtet-1.0.0 → pyfemtet-1.0.0a0}/pyfemtet/opt/interface/_excel_interface/debug-excel-interface.xlsm +0 -0
- {pyfemtet-1.0.0 → pyfemtet-1.0.0a0}/pyfemtet/opt/interface/_femtet_interface/__init__.py +0 -0
- {pyfemtet-1.0.0 → pyfemtet-1.0.0a0}/pyfemtet/opt/interface/_femtet_interface/_femtet_parametric.py +0 -0
- {pyfemtet-1.0.0 → pyfemtet-1.0.0a0}/pyfemtet/opt/interface/_femtet_with_nx_interface/__init__.py +0 -0
- {pyfemtet-1.0.0 → pyfemtet-1.0.0a0}/pyfemtet/opt/interface/_femtet_with_nx_interface/model1.prt +0 -0
- {pyfemtet-1.0.0 → pyfemtet-1.0.0a0}/pyfemtet/opt/interface/_femtet_with_nx_interface/model1.x_t +0 -0
- {pyfemtet-1.0.0 → pyfemtet-1.0.0a0}/pyfemtet/opt/interface/_femtet_with_nx_interface/update_model.py +0 -0
- {pyfemtet-1.0.0 → pyfemtet-1.0.0a0}/pyfemtet/opt/interface/_femtet_with_solidworks/__init__.py +0 -0
- {pyfemtet-1.0.0 → pyfemtet-1.0.0a0}/pyfemtet/opt/interface/_solidworks_interface/__init__.py +0 -0
- /pyfemtet-1.0.0/pyfemtet/opt/meta_script/__init__.py → /pyfemtet-1.0.0a0/pyfemtet/opt/interface/_surrogate/_base.py +0 -0
- {pyfemtet-1.0.0 → pyfemtet-1.0.0a0}/pyfemtet/opt/interface/_surrogate_model_interface/__init__.py +0 -0
- {pyfemtet-1.0.0 → pyfemtet-1.0.0a0}/pyfemtet/opt/interface/_surrogate_model_interface/debug-pof-botorch.reccsv +0 -0
- {pyfemtet-1.0.0 → pyfemtet-1.0.0a0}/pyfemtet/opt/interface/_with_excel_settings/__init__.py +0 -0
- {pyfemtet-1.0.0 → pyfemtet-1.0.0a0}/pyfemtet/opt/interface/_with_excel_settings/with_excel_settings.py +0 -0
- {pyfemtet-1.0.0 → pyfemtet-1.0.0a0}/pyfemtet/opt/meta_script/YAML_Generator.xlsm +0 -0
- {pyfemtet-1.0.0/pyfemtet/opt/problem → pyfemtet-1.0.0a0/pyfemtet/opt/meta_script}/__init__.py +0 -0
- {pyfemtet-1.0.0 → pyfemtet-1.0.0a0}/pyfemtet/opt/meta_script/__main__.py +0 -0
- {pyfemtet-1.0.0 → pyfemtet-1.0.0a0}/pyfemtet/opt/meta_script/sample/sample.bas +0 -0
- {pyfemtet-1.0.0 → pyfemtet-1.0.0a0}/pyfemtet/opt/meta_script/sample/sample.femprj +0 -0
- {pyfemtet-1.0.0 → pyfemtet-1.0.0a0}/pyfemtet/opt/optimizer/__init__.py +0 -0
- {pyfemtet-1.0.0 → pyfemtet-1.0.0a0}/pyfemtet/opt/optimizer/optuna_optimizer/__init__.py +0 -0
- {pyfemtet-1.0.0 → pyfemtet-1.0.0a0}/pyfemtet/opt/optimizer/optuna_optimizer/_pof_botorch/__init__.py +0 -0
- {pyfemtet-1.0.0 → pyfemtet-1.0.0a0}/pyfemtet/opt/optimizer/optuna_optimizer/_pof_botorch/debug-pof-botorch.reccsv +0 -0
- {pyfemtet-1.0.0 → pyfemtet-1.0.0a0}/pyfemtet/opt/optimizer/optuna_optimizer/_pof_botorch/enable_nonlinear_constraint.py +0 -0
- {pyfemtet-1.0.0 → pyfemtet-1.0.0a0}/pyfemtet/opt/optimizer/optuna_optimizer/wat_ex14_parametric_jp.femprj +0 -0
- {pyfemtet-1.0.0 → pyfemtet-1.0.0a0}/pyfemtet/opt/optimizer/scipy_optimizer/__init__.py +0 -0
- {pyfemtet-1.0.0 → pyfemtet-1.0.0a0}/pyfemtet/opt/prediction/__init__.py +0 -0
- {pyfemtet-1.0.0 → pyfemtet-1.0.0a0}/pyfemtet/opt/prediction/_botorch_utils.py +0 -0
- {pyfemtet-1.0.0 → pyfemtet-1.0.0a0}/pyfemtet/opt/prediction/_gpytorch_modules_extension.py +0 -0
- {pyfemtet-1.0.0 → pyfemtet-1.0.0a0}/pyfemtet/opt/prediction/_helper.py +0 -0
- {pyfemtet-1.0.0 → pyfemtet-1.0.0a0}/pyfemtet/opt/prediction/_model.py +0 -0
- {pyfemtet-1.0.0/pyfemtet/opt/visualization → pyfemtet-1.0.0a0/pyfemtet/opt/problem}/__init__.py +0 -0
- {pyfemtet-1.0.0 → pyfemtet-1.0.0a0}/pyfemtet/opt/problem/problem.py +0 -0
- {pyfemtet-1.0.0 → pyfemtet-1.0.0a0}/pyfemtet/opt/problem/variable_manager/__init__.py +0 -0
- {pyfemtet-1.0.0 → pyfemtet-1.0.0a0}/pyfemtet/opt/problem/variable_manager/_string_as_expression.py +0 -0
- {pyfemtet-1.0.0 → pyfemtet-1.0.0a0}/pyfemtet/opt/problem/variable_manager/_variable_manager.py +0 -0
- {pyfemtet-1.0.0/pyfemtet/opt/visualization/history_viewer → pyfemtet-1.0.0a0/pyfemtet/opt/visualization}/__init__.py +0 -0
- {pyfemtet-1.0.0 → pyfemtet-1.0.0a0}/pyfemtet/opt/visualization/_create_wrapped_components.py +0 -0
- {pyfemtet-1.0.0/pyfemtet/opt/visualization/history_viewer/_complex_components → pyfemtet-1.0.0a0/pyfemtet/opt/visualization/history_viewer}/__init__.py +0 -0
- {pyfemtet-1.0.0 → pyfemtet-1.0.0a0}/pyfemtet/opt/visualization/history_viewer/__main__.py +0 -0
- {pyfemtet-1.0.0 → pyfemtet-1.0.0a0}/pyfemtet/opt/visualization/history_viewer/_base_application.py +0 -0
- {pyfemtet-1.0.0 → pyfemtet-1.0.0a0}/pyfemtet/opt/visualization/history_viewer/_common_pages.py +0 -0
- {pyfemtet-1.0.0/pyfemtet/opt/visualization/history_viewer/_process_monitor → pyfemtet-1.0.0a0/pyfemtet/opt/visualization/history_viewer/_complex_components}/__init__.py +0 -0
- {pyfemtet-1.0.0 → pyfemtet-1.0.0a0}/pyfemtet/opt/visualization/history_viewer/_complex_components/alert_region.py +0 -0
- {pyfemtet-1.0.0 → pyfemtet-1.0.0a0}/pyfemtet/opt/visualization/history_viewer/_complex_components/control_femtet.py +0 -0
- {pyfemtet-1.0.0 → pyfemtet-1.0.0a0}/pyfemtet/opt/visualization/history_viewer/_complex_components/main_graph.py +0 -0
- {pyfemtet-1.0.0 → pyfemtet-1.0.0a0}/pyfemtet/opt/visualization/history_viewer/_complex_components/pm_graph.py +0 -0
- {pyfemtet-1.0.0/pyfemtet/opt/visualization/history_viewer/_wrapped_components → pyfemtet-1.0.0a0/pyfemtet/opt/visualization/history_viewer/_process_monitor}/__init__.py +0 -0
- {pyfemtet-1.0.0 → pyfemtet-1.0.0a0}/pyfemtet/opt/visualization/history_viewer/_process_monitor/_application.py +0 -0
- {pyfemtet-1.0.0 → pyfemtet-1.0.0a0}/pyfemtet/opt/visualization/history_viewer/_process_monitor/_pages.py +0 -0
- {pyfemtet-1.0.0/pyfemtet/opt/visualization/history_viewer/result_viewer → pyfemtet-1.0.0a0/pyfemtet/opt/visualization/history_viewer/_wrapped_components}/__init__.py +0 -0
- {pyfemtet-1.0.0 → pyfemtet-1.0.0a0}/pyfemtet/opt/visualization/history_viewer/_wrapped_components/dbc.py +0 -0
- {pyfemtet-1.0.0 → pyfemtet-1.0.0a0}/pyfemtet/opt/visualization/history_viewer/_wrapped_components/dcc.py +0 -0
- {pyfemtet-1.0.0 → pyfemtet-1.0.0a0}/pyfemtet/opt/visualization/history_viewer/_wrapped_components/html.py +0 -0
- {pyfemtet-1.0.0 → pyfemtet-1.0.0a0}/pyfemtet/opt/visualization/history_viewer/_wrapped_components/str_enum.py +0 -0
- {pyfemtet-1.0.0 → pyfemtet-1.0.0a0}/pyfemtet/opt/visualization/history_viewer/result_viewer/.gitignore +0 -0
- {pyfemtet-1.0.0/pyfemtet/opt/visualization/plotter → pyfemtet-1.0.0a0/pyfemtet/opt/visualization/history_viewer/result_viewer}/__init__.py +0 -0
- {pyfemtet-1.0.0 → pyfemtet-1.0.0a0}/pyfemtet/opt/visualization/history_viewer/result_viewer/__main__.py +0 -0
- {pyfemtet-1.0.0 → pyfemtet-1.0.0a0}/pyfemtet/opt/visualization/history_viewer/result_viewer/_application.py +0 -0
- {pyfemtet-1.0.0 → pyfemtet-1.0.0a0}/pyfemtet/opt/visualization/history_viewer/result_viewer/_pages.py +0 -0
- {pyfemtet-1.0.0 → pyfemtet-1.0.0a0}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08.csv +0 -0
- {pyfemtet-1.0.0 → pyfemtet-1.0.0a0}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08.db +0 -0
- {pyfemtet-1.0.0 → pyfemtet-1.0.0a0}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8.jpg +0 -0
- {pyfemtet-1.0.0 → pyfemtet-1.0.0a0}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8.log +0 -0
- {pyfemtet-1.0.0 → pyfemtet-1.0.0a0}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8.pdt +0 -0
- {pyfemtet-1.0.0 → pyfemtet-1.0.0a0}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_1.jpg +0 -0
- {pyfemtet-1.0.0 → pyfemtet-1.0.0a0}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_1.pdt +0 -0
- {pyfemtet-1.0.0 → pyfemtet-1.0.0a0}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_10.jpg +0 -0
- {pyfemtet-1.0.0 → pyfemtet-1.0.0a0}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_10.pdt +0 -0
- {pyfemtet-1.0.0 → pyfemtet-1.0.0a0}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_11.jpg +0 -0
- {pyfemtet-1.0.0 → pyfemtet-1.0.0a0}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_11.pdt +0 -0
- {pyfemtet-1.0.0 → pyfemtet-1.0.0a0}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_12.jpg +0 -0
- {pyfemtet-1.0.0 → pyfemtet-1.0.0a0}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_12.pdt +0 -0
- {pyfemtet-1.0.0 → pyfemtet-1.0.0a0}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_13.jpg +0 -0
- {pyfemtet-1.0.0 → pyfemtet-1.0.0a0}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_13.pdt +0 -0
- {pyfemtet-1.0.0 → pyfemtet-1.0.0a0}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_14.jpg +0 -0
- {pyfemtet-1.0.0 → pyfemtet-1.0.0a0}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_14.pdt +0 -0
- {pyfemtet-1.0.0 → pyfemtet-1.0.0a0}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_15.jpg +0 -0
- {pyfemtet-1.0.0 → pyfemtet-1.0.0a0}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_15.pdt +0 -0
- {pyfemtet-1.0.0 → pyfemtet-1.0.0a0}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_16.jpg +0 -0
- {pyfemtet-1.0.0 → pyfemtet-1.0.0a0}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_16.pdt +0 -0
- {pyfemtet-1.0.0 → pyfemtet-1.0.0a0}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_17.jpg +0 -0
- {pyfemtet-1.0.0 → pyfemtet-1.0.0a0}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_17.pdt +0 -0
- {pyfemtet-1.0.0 → pyfemtet-1.0.0a0}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_18.jpg +0 -0
- {pyfemtet-1.0.0 → pyfemtet-1.0.0a0}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_18.pdt +0 -0
- {pyfemtet-1.0.0 → pyfemtet-1.0.0a0}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_19.jpg +0 -0
- {pyfemtet-1.0.0 → pyfemtet-1.0.0a0}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_19.pdt +0 -0
- {pyfemtet-1.0.0 → pyfemtet-1.0.0a0}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_2.jpg +0 -0
- {pyfemtet-1.0.0 → pyfemtet-1.0.0a0}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_2.pdt +0 -0
- {pyfemtet-1.0.0 → pyfemtet-1.0.0a0}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_20.jpg +0 -0
- {pyfemtet-1.0.0 → pyfemtet-1.0.0a0}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_20.pdt +0 -0
- {pyfemtet-1.0.0 → pyfemtet-1.0.0a0}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_3.jpg +0 -0
- {pyfemtet-1.0.0 → pyfemtet-1.0.0a0}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_3.pdt +0 -0
- {pyfemtet-1.0.0 → pyfemtet-1.0.0a0}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_4.bgr +0 -0
- {pyfemtet-1.0.0 → pyfemtet-1.0.0a0}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_4.bnd +0 -0
- {pyfemtet-1.0.0 → pyfemtet-1.0.0a0}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_4.btr +0 -0
- {pyfemtet-1.0.0 → pyfemtet-1.0.0a0}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_4.jpg +0 -0
- {pyfemtet-1.0.0 → pyfemtet-1.0.0a0}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_4.mtl +0 -0
- {pyfemtet-1.0.0 → pyfemtet-1.0.0a0}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_4.pdt +0 -0
- {pyfemtet-1.0.0 → pyfemtet-1.0.0a0}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_4.prm +0 -0
- {pyfemtet-1.0.0 → pyfemtet-1.0.0a0}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_5.jpg +0 -0
- {pyfemtet-1.0.0 → pyfemtet-1.0.0a0}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_5.pdt +0 -0
- {pyfemtet-1.0.0 → pyfemtet-1.0.0a0}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_6.jpg +0 -0
- {pyfemtet-1.0.0 → pyfemtet-1.0.0a0}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_6.pdt +0 -0
- {pyfemtet-1.0.0 → pyfemtet-1.0.0a0}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_7.jpg +0 -0
- {pyfemtet-1.0.0 → pyfemtet-1.0.0a0}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_7.pdt +0 -0
- {pyfemtet-1.0.0 → pyfemtet-1.0.0a0}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_8.jpg +0 -0
- {pyfemtet-1.0.0 → pyfemtet-1.0.0a0}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_8.pdt +0 -0
- {pyfemtet-1.0.0 → pyfemtet-1.0.0a0}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_9.jpg +0 -0
- {pyfemtet-1.0.0 → pyfemtet-1.0.0a0}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_9.pdt +0 -0
- {pyfemtet-1.0.0 → pyfemtet-1.0.0a0}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.femprj +0 -0
- {pyfemtet-1.0.0 → pyfemtet-1.0.0a0}/pyfemtet/opt/visualization/plotter/main_figure_creator.py +0 -0
- {pyfemtet-1.0.0 → pyfemtet-1.0.0a0}/pyfemtet/opt/visualization/plotter/pm_graph_creator.py +0 -0
- {pyfemtet-1.0.0 → pyfemtet-1.0.0a0}/pyfemtet/opt/wat_ex14_parametric_jp.femprj +0 -0
- {pyfemtet-1.0.0 → pyfemtet-1.0.0a0}/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.
|
|
3
|
+
Version: 1.0.0a0
|
|
4
4
|
Summary: Design parameter optimization using Femtet.
|
|
5
5
|
License: MIT
|
|
6
6
|
Author: kazuma.naito
|
|
@@ -28,8 +28,7 @@ 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 (
|
|
32
|
-
Requires-Dist: pywin32 (>=309) ; sys_platform == "win32" and python_version >= "3.13"
|
|
31
|
+
Requires-Dist: pywin32 (>=306,<311) ; sys_platform == "win32"
|
|
33
32
|
Requires-Dist: pyyaml (>=6.0.2,<7)
|
|
34
33
|
Requires-Dist: scipy (>=1.11.4,<2)
|
|
35
34
|
Requires-Dist: torch
|
|
Binary file
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
from math import isnan
|
|
2
1
|
import pandas as pd
|
|
3
2
|
|
|
4
3
|
|
|
@@ -10,24 +9,8 @@ __all__ = [
|
|
|
10
9
|
|
|
11
10
|
def get_index(df, equality_filters):
|
|
12
11
|
# フィルタ条件に一致する行のインデックスを取得
|
|
13
|
-
|
|
14
|
-
# na との == での比較は常に False なので別処理するために別リストを作る
|
|
15
|
-
want_na_keys = []
|
|
16
|
-
for key, value in equality_filters.items():
|
|
17
|
-
if isinstance(value, float):
|
|
18
|
-
if isnan(value):
|
|
19
|
-
want_na_keys.append(key)
|
|
20
|
-
[equality_filters.pop(key) for key in want_na_keys]
|
|
21
|
-
|
|
22
|
-
# na 以外の比較
|
|
23
12
|
# noinspection PyUnresolvedReferences
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
# na との比較
|
|
27
|
-
for key in want_na_keys:
|
|
28
|
-
out = out & df[key].isna()
|
|
29
|
-
|
|
30
|
-
return out
|
|
13
|
+
return (df[list(equality_filters.keys())] == pd.Series(equality_filters)).all(axis=1)
|
|
31
14
|
|
|
32
15
|
|
|
33
16
|
def get_partial_df(df: pd.DataFrame, equality_filters: dict):
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
|
|
3
3
|
from typing import Callable
|
|
4
|
-
|
|
5
|
-
import string
|
|
6
|
-
import secrets
|
|
7
4
|
import warnings
|
|
8
5
|
from time import time, sleep
|
|
9
6
|
from threading import Thread
|
|
@@ -13,7 +10,6 @@ from pyfemtet._i18n import _
|
|
|
13
10
|
__all__ = [
|
|
14
11
|
'float_',
|
|
15
12
|
'time_counting',
|
|
16
|
-
'generate_random_id',
|
|
17
13
|
]
|
|
18
14
|
|
|
19
15
|
|
|
@@ -96,8 +92,3 @@ def time_counting(
|
|
|
96
92
|
warning_message,
|
|
97
93
|
warning_fun,
|
|
98
94
|
)
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
def generate_random_id(length: int = 16) -> str:
|
|
102
|
-
alphabet = string.ascii_letters + string.digits
|
|
103
|
-
return ''.join(secrets.choice(alphabet) for _ in range(length))
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
from .femopt import FEMOpt
|
|
2
|
-
from .interface import FemtetInterface
|
|
2
|
+
from .interface import FemtetInterface
|
|
3
3
|
from .optimizer import OptunaOptimizer, ScipyOptimizer
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
__all__ = [
|
|
7
7
|
'FEMOpt',
|
|
8
8
|
'FemtetInterface',
|
|
9
|
-
'FemtetWithNXInterface',
|
|
10
|
-
'FemtetWithSolidworksInterface',
|
|
11
9
|
'OptunaOptimizer',
|
|
12
10
|
'ScipyOptimizer',
|
|
13
11
|
]
|
|
@@ -29,19 +29,6 @@ logger = get_module_logger('opt.femopt', False)
|
|
|
29
29
|
|
|
30
30
|
|
|
31
31
|
class FEMOpt:
|
|
32
|
-
"""
|
|
33
|
-
A class to manage finite element method (FEM) optimization using a specified optimizer and FEM interface.
|
|
34
|
-
|
|
35
|
-
Attributes:
|
|
36
|
-
opt (AbstractOptimizer): The optimizer instance to be used for optimization.
|
|
37
|
-
monitor_info (dict[str, str | int | None]): Dictionary to store monitoring information such as host and port.
|
|
38
|
-
|
|
39
|
-
Args:
|
|
40
|
-
fem (AbstractFEMInterface, optional): An instance of a FEM interface. Defaults to None, in which case a FemtetInterface is used.
|
|
41
|
-
opt (AbstractOptimizer, optional): An optimizer instance. Defaults to None, in which case OptunaOptimizer is used.
|
|
42
|
-
|
|
43
|
-
"""
|
|
44
|
-
|
|
45
32
|
opt: AbstractOptimizer
|
|
46
33
|
|
|
47
34
|
def __init__(
|
|
@@ -84,20 +71,16 @@ class FEMOpt:
|
|
|
84
71
|
name: str,
|
|
85
72
|
expression_string: str,
|
|
86
73
|
properties: dict[str, ...] | None = None,
|
|
87
|
-
*,
|
|
88
|
-
pass_to_fem: bool = True,
|
|
89
74
|
) -> None:
|
|
90
|
-
self.opt.add_expression_string(name, expression_string, properties
|
|
75
|
+
self.opt.add_expression_string(name, expression_string, properties)
|
|
91
76
|
|
|
92
77
|
def add_expression_sympy(
|
|
93
78
|
self,
|
|
94
79
|
name: str,
|
|
95
80
|
sympy_expr: sympy.Expr,
|
|
96
81
|
properties: dict[str, ...] | None = None,
|
|
97
|
-
*,
|
|
98
|
-
pass_to_fem: bool = True,
|
|
99
82
|
) -> None:
|
|
100
|
-
self.opt.add_expression_sympy(name, sympy_expr, properties
|
|
83
|
+
self.opt.add_expression_sympy(name, sympy_expr, properties)
|
|
101
84
|
|
|
102
85
|
def add_expression(
|
|
103
86
|
self,
|
|
@@ -106,10 +89,8 @@ class FEMOpt:
|
|
|
106
89
|
properties: dict[str, ...] | None = None,
|
|
107
90
|
args: tuple | None = None,
|
|
108
91
|
kwargs: dict | None = None,
|
|
109
|
-
*,
|
|
110
|
-
pass_to_fem: bool = True,
|
|
111
92
|
) -> None:
|
|
112
|
-
self.opt.add_expression(name, fun, properties, args, kwargs
|
|
93
|
+
self.opt.add_expression(name, fun, properties, args, kwargs)
|
|
113
94
|
|
|
114
95
|
def add_categorical_parameter(
|
|
115
96
|
self,
|
|
@@ -43,13 +43,10 @@ __all__ = [
|
|
|
43
43
|
'MAIN_FILTER',
|
|
44
44
|
]
|
|
45
45
|
|
|
46
|
-
MAIN_FILTER: dict = {
|
|
47
|
-
'sub_fidelity_name': MAIN_FIDELITY_NAME,
|
|
48
|
-
'sub_sampling': float('nan')
|
|
49
|
-
}
|
|
46
|
+
MAIN_FILTER: dict = {'sub_fidelity_name': MAIN_FIDELITY_NAME}
|
|
50
47
|
|
|
51
48
|
|
|
52
|
-
logger = get_module_logger('opt.history',
|
|
49
|
+
logger = get_module_logger('opt.history', True)
|
|
53
50
|
|
|
54
51
|
|
|
55
52
|
def create_err_msg_from_exception(e: Exception):
|
|
@@ -1056,14 +1053,6 @@ class Records:
|
|
|
1056
1053
|
|
|
1057
1054
|
with self.df_wrapper.lock_if_not_locked:
|
|
1058
1055
|
|
|
1059
|
-
# check trial_id is filled
|
|
1060
|
-
trial_processed = False
|
|
1061
|
-
if processing_df['trial_id'].notna().all():
|
|
1062
|
-
id_to_n: dict = {tid: i + 1 for i, tid
|
|
1063
|
-
in enumerate(processing_df['trial_id'].unique())}
|
|
1064
|
-
processing_df['trial'] = processing_df['trial_id'].map(id_to_n)
|
|
1065
|
-
trial_processed = True
|
|
1066
|
-
|
|
1067
1056
|
# update main fidelity
|
|
1068
1057
|
equality_filters = MAIN_FILTER
|
|
1069
1058
|
mgr = EntireDependentValuesCalculator(
|
|
@@ -1073,13 +1062,13 @@ class Records:
|
|
|
1073
1062
|
)
|
|
1074
1063
|
mgr.update_optimality()
|
|
1075
1064
|
mgr.update_hypervolume()
|
|
1076
|
-
|
|
1077
|
-
mgr.update_trial_number() # per_fidelity
|
|
1065
|
+
mgr.update_trial_number()
|
|
1078
1066
|
pdf = mgr.partial_df
|
|
1079
1067
|
apply_partial_df(df=processing_df, partial_df=pdf, equality_filters=equality_filters)
|
|
1080
1068
|
|
|
1081
1069
|
# update sub fidelity
|
|
1082
|
-
|
|
1070
|
+
entire_df = self.df_wrapper.get_df()
|
|
1071
|
+
sub_fidelity_names: list = np.unique(entire_df['sub_fidelity_name']).tolist()
|
|
1083
1072
|
if MAIN_FIDELITY_NAME in sub_fidelity_names:
|
|
1084
1073
|
sub_fidelity_names.remove(MAIN_FIDELITY_NAME)
|
|
1085
1074
|
for sub_fidelity_name in sub_fidelity_names:
|
|
@@ -1089,8 +1078,7 @@ class Records:
|
|
|
1089
1078
|
equality_filters,
|
|
1090
1079
|
processing_df
|
|
1091
1080
|
)
|
|
1092
|
-
|
|
1093
|
-
mgr.update_trial_number() # per_fidelity
|
|
1081
|
+
mgr.update_trial_number()
|
|
1094
1082
|
pdf = mgr.partial_df
|
|
1095
1083
|
apply_partial_df(df=processing_df, partial_df=pdf, equality_filters=equality_filters)
|
|
1096
1084
|
|
{pyfemtet-1.0.0 → pyfemtet-1.0.0a0}/pyfemtet/opt/interface/_femtet_interface/femtet_interface.py
RENAMED
|
@@ -4,6 +4,7 @@ from typing import TYPE_CHECKING
|
|
|
4
4
|
|
|
5
5
|
import os
|
|
6
6
|
import sys
|
|
7
|
+
import warnings
|
|
7
8
|
import subprocess
|
|
8
9
|
from time import sleep
|
|
9
10
|
from contextlib import nullcontext
|
|
@@ -102,6 +103,8 @@ class FemtetInterface(COMInterface):
|
|
|
102
103
|
If you do not want to delete the swept table,
|
|
103
104
|
make a copy of the original file.
|
|
104
105
|
|
|
106
|
+
**kwargs: Additional arguments from inherited classes.
|
|
107
|
+
|
|
105
108
|
Warning:
|
|
106
109
|
Even if you specify ``strictly_pid_specify=True`` on the constructor,
|
|
107
110
|
**the connection behavior is like** ``strictly_pid_specify=False`` **in parallel processing**
|
|
@@ -116,8 +119,6 @@ class FemtetInterface(COMInterface):
|
|
|
116
119
|
"""
|
|
117
120
|
|
|
118
121
|
com_members = {'Femtet': 'FemtetMacro.Femtet'}
|
|
119
|
-
_show_parametric_index_warning = True # for GUI
|
|
120
|
-
_femtet_connection_timeout = 10
|
|
121
122
|
|
|
122
123
|
def __init__(
|
|
123
124
|
self,
|
|
@@ -128,19 +129,14 @@ class FemtetInterface(COMInterface):
|
|
|
128
129
|
strictly_pid_specify: bool = True, # dask worker では True にしたいので super() の引数にしない。
|
|
129
130
|
allow_without_project: bool = False, # main でのみ True を許容したいので super() の引数にしない。
|
|
130
131
|
open_result_with_gui: bool = True,
|
|
132
|
+
parametric_output_indexes_use_as_objective: dict[int, str or float] = None, # TODO: Remove this
|
|
131
133
|
always_open_copy=False,
|
|
132
|
-
# ユーザーはメソッドを使うことを推奨。GUI などで使用。
|
|
133
|
-
parametric_output_indexes_use_as_objective: dict[int, str | float] = None,
|
|
134
134
|
):
|
|
135
|
+
# warning
|
|
135
136
|
if parametric_output_indexes_use_as_objective is not None:
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
'Please use `FemtetInterface.use_parametric_output_as_objective()` instead.',
|
|
140
|
-
jp_message='`parametric_output_indexes_use_as_objective` は非推奨の引数です。'
|
|
141
|
-
'代わりに `FemtetInterface.use_parametric_output_as_objective()` '
|
|
142
|
-
'を使ってください。',
|
|
143
|
-
))
|
|
137
|
+
warnings.warn(
|
|
138
|
+
"解析モデルに設定された既存のスイープテーブルは削除されます。"
|
|
139
|
+
)
|
|
144
140
|
|
|
145
141
|
# 引数の処理
|
|
146
142
|
if femprj_path is None:
|
|
@@ -259,13 +255,6 @@ class FemtetInterface(COMInterface):
|
|
|
259
255
|
None
|
|
260
256
|
|
|
261
257
|
"""
|
|
262
|
-
|
|
263
|
-
# warning
|
|
264
|
-
logger.warning(_(
|
|
265
|
-
en_message='The existing sweep table in the project will be removed.',
|
|
266
|
-
jp_message='解析モデルに設定された既存のスイープテーブルは削除されます。'
|
|
267
|
-
))
|
|
268
|
-
|
|
269
258
|
# check
|
|
270
259
|
if isinstance(direction, str):
|
|
271
260
|
if direction not in ("minimize", "maximize"):
|
|
@@ -315,9 +304,9 @@ class FemtetInterface(COMInterface):
|
|
|
315
304
|
logger.info("└ Try to connect existing Femtet process.")
|
|
316
305
|
# 既存の Femtet を探して Dispatch する。
|
|
317
306
|
if pid is None:
|
|
318
|
-
self.Femtet, self.femtet_pid = dispatch_femtet(timeout=
|
|
307
|
+
self.Femtet, self.femtet_pid = dispatch_femtet(timeout=5)
|
|
319
308
|
else:
|
|
320
|
-
self.Femtet, self.femtet_pid = dispatch_specific_femtet(pid, timeout=
|
|
309
|
+
self.Femtet, self.femtet_pid = dispatch_specific_femtet(pid, timeout=5)
|
|
321
310
|
self.connected_method = "existing"
|
|
322
311
|
|
|
323
312
|
def connect_femtet(self, connect_method: str = "auto", pid: int or None = None):
|
|
@@ -515,8 +504,6 @@ class FemtetInterface(COMInterface):
|
|
|
515
504
|
name = fun.__name__
|
|
516
505
|
if fun.__name__ == 'Solve':
|
|
517
506
|
context = nullcontext()
|
|
518
|
-
elif fun.__name__ == 'solve_via_parametric_dll':
|
|
519
|
-
context = nullcontext()
|
|
520
507
|
|
|
521
508
|
elif isinstance(fun, str):
|
|
522
509
|
|
|
@@ -538,7 +525,7 @@ class FemtetInterface(COMInterface):
|
|
|
538
525
|
'If the optimization is hanging, the most reason is '
|
|
539
526
|
'a dialog is opening in Femtet and it waits for your '
|
|
540
527
|
'input. Please confirm there is no dialog in Femtet.',
|
|
541
|
-
'{name} の実行に {warning_time_sec}
|
|
528
|
+
'{name} の実行に {warning_time_sec} 以上かかっています。'
|
|
542
529
|
'もし最適化がハングしているならば、考えられる理由として、'
|
|
543
530
|
'Femtet で予期せずダイアログが開いてユーザーの入力待ちをしている場合があります。'
|
|
544
531
|
'もし 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
|
|
159
|
+
parametric_output_indexes_use_as_objective: dict[int, str or float] = None, # TODO: Remove this
|
|
160
160
|
always_open_copy=False,
|
|
161
161
|
export_curves: bool or None = None,
|
|
162
162
|
export_surfaces: bool or None = None,
|
|
@@ -20,26 +20,6 @@ if TYPE_CHECKING:
|
|
|
20
20
|
|
|
21
21
|
|
|
22
22
|
class FemtetWithSolidworksInterface(FemtetInterface, SolidworksInterface, AbstractFEMInterface):
|
|
23
|
-
"""
|
|
24
|
-
Interface class integrating Femtet and SolidWorks operations.
|
|
25
|
-
|
|
26
|
-
This class combines the capabilities of both Femtet and SolidWorks interfaces, allowing
|
|
27
|
-
coordinated operation between simulation (Femtet) and CAD manipulation (SolidWorks).
|
|
28
|
-
|
|
29
|
-
Args:
|
|
30
|
-
sldprt_path (str): Path to the SolidWorks part file (.sldprt).
|
|
31
|
-
femprj_path (str, optional): Path to the Femtet project file (.femprj). Defaults to None.
|
|
32
|
-
model_name (str, optional): Name of the model in the project. Defaults to None.
|
|
33
|
-
connect_method (str, optional): Connection method for Femtet. Defaults to "auto".
|
|
34
|
-
save_pdt (str, optional): Specifies which data to save. Defaults to "all".
|
|
35
|
-
strictly_pid_specify (bool, optional): Whether to strictly specify parameter IDs. Defaults to True.
|
|
36
|
-
allow_without_project (bool, optional): If True, allows operation without a project file. Defaults to False.
|
|
37
|
-
open_result_with_gui (bool, optional): If True, open results with GUI. Defaults to True.
|
|
38
|
-
parametric_output_indexes_use_as_objective (dict[int, str | float], optional): Indexes for parametric output used as objectives. Defaults to None.
|
|
39
|
-
always_open_copy (bool, optional): If True, always open a copy of the project. Defaults to False.
|
|
40
|
-
close_solidworks_on_terminate (bool, optional): If True, SolidWorks will close when this object is destroyed. Defaults to False.
|
|
41
|
-
solidworks_visible (bool, optional): If True, SolidWorks will be started in visible mode. Defaults to True.
|
|
42
|
-
"""
|
|
43
23
|
|
|
44
24
|
def __init__(
|
|
45
25
|
self,
|
|
@@ -51,7 +31,7 @@ class FemtetWithSolidworksInterface(FemtetInterface, SolidworksInterface, Abstra
|
|
|
51
31
|
strictly_pid_specify: bool = True,
|
|
52
32
|
allow_without_project: bool = False,
|
|
53
33
|
open_result_with_gui: bool = True,
|
|
54
|
-
parametric_output_indexes_use_as_objective: dict[int, str
|
|
34
|
+
parametric_output_indexes_use_as_objective: dict[int, str or float] = None,
|
|
55
35
|
always_open_copy=False,
|
|
56
36
|
close_solidworks_on_terminate=False,
|
|
57
37
|
solidworks_visible=True,
|
|
@@ -41,27 +41,6 @@ class FileNotOpenedError(Exception):
|
|
|
41
41
|
|
|
42
42
|
# noinspection PyPep8Naming
|
|
43
43
|
class SolidworksInterface(COMInterface):
|
|
44
|
-
"""
|
|
45
|
-
Interface class for interacting with SolidWorks through COM automation.
|
|
46
|
-
|
|
47
|
-
This class manages the connection and interaction with SolidWorks using its COM interface.
|
|
48
|
-
It handles initialization, visibility, and clean termination of the SolidWorks application.
|
|
49
|
-
|
|
50
|
-
Attributes:
|
|
51
|
-
swApp (CDispatch): The COM dispatch object for SolidWorks application.
|
|
52
|
-
com_members (dict): Mapping of COM member names to their interface strings.
|
|
53
|
-
sldprt_path (str): Absolute path to the SolidWorks part file (.sldprt).
|
|
54
|
-
quit_solidworks_on_terminate (bool): Whether to close SolidWorks upon object destruction.
|
|
55
|
-
solidworks_visible (bool): Whether the SolidWorks application window is visible.
|
|
56
|
-
|
|
57
|
-
Args:
|
|
58
|
-
sldprt_path (str): Path to the SolidWorks part file (.sldprt).
|
|
59
|
-
close_solidworks_on_terminate (bool, optional): If True, SolidWorks will close when this object is destroyed. Defaults to False.
|
|
60
|
-
visible (bool, optional): If True, SolidWorks will be started in visible mode. Defaults to True.
|
|
61
|
-
|
|
62
|
-
Raises:
|
|
63
|
-
AssertionError: If the specified part file does not exist.
|
|
64
|
-
"""
|
|
65
44
|
|
|
66
45
|
swApp: CDispatch
|
|
67
46
|
com_members = {'swApp': 'SLDWORKS.Application'}
|
pyfemtet-1.0.0a0/pyfemtet/opt/interface/_surrogate_model_interface/base_surrogate_interface.py
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
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}.')
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
from typing import Sequence
|
|
2
|
-
|
|
3
1
|
import numpy as np
|
|
4
2
|
from scipy.stats.distributions import norm
|
|
5
3
|
|
|
@@ -26,22 +24,8 @@ __all__ = [
|
|
|
26
24
|
|
|
27
25
|
class BoTorchInterface(AbstractSurrogateModelInterfaceBase):
|
|
28
26
|
|
|
29
|
-
def __init__(
|
|
30
|
-
|
|
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
|
-
)
|
|
27
|
+
def __init__(self, history_path: str = None, train_history: History = None):
|
|
28
|
+
AbstractSurrogateModelInterfaceBase.__init__(self, history_path, train_history)
|
|
45
29
|
|
|
46
30
|
self.model = SingleTaskGPModel()
|
|
47
31
|
self.pyfemtet_model = PyFemtetModel()
|
|
@@ -78,22 +62,11 @@ class PoFBoTorchInterface(BoTorchInterface, AbstractSurrogateModelInterfaceBase)
|
|
|
78
62
|
def __init__(
|
|
79
63
|
self,
|
|
80
64
|
history_path: str,
|
|
81
|
-
train_history: History = None,
|
|
82
65
|
observation_noise: float | str | None = None,
|
|
83
66
|
feasibility_noise: float | str | None = None,
|
|
84
67
|
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
|
|
90
68
|
):
|
|
91
|
-
AbstractSurrogateModelInterfaceBase.__init__(
|
|
92
|
-
self,
|
|
93
|
-
history_path,
|
|
94
|
-
train_history,
|
|
95
|
-
_output_directions
|
|
96
|
-
)
|
|
69
|
+
AbstractSurrogateModelInterfaceBase.__init__(self, history_path, None)
|
|
97
70
|
|
|
98
71
|
self.model = SingleTaskGPModel()
|
|
99
72
|
self.pyfemtet_model = PyFemtetModel()
|