pyfemtet 1.0.8__tar.gz → 1.0.10__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of pyfemtet might be problematic. Click here for more details.
- {pyfemtet-1.0.8 → pyfemtet-1.0.10}/PKG-INFO +1 -1
- {pyfemtet-1.0.8 → pyfemtet-1.0.10}/pyfemtet/opt/femopt.py +9 -6
- {pyfemtet-1.0.8 → pyfemtet-1.0.10}/pyfemtet/opt/history/_history.py +34 -16
- {pyfemtet-1.0.8 → pyfemtet-1.0.10}/pyfemtet/opt/interface/__init__.py +18 -12
- pyfemtet-1.0.10/pyfemtet/opt/interface/_dummy_classes.py +18 -0
- {pyfemtet-1.0.8 → pyfemtet-1.0.10}/pyfemtet/opt/interface/_femtet_interface/femtet_interface.py +32 -10
- {pyfemtet-1.0.8 → pyfemtet-1.0.10}/pyfemtet/opt/interface/_surrogate_model_interface/base_surrogate_interface.py +2 -0
- {pyfemtet-1.0.8 → pyfemtet-1.0.10}/pyfemtet/opt/optimizer/_base_optimizer.py +2 -2
- {pyfemtet-1.0.8 → pyfemtet-1.0.10}/pyfemtet/opt/optimizer/optuna_optimizer/_optuna_optimizer.py +2 -2
- {pyfemtet-1.0.8 → pyfemtet-1.0.10}/pyfemtet/opt/prediction/_helper.py +35 -8
- {pyfemtet-1.0.8 → pyfemtet-1.0.10}/pyfemtet/opt/prediction/_model.py +1 -0
- {pyfemtet-1.0.8 → pyfemtet-1.0.10}/pyfemtet/opt/visualization/history_viewer/_complex_components/alert_region.py +3 -4
- {pyfemtet-1.0.8 → pyfemtet-1.0.10}/pyfemtet/opt/visualization/history_viewer/_complex_components/pm_graph.py +82 -9
- pyfemtet-1.0.10/pyfemtet/opt/visualization/history_viewer/_helper.py +28 -0
- {pyfemtet-1.0.8 → pyfemtet-1.0.10}/pyfemtet/opt/visualization/history_viewer/result_viewer/_pages.py +8 -8
- {pyfemtet-1.0.8 → pyfemtet-1.0.10}/pyfemtet/opt/visualization/plotter/pm_graph_creator.py +5 -2
- {pyfemtet-1.0.8 → pyfemtet-1.0.10}/pyproject.toml +1 -1
- {pyfemtet-1.0.8 → pyfemtet-1.0.10}/LICENSE +0 -0
- {pyfemtet-1.0.8 → pyfemtet-1.0.10}/LICENSE_THIRD_PARTY.txt +0 -0
- {pyfemtet-1.0.8 → pyfemtet-1.0.10}/README.md +0 -0
- {pyfemtet-1.0.8 → pyfemtet-1.0.10}/pyfemtet/__init__.py +0 -0
- {pyfemtet-1.0.8 → pyfemtet-1.0.10}/pyfemtet/_i18n/1. make_pot_and_update_po.bat +0 -0
- {pyfemtet-1.0.8 → pyfemtet-1.0.10}/pyfemtet/_i18n/2. build_mo.bat +0 -0
- {pyfemtet-1.0.8 → pyfemtet-1.0.10}/pyfemtet/_i18n/__init__.py +0 -0
- {pyfemtet-1.0.8 → pyfemtet-1.0.10}/pyfemtet/_i18n/babel.cfg +0 -0
- {pyfemtet-1.0.8 → pyfemtet-1.0.10}/pyfemtet/_i18n/i18n.py +0 -0
- {pyfemtet-1.0.8 → pyfemtet-1.0.10}/pyfemtet/_i18n/locales/ja/LC_MESSAGES/messages.mo +0 -0
- {pyfemtet-1.0.8 → pyfemtet-1.0.10}/pyfemtet/_i18n/locales/ja/LC_MESSAGES/messages.po +0 -0
- {pyfemtet-1.0.8 → pyfemtet-1.0.10}/pyfemtet/_i18n/locales/messages.pot +0 -0
- {pyfemtet-1.0.8 → pyfemtet-1.0.10}/pyfemtet/_i18n/messages.py +0 -0
- {pyfemtet-1.0.8 → pyfemtet-1.0.10}/pyfemtet/_util/__init__.py +0 -0
- {pyfemtet-1.0.8 → pyfemtet-1.0.10}/pyfemtet/_util/closing.py +0 -0
- {pyfemtet-1.0.8 → pyfemtet-1.0.10}/pyfemtet/_util/dask_util.py +0 -0
- {pyfemtet-1.0.8 → pyfemtet-1.0.10}/pyfemtet/_util/df_util.py +0 -0
- {pyfemtet-1.0.8 → pyfemtet-1.0.10}/pyfemtet/_util/excel_macro_util.py +0 -0
- {pyfemtet-1.0.8 → pyfemtet-1.0.10}/pyfemtet/_util/excel_parse_util.py +0 -0
- {pyfemtet-1.0.8 → pyfemtet-1.0.10}/pyfemtet/_util/femtet_access_inspection.py +0 -0
- {pyfemtet-1.0.8 → pyfemtet-1.0.10}/pyfemtet/_util/femtet_autosave.py +0 -0
- {pyfemtet-1.0.8 → pyfemtet-1.0.10}/pyfemtet/_util/femtet_exit.py +0 -0
- {pyfemtet-1.0.8 → pyfemtet-1.0.10}/pyfemtet/_util/femtet_version.py +0 -0
- {pyfemtet-1.0.8 → pyfemtet-1.0.10}/pyfemtet/_util/helper.py +0 -0
- {pyfemtet-1.0.8 → pyfemtet-1.0.10}/pyfemtet/_util/process_util.py +0 -0
- {pyfemtet-1.0.8 → pyfemtet-1.0.10}/pyfemtet/_util/sample.xlsx +0 -0
- {pyfemtet-1.0.8 → pyfemtet-1.0.10}/pyfemtet/_util/str_enum.py +0 -0
- {pyfemtet-1.0.8 → pyfemtet-1.0.10}/pyfemtet/core.py +0 -0
- {pyfemtet-1.0.8 → pyfemtet-1.0.10}/pyfemtet/dispatch_extensions/__init__.py +0 -0
- {pyfemtet-1.0.8 → pyfemtet-1.0.10}/pyfemtet/dispatch_extensions/_impl.py +0 -0
- {pyfemtet-1.0.8 → pyfemtet-1.0.10}/pyfemtet/logger/__init__.py +0 -0
- {pyfemtet-1.0.8 → pyfemtet-1.0.10}/pyfemtet/logger/_impl.py +0 -0
- {pyfemtet-1.0.8 → pyfemtet-1.0.10}/pyfemtet/opt/__init__.py +0 -0
- {pyfemtet-1.0.8 → pyfemtet-1.0.10}/pyfemtet/opt/exceptions.py +0 -0
- {pyfemtet-1.0.8 → pyfemtet-1.0.10}/pyfemtet/opt/history/__init__.py +0 -0
- {pyfemtet-1.0.8 → pyfemtet-1.0.10}/pyfemtet/opt/history/_hypervolume.py +0 -0
- {pyfemtet-1.0.8 → pyfemtet-1.0.10}/pyfemtet/opt/history/_optimality.py +0 -0
- {pyfemtet-1.0.8 → pyfemtet-1.0.10}/pyfemtet/opt/interface/_base_interface.py +0 -0
- {pyfemtet-1.0.8 → pyfemtet-1.0.10}/pyfemtet/opt/interface/_excel_interface/__init__.py +0 -0
- {pyfemtet-1.0.8 → pyfemtet-1.0.10}/pyfemtet/opt/interface/_excel_interface/debug-excel-interface.xlsm +0 -0
- {pyfemtet-1.0.8 → pyfemtet-1.0.10}/pyfemtet/opt/interface/_excel_interface/excel_interface.py +0 -0
- {pyfemtet-1.0.8 → pyfemtet-1.0.10}/pyfemtet/opt/interface/_femtet_interface/__init__.py +0 -0
- {pyfemtet-1.0.8 → pyfemtet-1.0.10}/pyfemtet/opt/interface/_femtet_interface/_femtet_parametric.py +0 -0
- {pyfemtet-1.0.8 → pyfemtet-1.0.10}/pyfemtet/opt/interface/_femtet_with_nx_interface/__init__.py +0 -0
- {pyfemtet-1.0.8 → pyfemtet-1.0.10}/pyfemtet/opt/interface/_femtet_with_nx_interface/femtet_with_nx_interface.py +0 -0
- {pyfemtet-1.0.8 → pyfemtet-1.0.10}/pyfemtet/opt/interface/_femtet_with_nx_interface/model1.prt +0 -0
- {pyfemtet-1.0.8 → pyfemtet-1.0.10}/pyfemtet/opt/interface/_femtet_with_nx_interface/model1.x_t +0 -0
- {pyfemtet-1.0.8 → pyfemtet-1.0.10}/pyfemtet/opt/interface/_femtet_with_nx_interface/update_model.py +0 -0
- {pyfemtet-1.0.8 → pyfemtet-1.0.10}/pyfemtet/opt/interface/_femtet_with_solidworks/__init__.py +0 -0
- {pyfemtet-1.0.8 → pyfemtet-1.0.10}/pyfemtet/opt/interface/_femtet_with_solidworks/femtet_with_solidworks_interface.py +0 -0
- {pyfemtet-1.0.8 → pyfemtet-1.0.10}/pyfemtet/opt/interface/_solidworks_interface/__init__.py +0 -0
- {pyfemtet-1.0.8 → pyfemtet-1.0.10}/pyfemtet/opt/interface/_solidworks_interface/solidworks_interface.py +0 -0
- {pyfemtet-1.0.8 → pyfemtet-1.0.10}/pyfemtet/opt/interface/_surrogate_model_interface/__init__.py +0 -0
- {pyfemtet-1.0.8 → pyfemtet-1.0.10}/pyfemtet/opt/interface/_surrogate_model_interface/botorch_interface.py +0 -0
- {pyfemtet-1.0.8 → pyfemtet-1.0.10}/pyfemtet/opt/interface/_surrogate_model_interface/debug-pof-botorch.reccsv +0 -0
- {pyfemtet-1.0.8 → pyfemtet-1.0.10}/pyfemtet/opt/interface/_with_excel_settings/__init__.py +0 -0
- {pyfemtet-1.0.8 → pyfemtet-1.0.10}/pyfemtet/opt/interface/_with_excel_settings/with_excel_settings.py +0 -0
- {pyfemtet-1.0.8 → pyfemtet-1.0.10}/pyfemtet/opt/meta_script/YAML_Generator.xlsm +0 -0
- {pyfemtet-1.0.8 → pyfemtet-1.0.10}/pyfemtet/opt/meta_script/__init__.py +0 -0
- {pyfemtet-1.0.8 → pyfemtet-1.0.10}/pyfemtet/opt/meta_script/__main__.py +0 -0
- {pyfemtet-1.0.8 → pyfemtet-1.0.10}/pyfemtet/opt/meta_script/sample/sample.bas +0 -0
- {pyfemtet-1.0.8 → pyfemtet-1.0.10}/pyfemtet/opt/meta_script/sample/sample.femprj +0 -0
- {pyfemtet-1.0.8 → pyfemtet-1.0.10}/pyfemtet/opt/optimizer/__init__.py +0 -0
- {pyfemtet-1.0.8 → pyfemtet-1.0.10}/pyfemtet/opt/optimizer/optuna_optimizer/__init__.py +0 -0
- {pyfemtet-1.0.8 → pyfemtet-1.0.10}/pyfemtet/opt/optimizer/optuna_optimizer/_optuna_attribute.py +0 -0
- {pyfemtet-1.0.8 → pyfemtet-1.0.10}/pyfemtet/opt/optimizer/optuna_optimizer/_pof_botorch/__init__.py +0 -0
- {pyfemtet-1.0.8 → pyfemtet-1.0.10}/pyfemtet/opt/optimizer/optuna_optimizer/_pof_botorch/debug-pof-botorch.reccsv +0 -0
- {pyfemtet-1.0.8 → pyfemtet-1.0.10}/pyfemtet/opt/optimizer/optuna_optimizer/_pof_botorch/enable_nonlinear_constraint.py +0 -0
- {pyfemtet-1.0.8 → pyfemtet-1.0.10}/pyfemtet/opt/optimizer/optuna_optimizer/_pof_botorch/pof_botorch_sampler.py +0 -0
- {pyfemtet-1.0.8 → pyfemtet-1.0.10}/pyfemtet/opt/optimizer/optuna_optimizer/wat_ex14_parametric_jp.femprj +0 -0
- {pyfemtet-1.0.8 → pyfemtet-1.0.10}/pyfemtet/opt/optimizer/scipy_optimizer/__init__.py +0 -0
- {pyfemtet-1.0.8 → pyfemtet-1.0.10}/pyfemtet/opt/optimizer/scipy_optimizer/_scipy_optimizer.py +0 -0
- {pyfemtet-1.0.8 → pyfemtet-1.0.10}/pyfemtet/opt/prediction/__init__.py +0 -0
- {pyfemtet-1.0.8 → pyfemtet-1.0.10}/pyfemtet/opt/prediction/_botorch_utils.py +0 -0
- {pyfemtet-1.0.8 → pyfemtet-1.0.10}/pyfemtet/opt/prediction/_gpytorch_modules_extension.py +0 -0
- {pyfemtet-1.0.8 → pyfemtet-1.0.10}/pyfemtet/opt/problem/__init__.py +0 -0
- {pyfemtet-1.0.8 → pyfemtet-1.0.10}/pyfemtet/opt/problem/problem.py +0 -0
- {pyfemtet-1.0.8 → pyfemtet-1.0.10}/pyfemtet/opt/problem/variable_manager/__init__.py +0 -0
- {pyfemtet-1.0.8 → pyfemtet-1.0.10}/pyfemtet/opt/problem/variable_manager/_string_as_expression.py +0 -0
- {pyfemtet-1.0.8 → pyfemtet-1.0.10}/pyfemtet/opt/problem/variable_manager/_variable_manager.py +0 -0
- {pyfemtet-1.0.8 → pyfemtet-1.0.10}/pyfemtet/opt/visualization/__init__.py +0 -0
- {pyfemtet-1.0.8 → pyfemtet-1.0.10}/pyfemtet/opt/visualization/_create_wrapped_components.py +0 -0
- {pyfemtet-1.0.8 → pyfemtet-1.0.10}/pyfemtet/opt/visualization/history_viewer/__init__.py +0 -0
- {pyfemtet-1.0.8 → pyfemtet-1.0.10}/pyfemtet/opt/visualization/history_viewer/__main__.py +0 -0
- {pyfemtet-1.0.8 → pyfemtet-1.0.10}/pyfemtet/opt/visualization/history_viewer/_base_application.py +0 -0
- {pyfemtet-1.0.8 → pyfemtet-1.0.10}/pyfemtet/opt/visualization/history_viewer/_common_pages.py +0 -0
- {pyfemtet-1.0.8 → pyfemtet-1.0.10}/pyfemtet/opt/visualization/history_viewer/_complex_components/__init__.py +0 -0
- {pyfemtet-1.0.8 → pyfemtet-1.0.10}/pyfemtet/opt/visualization/history_viewer/_complex_components/control_femtet.py +0 -0
- {pyfemtet-1.0.8 → pyfemtet-1.0.10}/pyfemtet/opt/visualization/history_viewer/_complex_components/detail_graphs.py +0 -0
- {pyfemtet-1.0.8 → pyfemtet-1.0.10}/pyfemtet/opt/visualization/history_viewer/_complex_components/main_graph.py +0 -0
- {pyfemtet-1.0.8 → pyfemtet-1.0.10}/pyfemtet/opt/visualization/history_viewer/_detail_page.py +0 -0
- {pyfemtet-1.0.8 → pyfemtet-1.0.10}/pyfemtet/opt/visualization/history_viewer/_process_monitor/__init__.py +0 -0
- {pyfemtet-1.0.8 → pyfemtet-1.0.10}/pyfemtet/opt/visualization/history_viewer/_process_monitor/_application.py +0 -0
- {pyfemtet-1.0.8 → pyfemtet-1.0.10}/pyfemtet/opt/visualization/history_viewer/_process_monitor/_pages.py +0 -0
- {pyfemtet-1.0.8 → pyfemtet-1.0.10}/pyfemtet/opt/visualization/history_viewer/_wrapped_components/__init__.py +0 -0
- {pyfemtet-1.0.8 → pyfemtet-1.0.10}/pyfemtet/opt/visualization/history_viewer/_wrapped_components/dbc.py +0 -0
- {pyfemtet-1.0.8 → pyfemtet-1.0.10}/pyfemtet/opt/visualization/history_viewer/_wrapped_components/dcc.py +0 -0
- {pyfemtet-1.0.8 → pyfemtet-1.0.10}/pyfemtet/opt/visualization/history_viewer/_wrapped_components/html.py +0 -0
- {pyfemtet-1.0.8 → pyfemtet-1.0.10}/pyfemtet/opt/visualization/history_viewer/_wrapped_components/str_enum.py +0 -0
- {pyfemtet-1.0.8 → pyfemtet-1.0.10}/pyfemtet/opt/visualization/history_viewer/result_viewer/.gitignore +0 -0
- {pyfemtet-1.0.8 → pyfemtet-1.0.10}/pyfemtet/opt/visualization/history_viewer/result_viewer/__init__.py +0 -0
- {pyfemtet-1.0.8 → pyfemtet-1.0.10}/pyfemtet/opt/visualization/history_viewer/result_viewer/__main__.py +0 -0
- {pyfemtet-1.0.8 → pyfemtet-1.0.10}/pyfemtet/opt/visualization/history_viewer/result_viewer/_application.py +0 -0
- {pyfemtet-1.0.8 → pyfemtet-1.0.10}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08.csv +0 -0
- {pyfemtet-1.0.8 → pyfemtet-1.0.10}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08.db +0 -0
- {pyfemtet-1.0.8 → pyfemtet-1.0.10}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8.jpg +0 -0
- {pyfemtet-1.0.8 → pyfemtet-1.0.10}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8.log +0 -0
- {pyfemtet-1.0.8 → pyfemtet-1.0.10}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8.pdt +0 -0
- {pyfemtet-1.0.8 → pyfemtet-1.0.10}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_1.jpg +0 -0
- {pyfemtet-1.0.8 → pyfemtet-1.0.10}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_1.pdt +0 -0
- {pyfemtet-1.0.8 → pyfemtet-1.0.10}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_10.jpg +0 -0
- {pyfemtet-1.0.8 → pyfemtet-1.0.10}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_10.pdt +0 -0
- {pyfemtet-1.0.8 → pyfemtet-1.0.10}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_11.jpg +0 -0
- {pyfemtet-1.0.8 → pyfemtet-1.0.10}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_11.pdt +0 -0
- {pyfemtet-1.0.8 → pyfemtet-1.0.10}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_12.jpg +0 -0
- {pyfemtet-1.0.8 → pyfemtet-1.0.10}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_12.pdt +0 -0
- {pyfemtet-1.0.8 → pyfemtet-1.0.10}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_13.jpg +0 -0
- {pyfemtet-1.0.8 → pyfemtet-1.0.10}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_13.pdt +0 -0
- {pyfemtet-1.0.8 → pyfemtet-1.0.10}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_14.jpg +0 -0
- {pyfemtet-1.0.8 → pyfemtet-1.0.10}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_14.pdt +0 -0
- {pyfemtet-1.0.8 → pyfemtet-1.0.10}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_15.jpg +0 -0
- {pyfemtet-1.0.8 → pyfemtet-1.0.10}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_15.pdt +0 -0
- {pyfemtet-1.0.8 → pyfemtet-1.0.10}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_16.jpg +0 -0
- {pyfemtet-1.0.8 → pyfemtet-1.0.10}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_16.pdt +0 -0
- {pyfemtet-1.0.8 → pyfemtet-1.0.10}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_17.jpg +0 -0
- {pyfemtet-1.0.8 → pyfemtet-1.0.10}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_17.pdt +0 -0
- {pyfemtet-1.0.8 → pyfemtet-1.0.10}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_18.jpg +0 -0
- {pyfemtet-1.0.8 → pyfemtet-1.0.10}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_18.pdt +0 -0
- {pyfemtet-1.0.8 → pyfemtet-1.0.10}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_19.jpg +0 -0
- {pyfemtet-1.0.8 → pyfemtet-1.0.10}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_19.pdt +0 -0
- {pyfemtet-1.0.8 → pyfemtet-1.0.10}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_2.jpg +0 -0
- {pyfemtet-1.0.8 → pyfemtet-1.0.10}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_2.pdt +0 -0
- {pyfemtet-1.0.8 → pyfemtet-1.0.10}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_20.jpg +0 -0
- {pyfemtet-1.0.8 → pyfemtet-1.0.10}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_20.pdt +0 -0
- {pyfemtet-1.0.8 → pyfemtet-1.0.10}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_3.jpg +0 -0
- {pyfemtet-1.0.8 → pyfemtet-1.0.10}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_3.pdt +0 -0
- {pyfemtet-1.0.8 → pyfemtet-1.0.10}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_4.bgr +0 -0
- {pyfemtet-1.0.8 → pyfemtet-1.0.10}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_4.bnd +0 -0
- {pyfemtet-1.0.8 → pyfemtet-1.0.10}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_4.btr +0 -0
- {pyfemtet-1.0.8 → pyfemtet-1.0.10}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_4.jpg +0 -0
- {pyfemtet-1.0.8 → pyfemtet-1.0.10}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_4.mtl +0 -0
- {pyfemtet-1.0.8 → pyfemtet-1.0.10}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_4.pdt +0 -0
- {pyfemtet-1.0.8 → pyfemtet-1.0.10}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_4.prm +0 -0
- {pyfemtet-1.0.8 → pyfemtet-1.0.10}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_5.jpg +0 -0
- {pyfemtet-1.0.8 → pyfemtet-1.0.10}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_5.pdt +0 -0
- {pyfemtet-1.0.8 → pyfemtet-1.0.10}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_6.jpg +0 -0
- {pyfemtet-1.0.8 → pyfemtet-1.0.10}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_6.pdt +0 -0
- {pyfemtet-1.0.8 → pyfemtet-1.0.10}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_7.jpg +0 -0
- {pyfemtet-1.0.8 → pyfemtet-1.0.10}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_7.pdt +0 -0
- {pyfemtet-1.0.8 → pyfemtet-1.0.10}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_8.jpg +0 -0
- {pyfemtet-1.0.8 → pyfemtet-1.0.10}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_8.pdt +0 -0
- {pyfemtet-1.0.8 → pyfemtet-1.0.10}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_9.jpg +0 -0
- {pyfemtet-1.0.8 → pyfemtet-1.0.10}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_9.pdt +0 -0
- {pyfemtet-1.0.8 → pyfemtet-1.0.10}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.femprj +0 -0
- {pyfemtet-1.0.8 → pyfemtet-1.0.10}/pyfemtet/opt/visualization/plotter/__init__.py +0 -0
- {pyfemtet-1.0.8 → pyfemtet-1.0.10}/pyfemtet/opt/visualization/plotter/contour_creator.py +0 -0
- {pyfemtet-1.0.8 → pyfemtet-1.0.10}/pyfemtet/opt/visualization/plotter/main_figure_creator.py +0 -0
- {pyfemtet-1.0.8 → pyfemtet-1.0.10}/pyfemtet/opt/visualization/plotter/parallel_plot_creator.py +0 -0
- {pyfemtet-1.0.8 → pyfemtet-1.0.10}/pyfemtet/opt/wat_ex14_parametric_jp.femprj +0 -0
- {pyfemtet-1.0.8 → pyfemtet-1.0.10}/pyfemtet/opt/worker_status.py +0 -0
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
import platform
|
|
2
4
|
from typing import Callable, Sequence
|
|
3
5
|
|
|
4
6
|
import os
|
|
@@ -114,8 +116,8 @@ class FEMOpt:
|
|
|
114
116
|
def add_categorical_parameter(
|
|
115
117
|
self,
|
|
116
118
|
name: str,
|
|
117
|
-
initial_value:
|
|
118
|
-
choices: list[
|
|
119
|
+
initial_value: SupportedVariableTypes | None = None,
|
|
120
|
+
choices: list[SupportedVariableTypes] | None = None,
|
|
119
121
|
properties: dict[str, ...] | None = None,
|
|
120
122
|
*,
|
|
121
123
|
pass_to_fem: bool = True,
|
|
@@ -464,21 +466,22 @@ class FEMOpt:
|
|
|
464
466
|
'using the result viewer.\n'
|
|
465
467
|
'The result viewer can be launched by '
|
|
466
468
|
'performing one of the following actions:\n'
|
|
467
|
-
'-
|
|
469
|
+
'- {windows_only}Launch the `pyfemtet-opt-result-viewer` '
|
|
468
470
|
'shortcut on your desktop if exists.\n'
|
|
469
|
-
'-
|
|
471
|
+
'- {windows_only}Launch {path}.\n'
|
|
470
472
|
'- Execute "py -m pyfemtet.opt.visualization.history_viewer" '
|
|
471
473
|
'in the command line',
|
|
472
474
|
jp_message='プログラム終了後も、結果ビューワを使って最適化結果を'
|
|
473
475
|
'確認することができます。'
|
|
474
476
|
'結果ビューワは以下のいずれかを実施すると起動できます。\n'
|
|
475
|
-
'-
|
|
477
|
+
'- {windows_only}デスクトップの pyfemtet-opt-result-viewer '
|
|
476
478
|
'ショートカットを起動する\n'
|
|
477
|
-
'-
|
|
479
|
+
'- {windows_only}{dir} にある {filename} を起動する\n'
|
|
478
480
|
'- コマンドラインで「py -m pyfemtet.opt.visualization.history_viewer」'
|
|
479
481
|
'を実行する',
|
|
480
482
|
dir=os.path.abspath(os.path.dirname(sys.executable)),
|
|
481
483
|
filename='pyfemtet-opt-result-viewer.exe (or .cmd)',
|
|
484
|
+
windows_only='(Windows only) ' if platform.system() != 'Windows' else '',
|
|
482
485
|
)
|
|
483
486
|
print("====================")
|
|
484
487
|
print(confirm_msg)
|
|
@@ -53,6 +53,11 @@ MAIN_FILTER: dict = {
|
|
|
53
53
|
logger = get_module_logger('opt.history', False)
|
|
54
54
|
|
|
55
55
|
|
|
56
|
+
class MetaColumnNames(StrEnum):
|
|
57
|
+
prm_num_value = 'prm.num.value'
|
|
58
|
+
prm_cat_value = 'prm.cat.value'
|
|
59
|
+
|
|
60
|
+
|
|
56
61
|
def create_err_msg_from_exception(e: Exception):
|
|
57
62
|
""":meta private:"""
|
|
58
63
|
additional = ' '.join(map(str, e.args))
|
|
@@ -403,7 +408,7 @@ class ColumnManager:
|
|
|
403
408
|
if isinstance(param, NumericParameter):
|
|
404
409
|
# important
|
|
405
410
|
column_dtypes.update({prm_name: float})
|
|
406
|
-
meta_columns.append(
|
|
411
|
+
meta_columns.append(MetaColumnNames.prm_num_value.value)
|
|
407
412
|
|
|
408
413
|
# later
|
|
409
414
|
f = CorrespondingColumnNameRuler.prm_lower_bound_name
|
|
@@ -421,7 +426,7 @@ class ColumnManager:
|
|
|
421
426
|
elif isinstance(param, CategoricalParameter):
|
|
422
427
|
# important
|
|
423
428
|
column_dtypes.update({prm_name: object})
|
|
424
|
-
meta_columns.append(
|
|
429
|
+
meta_columns.append(MetaColumnNames.prm_cat_value.value)
|
|
425
430
|
|
|
426
431
|
# later
|
|
427
432
|
f = CorrespondingColumnNameRuler.prm_choices_name
|
|
@@ -598,24 +603,26 @@ class ColumnManager:
|
|
|
598
603
|
return self.filter_columns('other_output')
|
|
599
604
|
|
|
600
605
|
@staticmethod
|
|
601
|
-
def _is_numerical_parameter(prm_name, columns):
|
|
602
|
-
|
|
603
|
-
|
|
606
|
+
def _is_numerical_parameter(prm_name, columns, meta_columns):
|
|
607
|
+
col_index = tuple(columns).index(prm_name)
|
|
608
|
+
meta_column = meta_columns[col_index]
|
|
609
|
+
return meta_column == MetaColumnNames.prm_num_value
|
|
604
610
|
|
|
605
611
|
@staticmethod
|
|
606
|
-
def _is_categorical_parameter(prm_name, columns):
|
|
607
|
-
|
|
608
|
-
|
|
612
|
+
def _is_categorical_parameter(prm_name, columns, meta_columns):
|
|
613
|
+
col_index = tuple(columns).index(prm_name)
|
|
614
|
+
meta_column = meta_columns[col_index]
|
|
615
|
+
return meta_column == MetaColumnNames.prm_cat_value
|
|
609
616
|
|
|
610
617
|
def is_numerical_parameter(self, prm_name) -> bool:
|
|
611
|
-
return self._is_numerical_parameter(prm_name, tuple(self.column_dtypes.keys()))
|
|
618
|
+
return self._is_numerical_parameter(prm_name, tuple(self.column_dtypes.keys()), self.meta_columns)
|
|
612
619
|
|
|
613
620
|
def is_categorical_parameter(self, prm_name) -> bool:
|
|
614
|
-
return self._is_categorical_parameter(prm_name, tuple(self.column_dtypes.keys()))
|
|
621
|
+
return self._is_categorical_parameter(prm_name, tuple(self.column_dtypes.keys()), self.meta_columns)
|
|
615
622
|
|
|
616
623
|
@staticmethod
|
|
617
|
-
def _get_parameter(prm_name: str, df: pd.DataFrame) -> Parameter:
|
|
618
|
-
if ColumnManager._is_numerical_parameter(prm_name, df.columns):
|
|
624
|
+
def _get_parameter(prm_name: str, df: pd.DataFrame, meta_columns) -> Parameter:
|
|
625
|
+
if ColumnManager._is_numerical_parameter(prm_name, df.columns, meta_columns):
|
|
619
626
|
out = NumericParameter()
|
|
620
627
|
out.name = prm_name
|
|
621
628
|
out.value = float(df[prm_name].dropna().values[-1])
|
|
@@ -641,7 +648,7 @@ class ColumnManager:
|
|
|
641
648
|
else:
|
|
642
649
|
out.step = None
|
|
643
650
|
|
|
644
|
-
elif ColumnManager._is_categorical_parameter(prm_name, df.columns):
|
|
651
|
+
elif ColumnManager._is_categorical_parameter(prm_name, df.columns, meta_columns):
|
|
645
652
|
out = CategoricalParameter()
|
|
646
653
|
out.name = prm_name
|
|
647
654
|
out.value = str(df[prm_name].dropna().values[-1])
|
|
@@ -1231,7 +1238,7 @@ class History:
|
|
|
1231
1238
|
|
|
1232
1239
|
parameters: TrialInput = {}
|
|
1233
1240
|
for prm_name in self.prm_names:
|
|
1234
|
-
param = ColumnManager._get_parameter(prm_name, df)
|
|
1241
|
+
param = ColumnManager._get_parameter(prm_name, df, meta_columns)
|
|
1235
1242
|
parameters.update({prm_name: param})
|
|
1236
1243
|
|
|
1237
1244
|
self.finalize(
|
|
@@ -1462,11 +1469,22 @@ class History:
|
|
|
1462
1469
|
|
|
1463
1470
|
# float
|
|
1464
1471
|
if self._records.column_manager.is_numerical_parameter(prm_name):
|
|
1472
|
+
|
|
1465
1473
|
lb_name = CorrespondingColumnNameRuler.prm_lower_bound_name(prm_name)
|
|
1466
1474
|
ub_name = CorrespondingColumnNameRuler.prm_upper_bound_name(prm_name)
|
|
1475
|
+
|
|
1476
|
+
if np.isnan(row[lb_name]):
|
|
1477
|
+
low = df[prm_name].dropna().values.min()
|
|
1478
|
+
else:
|
|
1479
|
+
low = row[lb_name]
|
|
1480
|
+
|
|
1481
|
+
if np.isnan(row[ub_name]):
|
|
1482
|
+
high = df[prm_name].dropna().values.max()
|
|
1483
|
+
else:
|
|
1484
|
+
high = row[ub_name]
|
|
1485
|
+
|
|
1467
1486
|
dist = optuna.distributions.FloatDistribution(
|
|
1468
|
-
low=
|
|
1469
|
-
high=row[ub_name],
|
|
1487
|
+
low=low, high=high
|
|
1470
1488
|
)
|
|
1471
1489
|
|
|
1472
1490
|
# categorical
|
|
@@ -1,30 +1,36 @@
|
|
|
1
|
+
from typing import TYPE_CHECKING
|
|
1
2
|
import platform
|
|
2
3
|
|
|
3
4
|
from ._base_interface import AbstractFEMInterface, NoFEM
|
|
4
5
|
|
|
5
|
-
|
|
6
|
+
# PyCharm 2025.1.2 では、以下のルールで参照先が決まる様子。仕様?
|
|
7
|
+
# if 文の前後で...
|
|
8
|
+
# - import されたクラスと定義されたクラスが混在する場合: 定義されたものが優先
|
|
9
|
+
# - import されたクラス同士である場合: 条件の True / False に関わらず、 else 内のものを優先
|
|
10
|
+
# - 定義されたクラス同士である場合: 条件の True / False に関わらず、 else 内のものを優先
|
|
11
|
+
# なのでわざわざ _dummy_classes module を分割作成し、条件式を反転して
|
|
12
|
+
# 実際の実装が参照されるようにした。
|
|
13
|
+
# VSCode では TYPE_CHECKING が True となる節が優先される。
|
|
14
|
+
if platform.system() != 'Windows' and not TYPE_CHECKING:
|
|
15
|
+
from _dummy_classes import (
|
|
16
|
+
FemtetInterface,
|
|
17
|
+
FemtetWithNXInterface,
|
|
18
|
+
FemtetWithSolidworksInterface,
|
|
19
|
+
ExcelInterface,
|
|
20
|
+
)
|
|
21
|
+
|
|
22
|
+
else:
|
|
6
23
|
from ._femtet_interface import FemtetInterface
|
|
7
24
|
from ._femtet_with_nx_interface import FemtetWithNXInterface
|
|
8
25
|
from ._femtet_with_solidworks import FemtetWithSolidworksInterface
|
|
9
26
|
from ._excel_interface import ExcelInterface
|
|
10
27
|
from ._with_excel_settings import *
|
|
11
28
|
from ._with_excel_settings import __all__ as _with_excel_settings__all__
|
|
12
|
-
else:
|
|
13
|
-
class DummyInterface:
|
|
14
|
-
def __init__(self, args, kwargs):
|
|
15
|
-
raise RuntimeError(f'{type(self).__name__} is only for Windows OS.')
|
|
16
|
-
|
|
17
|
-
class FemtetInterface(DummyInterface, AbstractFEMInterface): pass
|
|
18
|
-
class FemtetWithNXInterface(DummyInterface, AbstractFEMInterface): pass
|
|
19
|
-
class FemtetWithSolidworksInterface(DummyInterface, AbstractFEMInterface): pass
|
|
20
|
-
class ExcelInterface(DummyInterface, AbstractFEMInterface): pass
|
|
21
|
-
|
|
22
29
|
|
|
23
30
|
from ._surrogate_model_interface import AbstractSurrogateModelInterfaceBase
|
|
24
31
|
from ._surrogate_model_interface import BoTorchInterface
|
|
25
32
|
from ._surrogate_model_interface import PoFBoTorchInterface
|
|
26
33
|
|
|
27
|
-
|
|
28
34
|
__all__ = [
|
|
29
35
|
'AbstractFEMInterface',
|
|
30
36
|
'NoFEM',
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
from pyfemtet.opt.interface._base_interface import AbstractFEMInterface
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
class DummyInterface:
|
|
5
|
+
def __init__(self, *args, **kwargs):
|
|
6
|
+
raise RuntimeError(f'{type(self).__name__} is only for Windows OS.')
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class FemtetInterface(DummyInterface, AbstractFEMInterface): pass
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class FemtetWithNXInterface(DummyInterface, AbstractFEMInterface): pass
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
class FemtetWithSolidworksInterface(DummyInterface, AbstractFEMInterface): pass
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
class ExcelInterface(DummyInterface, AbstractFEMInterface): pass
|
{pyfemtet-1.0.8 → pyfemtet-1.0.10}/pyfemtet/opt/interface/_femtet_interface/femtet_interface.py
RENAMED
|
@@ -224,8 +224,23 @@ class FemtetInterface(COMInterface):
|
|
|
224
224
|
# femprj を開く
|
|
225
225
|
self.open(self.femprj_path, self.model_name)
|
|
226
226
|
|
|
227
|
-
def
|
|
227
|
+
def quit(self, timeout=15, force=True):
|
|
228
228
|
"""Force to terminate connected Femtet."""
|
|
229
|
+
logger.info(_('Closing Femtet (pid = {pid}) ...', pid=self.femtet_pid))
|
|
230
|
+
succeeded = _exit_or_force_terminate(
|
|
231
|
+
timeout=timeout, Femtet=self.Femtet, force=force)
|
|
232
|
+
if succeeded:
|
|
233
|
+
logger.info(_('Femtet is closed.'))
|
|
234
|
+
else:
|
|
235
|
+
logger.warning(_('Failed to close Femtet.'))
|
|
236
|
+
|
|
237
|
+
def close(self, timeout=15, force=True): # 12 秒程度
|
|
238
|
+
"""Destructor.
|
|
239
|
+
|
|
240
|
+
May not quit Femtet. If you want to quit certainly,
|
|
241
|
+
Please use `quit()` method.
|
|
242
|
+
|
|
243
|
+
"""
|
|
229
244
|
|
|
230
245
|
_set_autosave_enabled(self._original_autosave_enabled)
|
|
231
246
|
|
|
@@ -236,13 +251,7 @@ class FemtetInterface(COMInterface):
|
|
|
236
251
|
return
|
|
237
252
|
|
|
238
253
|
if self.quit_when_destruct:
|
|
239
|
-
|
|
240
|
-
succeeded = _exit_or_force_terminate(
|
|
241
|
-
timeout=timeout, Femtet=self.Femtet, force=force)
|
|
242
|
-
if succeeded:
|
|
243
|
-
logger.info(_('Femtet is closed.'))
|
|
244
|
-
else:
|
|
245
|
-
logger.warning(_('Failed to close Femtet.'))
|
|
254
|
+
self.quit(timeout, force)
|
|
246
255
|
|
|
247
256
|
def use_parametric_output_as_objective(
|
|
248
257
|
self, number: int, direction: str | float = "minimize"
|
|
@@ -709,8 +718,21 @@ class FemtetInterface(COMInterface):
|
|
|
709
718
|
if self.femtet_is_alive():
|
|
710
719
|
# 生きていてもここにきているなら
|
|
711
720
|
# 指定された Exception を送出する
|
|
712
|
-
|
|
713
|
-
|
|
721
|
+
|
|
722
|
+
try:
|
|
723
|
+
last_err = self.Femtet.LastErrorMsg
|
|
724
|
+
except Exception:
|
|
725
|
+
last_err = ''
|
|
726
|
+
|
|
727
|
+
logger.debug(
|
|
728
|
+
" " * print_indent
|
|
729
|
+
+ error_message
|
|
730
|
+
+ f' / Femtet.LastErrorMsg: {last_err}'
|
|
731
|
+
)
|
|
732
|
+
raise if_error(
|
|
733
|
+
error_message
|
|
734
|
+
+ f' / Femtet.LastErrorMsg: {last_err}'
|
|
735
|
+
)
|
|
714
736
|
|
|
715
737
|
# 死んでいるなら再起動
|
|
716
738
|
else:
|
|
@@ -61,6 +61,8 @@ class AbstractSurrogateModelInterfaceBase(AbstractFEMInterface):
|
|
|
61
61
|
# 新しく追加した model を使わない目的関数と見做して何もしない
|
|
62
62
|
if obj_name in self.train_history.obj_names:
|
|
63
63
|
obj.fun = lambda _, obj_name_=obj_name: self.current_obj_values[obj_name_]
|
|
64
|
+
obj.args = tuple()
|
|
65
|
+
obj.kwargs = dict()
|
|
64
66
|
|
|
65
67
|
# dict で与えられた場合
|
|
66
68
|
elif isinstance(self._output_directions, dict):
|
|
@@ -228,8 +228,8 @@ class AbstractOptimizer:
|
|
|
228
228
|
def add_categorical_parameter(
|
|
229
229
|
self,
|
|
230
230
|
name: str,
|
|
231
|
-
initial_value:
|
|
232
|
-
choices: list[
|
|
231
|
+
initial_value: SupportedVariableTypes | None = None,
|
|
232
|
+
choices: list[SupportedVariableTypes] | None = None,
|
|
233
233
|
properties: dict[str, ...] | None = None,
|
|
234
234
|
*,
|
|
235
235
|
pass_to_fem: bool = True,
|
{pyfemtet-1.0.8 → pyfemtet-1.0.10}/pyfemtet/opt/optimizer/optuna_optimizer/_optuna_optimizer.py
RENAMED
|
@@ -117,8 +117,8 @@ class OptunaOptimizer(AbstractOptimizer):
|
|
|
117
117
|
def add_categorical_parameter(
|
|
118
118
|
self,
|
|
119
119
|
name: str,
|
|
120
|
-
initial_value:
|
|
121
|
-
choices: list[
|
|
120
|
+
initial_value: SupportedVariableTypes,
|
|
121
|
+
choices: list[SupportedVariableTypes],
|
|
122
122
|
properties: dict[str, ...] | None = None,
|
|
123
123
|
*,
|
|
124
124
|
pass_to_fem: bool = True,
|
|
@@ -22,7 +22,9 @@ __all__ = [
|
|
|
22
22
|
]
|
|
23
23
|
|
|
24
24
|
|
|
25
|
-
def get_bounds_containing_entire_bounds(
|
|
25
|
+
def get_bounds_containing_entire_bounds(
|
|
26
|
+
df: pd.DataFrame, prm_name
|
|
27
|
+
) -> tuple[float | None, float | None]:
|
|
26
28
|
"""Get param bounds with all bounds"""
|
|
27
29
|
|
|
28
30
|
lb_name = CorrespondingColumnNameRuler.prm_lower_bound_name(prm_name)
|
|
@@ -31,7 +33,15 @@ def get_bounds_containing_entire_bounds(df: pd.DataFrame, prm_name) -> tuple[flo
|
|
|
31
33
|
ub_name = CorrespondingColumnNameRuler.prm_upper_bound_name(prm_name)
|
|
32
34
|
ub = df[ub_name].dropna().max()
|
|
33
35
|
|
|
34
|
-
|
|
36
|
+
lb = float(lb)
|
|
37
|
+
ub = float(ub)
|
|
38
|
+
|
|
39
|
+
if np.isnan(lb):
|
|
40
|
+
lb = None
|
|
41
|
+
if np.isnan(ub):
|
|
42
|
+
ub = None
|
|
43
|
+
|
|
44
|
+
return lb, ub
|
|
35
45
|
|
|
36
46
|
|
|
37
47
|
def get_choices_containing_entire_bounds(df: pd.DataFrame, prm_name) -> set[CategoricalChoiceType]:
|
|
@@ -90,17 +100,31 @@ def get_params_list_from_ndarray(x: np.ndarray, history: History) -> list[dict[s
|
|
|
90
100
|
return params_list
|
|
91
101
|
|
|
92
102
|
|
|
93
|
-
def get_search_space(
|
|
103
|
+
def get_search_space(
|
|
104
|
+
df: pd.DataFrame, history: History
|
|
105
|
+
) -> dict[str, BaseDistribution | None]:
|
|
94
106
|
# get search_space
|
|
95
107
|
search_space = dict()
|
|
96
108
|
for prm_name in history.prm_names:
|
|
97
109
|
if history._records.column_manager.is_numerical_parameter(prm_name):
|
|
98
110
|
lb, ub = get_bounds_containing_entire_bounds(df, prm_name)
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
111
|
+
|
|
112
|
+
if lb is None:
|
|
113
|
+
lb = df[prm_name].dropna().min()
|
|
114
|
+
if ub is None:
|
|
115
|
+
ub = df[prm_name].dropna().max()
|
|
116
|
+
|
|
117
|
+
if lb == ub:
|
|
118
|
+
# 固定値は search_space に含めない
|
|
119
|
+
pass
|
|
120
|
+
|
|
121
|
+
else:
|
|
122
|
+
search_space.update({
|
|
123
|
+
prm_name: FloatDistribution(
|
|
124
|
+
low=lb, high=ub,
|
|
125
|
+
)
|
|
126
|
+
})
|
|
127
|
+
|
|
104
128
|
elif history._records.column_manager.is_categorical_parameter(prm_name):
|
|
105
129
|
choices: set = get_choices_containing_entire_bounds(df, prm_name)
|
|
106
130
|
search_space.update({
|
|
@@ -145,6 +169,9 @@ def get_transformed_params(
|
|
|
145
169
|
|
|
146
170
|
# calc transformed value
|
|
147
171
|
for params in params_list:
|
|
172
|
+
|
|
173
|
+
# search_space に含まれない params の key は
|
|
174
|
+
# trans.transform() で無視される
|
|
148
175
|
trans_prm_values: np.ndarray = trans.transform(params)
|
|
149
176
|
out = np.concatenate(
|
|
150
177
|
[out, [trans_prm_values]],
|
|
@@ -102,6 +102,7 @@ class PyFemtetModel:
|
|
|
102
102
|
self.current_trans = get_transform_0_1(df, history)
|
|
103
103
|
|
|
104
104
|
# transform all values
|
|
105
|
+
# trans を作るときの search_space に含まれない prm_name はここで無視される
|
|
105
106
|
transformed_x = get_transformed_params(df, history, self.current_trans)
|
|
106
107
|
|
|
107
108
|
# bounds as setup maximum range
|
|
@@ -21,13 +21,12 @@ class AlertRegion(AbstractPage):
|
|
|
21
21
|
def setup_component(self):
|
|
22
22
|
# alert
|
|
23
23
|
# noinspection PyAttributeOutsideInit
|
|
24
|
-
self.alert_region = dbc.CardBody(children=[]
|
|
24
|
+
self.alert_region = dbc.CardBody(children=[])
|
|
25
25
|
|
|
26
26
|
# clear alert
|
|
27
27
|
# noinspection PyAttributeOutsideInit
|
|
28
28
|
self.clear_alert_button = dbc.Button(
|
|
29
29
|
children='Clear messages',
|
|
30
|
-
id='clear-messages-button',
|
|
31
30
|
color='secondary',
|
|
32
31
|
outline=True,
|
|
33
32
|
className="position-relative",
|
|
@@ -50,8 +49,8 @@ class AlertRegion(AbstractPage):
|
|
|
50
49
|
|
|
51
50
|
# ===== clear alerts ==-==
|
|
52
51
|
@app.callback(
|
|
53
|
-
Output(self.alert_region
|
|
54
|
-
Input(self.clear_alert_button
|
|
52
|
+
Output(self.alert_region, 'children', allow_duplicate=True),
|
|
53
|
+
Input(self.clear_alert_button, self.clear_alert_button.Prop.n_clicks),
|
|
55
54
|
prevent_initial_call=True, # required if allow_duplicate=True
|
|
56
55
|
)
|
|
57
56
|
def clear_alerts(_):
|
|
@@ -5,6 +5,7 @@ from dash.exceptions import PreventUpdate
|
|
|
5
5
|
# components
|
|
6
6
|
from pyfemtet.opt.visualization.history_viewer._wrapped_components import html
|
|
7
7
|
from pyfemtet.opt.visualization.history_viewer._wrapped_components import dcc, dbc
|
|
8
|
+
from pyfemtet.opt.visualization.history_viewer._complex_components.alert_region import *
|
|
8
9
|
|
|
9
10
|
# graph
|
|
10
11
|
import plotly.graph_objs as go
|
|
@@ -16,7 +17,8 @@ from pyfemtet.opt.prediction._model import *
|
|
|
16
17
|
from pyfemtet.opt.prediction._helper import *
|
|
17
18
|
from pyfemtet.opt.visualization.plotter.pm_graph_creator import plot2d, plot3d
|
|
18
19
|
from pyfemtet.opt.visualization.history_viewer._base_application import AbstractPage, logger
|
|
19
|
-
from pyfemtet.
|
|
20
|
+
from pyfemtet.opt.visualization.history_viewer._helper import has_full_bound
|
|
21
|
+
from pyfemtet._i18n import Msg, _
|
|
20
22
|
|
|
21
23
|
|
|
22
24
|
__all__ = [
|
|
@@ -142,11 +144,18 @@ class PredictionModelGraph(AbstractPage):
|
|
|
142
144
|
value=[],
|
|
143
145
|
)
|
|
144
146
|
|
|
147
|
+
# alert region subpage
|
|
148
|
+
self.alert_region: AlertRegion = AlertRegion()
|
|
149
|
+
self.add_subpage(self.alert_region)
|
|
150
|
+
|
|
145
151
|
def setup_layout(self):
|
|
146
152
|
self.card_header = dbc.CardHeader(self.tabs)
|
|
147
153
|
|
|
148
154
|
self.card_body = dbc.CardBody(
|
|
149
|
-
children=html.Div([
|
|
155
|
+
children=html.Div([
|
|
156
|
+
self.loading,
|
|
157
|
+
self.alert_region.layout,
|
|
158
|
+
]), # children=html.Div([self.loading, self.tooltip]),
|
|
150
159
|
)
|
|
151
160
|
|
|
152
161
|
dropdown_rows = [
|
|
@@ -301,6 +310,7 @@ class PredictionModelGraph(AbstractPage):
|
|
|
301
310
|
@app.callback(
|
|
302
311
|
Output(self.graph, 'figure'),
|
|
303
312
|
Output(self.command_manager, self.command_manager_prop),
|
|
313
|
+
Output(self.alert_region.alert_region, 'children', allow_duplicate=True),
|
|
304
314
|
# To determine whether Process Monitor should update
|
|
305
315
|
# the graph, the main graph remembers the current
|
|
306
316
|
# amount of data.
|
|
@@ -340,18 +350,54 @@ class PredictionModelGraph(AbstractPage):
|
|
|
340
350
|
# load history
|
|
341
351
|
if self.application.history is None:
|
|
342
352
|
logger.error(Msg.ERR_NO_HISTORY_SELECTED)
|
|
343
|
-
|
|
353
|
+
# to re-enable buttons, fire callback chain
|
|
354
|
+
return (
|
|
355
|
+
no_update,
|
|
356
|
+
self.CommandState.ready.value,
|
|
357
|
+
self.alert_region.create_alerts(Msg.ERR_NO_HISTORY_SELECTED),
|
|
358
|
+
)
|
|
344
359
|
# prm_names = self.application.history.prm_names
|
|
345
360
|
|
|
346
361
|
# check history
|
|
347
362
|
if len(self.application.get_df()) == 0:
|
|
348
363
|
logger.error(Msg.ERR_NO_FEM_RESULT)
|
|
349
|
-
|
|
364
|
+
# to re-enable buttons, fire callback chain
|
|
365
|
+
return (
|
|
366
|
+
no_update,
|
|
367
|
+
self.CommandState.ready.value,
|
|
368
|
+
self.alert_region.create_alerts(Msg.ERR_NO_FEM_RESULT, color='danger'),
|
|
369
|
+
)
|
|
350
370
|
|
|
351
371
|
# check fit
|
|
352
372
|
if not hasattr(self.pyfemtet_model, 'current_model'):
|
|
353
373
|
logger.error(Msg.ERR_NO_PREDICTION_MODEL)
|
|
354
|
-
|
|
374
|
+
# to re-enable buttons, fire callback chain
|
|
375
|
+
return (
|
|
376
|
+
no_update,
|
|
377
|
+
self.CommandState.ready.value,
|
|
378
|
+
self.alert_region.create_alerts(Msg.ERR_NO_PREDICTION_MODEL, color='danger'),
|
|
379
|
+
)
|
|
380
|
+
|
|
381
|
+
# check fixed and no-boundary parameter,
|
|
382
|
+
# cancel to write graph.
|
|
383
|
+
if (
|
|
384
|
+
not has_full_bound(self.application.history, axis1_label)
|
|
385
|
+
or (is_3d and not has_full_bound(self.application.history, axis2_label))
|
|
386
|
+
):
|
|
387
|
+
# to re-enable buttons, fire callback chain
|
|
388
|
+
return (
|
|
389
|
+
go.Figure(),
|
|
390
|
+
self.CommandState.ready.value,
|
|
391
|
+
self.alert_region.create_alerts(
|
|
392
|
+
_(
|
|
393
|
+
en_message='Cannot draw the graph because the selected parameter '
|
|
394
|
+
'is a fixed and its bounds are not given.',
|
|
395
|
+
jp_message='選択された変数は固定値で上下限も与えられていないため、'
|
|
396
|
+
'グラフを描画できません。',
|
|
397
|
+
),
|
|
398
|
+
color='danger',
|
|
399
|
+
),
|
|
400
|
+
)
|
|
355
401
|
|
|
356
402
|
# create params
|
|
357
403
|
params = dict()
|
|
@@ -394,7 +440,7 @@ class PredictionModelGraph(AbstractPage):
|
|
|
394
440
|
n=200,
|
|
395
441
|
)
|
|
396
442
|
|
|
397
|
-
return fig, self.CommandState.ready.value
|
|
443
|
+
return fig, self.CommandState.ready.value, []
|
|
398
444
|
|
|
399
445
|
# ===== re-enable buttons when the graph is updated, =====
|
|
400
446
|
@app.callback(
|
|
@@ -442,20 +488,25 @@ class PredictionModelGraph(AbstractPage):
|
|
|
442
488
|
logger.error(Msg.ERR_NO_HISTORY_SELECTED)
|
|
443
489
|
raise PreventUpdate
|
|
444
490
|
|
|
445
|
-
# add dropdown item to dropdown
|
|
491
|
+
# add dropdown item to dropdown 1, 2 (input)
|
|
446
492
|
axis1_dropdown_items, axis2_dropdown_items = [], []
|
|
447
493
|
for i, prm_name in enumerate(self.application.history.prm_names):
|
|
494
|
+
|
|
495
|
+
# dropdown1 (x)
|
|
448
496
|
dm_item_1 = dbc.DropdownMenuItem(
|
|
449
497
|
children=prm_name,
|
|
450
498
|
id={'type': 'axis1-dropdown-menu-item', 'index': prm_name},
|
|
451
499
|
)
|
|
452
500
|
axis1_dropdown_items.append(dm_item_1)
|
|
453
501
|
|
|
502
|
+
# dropdown2 (y)
|
|
454
503
|
dm_item_2 = dbc.DropdownMenuItem(
|
|
455
504
|
children=prm_name,
|
|
456
505
|
id={'type': 'axis2-dropdown-menu-item', 'index': prm_name},
|
|
457
506
|
)
|
|
458
507
|
axis2_dropdown_items.append(dm_item_2)
|
|
508
|
+
|
|
509
|
+
# add dropdown item to dropdown 3 (output)
|
|
459
510
|
axis3_dropdown_items = []
|
|
460
511
|
for i, obj_name in enumerate(self.application.history.obj_names):
|
|
461
512
|
dm_item = dbc.DropdownMenuItem(
|
|
@@ -464,6 +515,8 @@ class PredictionModelGraph(AbstractPage):
|
|
|
464
515
|
)
|
|
465
516
|
axis3_dropdown_items.append(dm_item)
|
|
466
517
|
|
|
518
|
+
df = self.application.get_df()
|
|
519
|
+
|
|
467
520
|
# add sliders
|
|
468
521
|
sliders = []
|
|
469
522
|
slider_values = {}
|
|
@@ -475,6 +528,11 @@ class PredictionModelGraph(AbstractPage):
|
|
|
475
528
|
prm_name,
|
|
476
529
|
)
|
|
477
530
|
|
|
531
|
+
if lb is None:
|
|
532
|
+
lb = df[prm_name].dropna().min()
|
|
533
|
+
if ub is None:
|
|
534
|
+
ub = df[prm_name].dropna().max()
|
|
535
|
+
|
|
478
536
|
# create slider
|
|
479
537
|
value = (lb + ub) / 2
|
|
480
538
|
slider = dcc.Slider(
|
|
@@ -580,8 +638,23 @@ class PredictionModelGraph(AbstractPage):
|
|
|
580
638
|
|
|
581
639
|
# by callback chain on loaded after setup_dropdown_and_sliders()
|
|
582
640
|
if callback_context.triggered_id == self.axis1_prm_dropdown.id:
|
|
583
|
-
|
|
584
|
-
|
|
641
|
+
|
|
642
|
+
# avoid unable choice
|
|
643
|
+
index = None
|
|
644
|
+
for i in range(len(prm_names)):
|
|
645
|
+
if has_full_bound(self.application.history, prm_names[i]):
|
|
646
|
+
ret[ax1_label_key] = prm_names[i]
|
|
647
|
+
index = i
|
|
648
|
+
break
|
|
649
|
+
|
|
650
|
+
ret[ax2_label_key] = ''
|
|
651
|
+
if index is not None:
|
|
652
|
+
for j in range(index + 1, len(prm_names)):
|
|
653
|
+
# ret[ax2_label_key] = prm_names[1] if len(prm_names) >= 2 else ''
|
|
654
|
+
if has_full_bound(self.application.history, prm_names[j]):
|
|
655
|
+
ret[ax2_label_key] = prm_names[j]
|
|
656
|
+
break
|
|
657
|
+
|
|
585
658
|
ret[ax3_label_key] = obj_names[0]
|
|
586
659
|
|
|
587
660
|
# by dropdown clicked
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import numpy as np
|
|
2
|
+
import pandas as pd
|
|
3
|
+
from pyfemtet.opt.history import *
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
def has_full_bound(history: History, prm_name, df: pd.DataFrame = None) -> bool:
|
|
7
|
+
if df is None:
|
|
8
|
+
df = history.get_df()
|
|
9
|
+
|
|
10
|
+
lb_name = CorrespondingColumnNameRuler.prm_lower_bound_name(prm_name)
|
|
11
|
+
if lb_name in df.columns:
|
|
12
|
+
lb = df[lb_name].dropna().min()
|
|
13
|
+
else:
|
|
14
|
+
lb = df[prm_name].dropna().min()
|
|
15
|
+
|
|
16
|
+
ub_name = CorrespondingColumnNameRuler.prm_upper_bound_name(prm_name)
|
|
17
|
+
if ub_name in df.columns:
|
|
18
|
+
ub = df[ub_name].dropna().max()
|
|
19
|
+
else:
|
|
20
|
+
ub = df[prm_name].dropna().max()
|
|
21
|
+
|
|
22
|
+
if lb == ub:
|
|
23
|
+
return False
|
|
24
|
+
|
|
25
|
+
if np.isnan(float(lb)) or np.isnan(float(ub)):
|
|
26
|
+
return False
|
|
27
|
+
|
|
28
|
+
return True
|