pyfemtet 0.9.5__py3-none-any.whl → 1.0.0b0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of pyfemtet might be problematic. Click here for more details.
- pyfemtet/__init__.py +6 -1
- pyfemtet/_i18n/1. make_pot_and_update_po.bat +8 -0
- pyfemtet/_i18n/2. build_mo.bat +5 -0
- pyfemtet/_i18n/__init__.py +4 -0
- pyfemtet/_i18n/babel.cfg +2 -0
- pyfemtet/_i18n/i18n.py +37 -0
- pyfemtet/_i18n/locales/ja/LC_MESSAGES/messages.mo +0 -0
- pyfemtet/_i18n/locales/ja/LC_MESSAGES/messages.po +1020 -0
- pyfemtet/_i18n/locales/messages.pot +987 -0
- pyfemtet/{_message → _i18n}/messages.py +128 -41
- pyfemtet/_util/closing.py +19 -0
- pyfemtet/_util/dask_util.py +89 -7
- pyfemtet/_util/df_util.py +29 -0
- pyfemtet/_util/excel_macro_util.py +8 -3
- pyfemtet/_util/excel_parse_util.py +43 -23
- pyfemtet/_util/femtet_access_inspection.py +120 -0
- pyfemtet/{_femtet_config_util/autosave.py → _util/femtet_autosave.py} +7 -0
- pyfemtet/_util/femtet_exit.py +105 -0
- pyfemtet/_util/femtet_version.py +20 -0
- pyfemtet/_util/helper.py +94 -0
- pyfemtet/_util/process_util.py +107 -0
- pyfemtet/_util/str_enum.py +44 -0
- pyfemtet/core.py +15 -47
- pyfemtet/dispatch_extensions/__init__.py +8 -11
- pyfemtet/dispatch_extensions/_impl.py +42 -198
- pyfemtet/logger/__init__.py +8 -1
- pyfemtet/logger/_impl.py +5 -6
- pyfemtet/opt/__init__.py +3 -17
- pyfemtet/opt/exceptions.py +45 -0
- pyfemtet/opt/femopt.py +608 -0
- pyfemtet/opt/history/__init__.py +11 -0
- pyfemtet/opt/history/_history.py +1404 -0
- pyfemtet/opt/history/_hypervolume.py +169 -0
- pyfemtet/opt/history/_optimality.py +79 -0
- pyfemtet/opt/interface/__init__.py +17 -24
- pyfemtet/opt/interface/_base_interface.py +222 -0
- pyfemtet/opt/interface/_excel_interface/__init__.py +3 -0
- pyfemtet/opt/interface/_excel_interface/debug-excel-interface.xlsm +0 -0
- pyfemtet/opt/interface/_excel_interface/excel_interface.py +999 -0
- pyfemtet/opt/interface/_femtet_interface/__init__.py +3 -0
- pyfemtet/opt/interface/{_femtet_parametric.py → _femtet_interface/_femtet_parametric.py} +20 -12
- pyfemtet/opt/interface/{_femtet.py → _femtet_interface/femtet_interface.py} +505 -349
- pyfemtet/opt/interface/_femtet_with_nx_interface/__init__.py +5 -0
- pyfemtet/opt/interface/_femtet_with_nx_interface/femtet_with_nx_interface.py +230 -0
- pyfemtet/opt/interface/_femtet_with_nx_interface/model1.prt +0 -0
- pyfemtet/opt/interface/_femtet_with_nx_interface/model1.x_t +98 -0
- pyfemtet/opt/interface/{_femtet_with_nx → _femtet_with_nx_interface}/update_model.py +1 -3
- pyfemtet/opt/interface/_femtet_with_solidworks/__init__.py +5 -0
- pyfemtet/opt/interface/_femtet_with_solidworks/femtet_with_solidworks_interface.py +122 -0
- pyfemtet/opt/interface/_solidworks_interface/__init__.py +5 -0
- pyfemtet/opt/interface/_solidworks_interface/solidworks_interface.py +206 -0
- pyfemtet/opt/interface/_surrogate_model_interface/__init__.py +8 -0
- pyfemtet/opt/interface/_surrogate_model_interface/base_surrogate_interface.py +150 -0
- pyfemtet/opt/interface/_surrogate_model_interface/botorch_interface.py +298 -0
- pyfemtet/opt/interface/_surrogate_model_interface/debug-pof-botorch.reccsv +18 -0
- pyfemtet/opt/interface/_with_excel_settings/__init__.py +61 -0
- pyfemtet/opt/interface/_with_excel_settings/with_excel_settings.py +134 -0
- pyfemtet/opt/meta_script/YAML_Generator.xlsm +0 -0
- pyfemtet/opt/meta_script/__main__.py +58 -36
- pyfemtet/opt/optimizer/__init__.py +7 -9
- pyfemtet/opt/optimizer/_base_optimizer.py +885 -0
- pyfemtet/opt/optimizer/optuna_optimizer/__init__.py +9 -0
- pyfemtet/opt/optimizer/optuna_optimizer/_optuna_attribute.py +73 -0
- pyfemtet/opt/optimizer/optuna_optimizer/_optuna_optimizer.py +678 -0
- pyfemtet/opt/optimizer/optuna_optimizer/_pof_botorch/__init__.py +7 -0
- pyfemtet/opt/optimizer/optuna_optimizer/_pof_botorch/debug-pof-botorch.reccsv +18 -0
- pyfemtet/opt/optimizer/optuna_optimizer/_pof_botorch/enable_nonlinear_constraint.py +244 -0
- pyfemtet/opt/optimizer/optuna_optimizer/_pof_botorch/pof_botorch_sampler.py +1249 -0
- pyfemtet/opt/optimizer/optuna_optimizer/wat_ex14_parametric_jp.femprj +0 -0
- pyfemtet/opt/optimizer/scipy_optimizer/__init__.py +1 -0
- pyfemtet/opt/optimizer/scipy_optimizer/_scipy_optimizer.py +364 -0
- pyfemtet/opt/prediction/__init__.py +7 -0
- pyfemtet/opt/prediction/_botorch_utils.py +133 -0
- pyfemtet/opt/prediction/_gpytorch_modules_extension.py +142 -0
- pyfemtet/opt/prediction/_helper.py +155 -0
- pyfemtet/opt/prediction/_model.py +118 -0
- pyfemtet/opt/problem/problem.py +304 -0
- pyfemtet/opt/problem/variable_manager/__init__.py +20 -0
- pyfemtet/opt/problem/variable_manager/_string_as_expression.py +115 -0
- pyfemtet/opt/problem/variable_manager/_variable_manager.py +295 -0
- pyfemtet/opt/visualization/history_viewer/__main__.py +5 -0
- pyfemtet/opt/visualization/{_base.py → history_viewer/_base_application.py} +18 -13
- pyfemtet/opt/visualization/history_viewer/_common_pages.py +150 -0
- pyfemtet/opt/visualization/{_complex_components → history_viewer/_complex_components}/alert_region.py +10 -5
- pyfemtet/opt/visualization/{_complex_components → history_viewer/_complex_components}/control_femtet.py +16 -13
- pyfemtet/opt/visualization/{_complex_components → history_viewer/_complex_components}/main_graph.py +117 -47
- pyfemtet/opt/visualization/{_complex_components → history_viewer/_complex_components}/pm_graph.py +159 -138
- pyfemtet/opt/visualization/history_viewer/_process_monitor/_application.py +173 -0
- pyfemtet/opt/visualization/history_viewer/_process_monitor/_pages.py +291 -0
- pyfemtet/opt/visualization/{_wrapped_components → history_viewer/_wrapped_components}/dbc.py +1 -1
- pyfemtet/opt/visualization/{_wrapped_components → history_viewer/_wrapped_components}/dcc.py +1 -1
- pyfemtet/opt/visualization/{_wrapped_components → history_viewer/_wrapped_components}/html.py +1 -1
- pyfemtet/opt/visualization/history_viewer/result_viewer/__main__.py +5 -0
- pyfemtet/opt/visualization/{result_viewer/application.py → history_viewer/result_viewer/_application.py} +6 -6
- pyfemtet/opt/visualization/{result_viewer/pages.py → history_viewer/result_viewer/_pages.py} +106 -82
- pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08.csv +18 -0
- pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08.db +0 -0
- pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8.jpg +0 -0
- pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8.log +45 -0
- pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8.pdt +0 -0
- pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_1.jpg +0 -0
- pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_1.pdt +0 -0
- pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_10.jpg +0 -0
- pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_10.pdt +0 -0
- pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_11.jpg +0 -0
- pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_11.pdt +0 -0
- pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_12.jpg +0 -0
- pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_12.pdt +0 -0
- pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_13.jpg +0 -0
- pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_13.pdt +0 -0
- pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_14.jpg +0 -0
- pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_14.pdt +0 -0
- pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_15.jpg +0 -0
- pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_15.pdt +0 -0
- pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_16.jpg +0 -0
- pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_16.pdt +0 -0
- pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_17.jpg +0 -0
- pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_17.pdt +0 -0
- pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_18.jpg +0 -0
- pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_18.pdt +0 -0
- pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_19.jpg +0 -0
- pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_19.pdt +0 -0
- pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_2.jpg +0 -0
- pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_2.pdt +0 -0
- pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_20.jpg +0 -0
- pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_20.pdt +0 -0
- pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_3.jpg +0 -0
- pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_3.pdt +0 -0
- pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_4.bgr +0 -0
- pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_4.bnd +0 -0
- pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_4.btr +0 -0
- pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_4.jpg +0 -0
- pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_4.mtl +0 -0
- pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_4.pdt +0 -0
- pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_4.prm +0 -0
- pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_5.jpg +0 -0
- pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_5.pdt +0 -0
- pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_6.jpg +0 -0
- pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_6.pdt +0 -0
- pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_7.jpg +0 -0
- pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_7.pdt +0 -0
- pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_8.jpg +0 -0
- pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_8.pdt +0 -0
- pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_9.jpg +0 -0
- pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_9.pdt +0 -0
- pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.femprj +0 -0
- pyfemtet/opt/visualization/plotter/main_figure_creator.py +536 -0
- pyfemtet/opt/visualization/plotter/pm_graph_creator.py +359 -0
- pyfemtet/opt/worker_status.py +120 -0
- {pyfemtet-0.9.5.dist-info → pyfemtet-1.0.0b0.dist-info}/METADATA +23 -24
- pyfemtet-1.0.0b0.dist-info/RECORD +172 -0
- pyfemtet-1.0.0b0.dist-info/entry_points.txt +3 -0
- pyfemtet/_femtet_config_util/exit.py +0 -59
- pyfemtet/_message/1. make_pot.bat +0 -11
- pyfemtet/_message/2. make_mo.bat +0 -6
- pyfemtet/_message/__init__.py +0 -5
- pyfemtet/_message/babel.cfg +0 -2
- pyfemtet/_message/locales/ja/LC_MESSAGES/messages.mo +0 -0
- pyfemtet/_message/locales/ja/LC_MESSAGES/messages.po +0 -570
- pyfemtet/_message/locales/messages.pot +0 -551
- pyfemtet/_warning.py +0 -87
- pyfemtet/brep/_impl.py +0 -18
- pyfemtet/opt/_femopt.py +0 -1007
- pyfemtet/opt/_femopt_core.py +0 -1169
- pyfemtet/opt/_test_utils/control_femtet.py +0 -39
- pyfemtet/opt/_test_utils/hyper_sphere.py +0 -24
- pyfemtet/opt/_test_utils/record_history.py +0 -130
- pyfemtet/opt/advanced_samples/excel_ui/(ref) original_project.femprj +0 -0
- pyfemtet/opt/advanced_samples/excel_ui/femtet-macro.xlsm +0 -0
- pyfemtet/opt/advanced_samples/excel_ui/pyfemtet-core.py +0 -291
- pyfemtet/opt/advanced_samples/excel_ui/test-pyfemtet-core.cmd +0 -22
- pyfemtet/opt/advanced_samples/restart/gal_ex13_parametric.femprj +0 -0
- pyfemtet/opt/advanced_samples/restart/gal_ex13_parametric_restart.py +0 -99
- pyfemtet/opt/advanced_samples/restart/gal_ex13_parametric_restart_jp.py +0 -102
- pyfemtet/opt/advanced_samples/surrogate_model/gal_ex13_create_training_data.py +0 -60
- pyfemtet/opt/advanced_samples/surrogate_model/gal_ex13_create_training_data_jp.py +0 -57
- pyfemtet/opt/advanced_samples/surrogate_model/gal_ex13_optimize_with_surrogate.py +0 -100
- pyfemtet/opt/advanced_samples/surrogate_model/gal_ex13_optimize_with_surrogate_jp.py +0 -90
- pyfemtet/opt/advanced_samples/surrogate_model/gal_ex13_parametric.femprj +0 -0
- pyfemtet/opt/interface/_base.py +0 -101
- pyfemtet/opt/interface/_excel_interface.py +0 -984
- pyfemtet/opt/interface/_femtet_excel.py +0 -141
- pyfemtet/opt/interface/_femtet_with_nx/__init__.py +0 -3
- pyfemtet/opt/interface/_femtet_with_nx/_interface.py +0 -178
- pyfemtet/opt/interface/_femtet_with_sldworks.py +0 -298
- pyfemtet/opt/interface/_surrogate/__init__.py +0 -5
- pyfemtet/opt/interface/_surrogate/_base.py +0 -129
- pyfemtet/opt/interface/_surrogate/_chaospy.py +0 -71
- pyfemtet/opt/interface/_surrogate/_singletaskgp.py +0 -71
- pyfemtet/opt/interface/_surrogate_excel.py +0 -102
- pyfemtet/opt/optimizer/_base.py +0 -376
- pyfemtet/opt/optimizer/_optuna/_botorch_patch/enable_nonlinear_constraint.py +0 -220
- pyfemtet/opt/optimizer/_optuna/_optuna.py +0 -434
- pyfemtet/opt/optimizer/_optuna/_pof_botorch.py +0 -1914
- pyfemtet/opt/optimizer/_scipy.py +0 -159
- pyfemtet/opt/optimizer/_scipy_scalar.py +0 -127
- pyfemtet/opt/optimizer/parameter.py +0 -113
- pyfemtet/opt/prediction/_base.py +0 -61
- pyfemtet/opt/prediction/single_task_gp.py +0 -119
- pyfemtet/opt/samples/femprj_sample/ParametricIF.femprj +0 -0
- pyfemtet/opt/samples/femprj_sample/ParametricIF.py +0 -29
- pyfemtet/opt/samples/femprj_sample/ParametricIF_test_result.reccsv +0 -13
- pyfemtet/opt/samples/femprj_sample/cad_ex01_NX.femprj +0 -0
- pyfemtet/opt/samples/femprj_sample/cad_ex01_NX.prt +0 -0
- pyfemtet/opt/samples/femprj_sample/cad_ex01_NX.py +0 -135
- pyfemtet/opt/samples/femprj_sample/cad_ex01_NX_test_result.reccsv +0 -23
- pyfemtet/opt/samples/femprj_sample/cad_ex01_SW.SLDPRT +0 -0
- pyfemtet/opt/samples/femprj_sample/cad_ex01_SW.femprj +0 -0
- pyfemtet/opt/samples/femprj_sample/cad_ex01_SW.py +0 -131
- pyfemtet/opt/samples/femprj_sample/cad_ex01_SW_test_result.reccsv +0 -23
- pyfemtet/opt/samples/femprj_sample/constrained_pipe.femprj +0 -0
- pyfemtet/opt/samples/femprj_sample/constrained_pipe.py +0 -96
- pyfemtet/opt/samples/femprj_sample/constrained_pipe_test_result.reccsv +0 -13
- pyfemtet/opt/samples/femprj_sample/gal_ex58_parametric.femprj +0 -0
- pyfemtet/opt/samples/femprj_sample/gal_ex58_parametric.py +0 -74
- pyfemtet/opt/samples/femprj_sample/gal_ex58_parametric_test_result.reccsv +0 -13
- pyfemtet/opt/samples/femprj_sample/gau_ex08_parametric.femprj +0 -0
- pyfemtet/opt/samples/femprj_sample/gau_ex08_parametric.py +0 -58
- pyfemtet/opt/samples/femprj_sample/gau_ex08_parametric_test_result.reccsv +0 -23
- pyfemtet/opt/samples/femprj_sample/gau_ex12_parametric.femprj +0 -0
- pyfemtet/opt/samples/femprj_sample/gau_ex12_parametric.py +0 -52
- pyfemtet/opt/samples/femprj_sample/her_ex40_parametric.femprj +0 -0
- pyfemtet/opt/samples/femprj_sample/her_ex40_parametric.py +0 -138
- pyfemtet/opt/samples/femprj_sample/her_ex40_parametric_test_result.reccsv +0 -18
- pyfemtet/opt/samples/femprj_sample/paswat_ex1_parametric.femprj +0 -0
- pyfemtet/opt/samples/femprj_sample/paswat_ex1_parametric.py +0 -60
- pyfemtet/opt/samples/femprj_sample/paswat_ex1_parametric_parallel.py +0 -61
- pyfemtet/opt/samples/femprj_sample/paswat_ex1_parametric_test_result.reccsv +0 -18
- pyfemtet/opt/samples/femprj_sample/wat_ex14_parametric.femprj +0 -0
- pyfemtet/opt/samples/femprj_sample/wat_ex14_parametric.py +0 -58
- pyfemtet/opt/samples/femprj_sample/wat_ex14_parametric_parallel.py +0 -58
- pyfemtet/opt/samples/femprj_sample/wat_ex14_parametric_test_result.reccsv +0 -18
- pyfemtet/opt/samples/femprj_sample_jp/ParametricIF_jp.femprj +0 -0
- pyfemtet/opt/samples/femprj_sample_jp/ParametricIF_jp.py +0 -29
- pyfemtet/opt/samples/femprj_sample_jp/cad_ex01_NX_jp.femprj +0 -0
- pyfemtet/opt/samples/femprj_sample_jp/cad_ex01_NX_jp.py +0 -129
- pyfemtet/opt/samples/femprj_sample_jp/cad_ex01_SW_jp.femprj +0 -0
- pyfemtet/opt/samples/femprj_sample_jp/cad_ex01_SW_jp.py +0 -125
- pyfemtet/opt/samples/femprj_sample_jp/constrained_pipe_jp.py +0 -93
- pyfemtet/opt/samples/femprj_sample_jp/gal_ex58_parametric_jp.femprj +0 -0
- pyfemtet/opt/samples/femprj_sample_jp/gal_ex58_parametric_jp.py +0 -70
- pyfemtet/opt/samples/femprj_sample_jp/gau_ex08_parametric_jp.femprj +0 -0
- pyfemtet/opt/samples/femprj_sample_jp/gau_ex08_parametric_jp.py +0 -57
- pyfemtet/opt/samples/femprj_sample_jp/gau_ex12_parametric_jp.py +0 -52
- pyfemtet/opt/samples/femprj_sample_jp/her_ex40_parametric_jp.femprj +0 -0
- pyfemtet/opt/samples/femprj_sample_jp/her_ex40_parametric_jp.py +0 -138
- pyfemtet/opt/samples/femprj_sample_jp/paswat_ex1_parametric_jp.femprj +0 -0
- pyfemtet/opt/samples/femprj_sample_jp/paswat_ex1_parametric_jp.py +0 -58
- pyfemtet/opt/samples/femprj_sample_jp/paswat_ex1_parametric_parallel_jp.py +0 -59
- pyfemtet/opt/samples/femprj_sample_jp/wat_ex14_parametric_jp.py +0 -56
- pyfemtet/opt/samples/femprj_sample_jp/wat_ex14_parametric_parallel_jp.py +0 -56
- pyfemtet/opt/visualization/_complex_components/main_figure_creator.py +0 -332
- pyfemtet/opt/visualization/_complex_components/pm_graph_creator.py +0 -201
- pyfemtet/opt/visualization/_process_monitor/application.py +0 -226
- pyfemtet/opt/visualization/_process_monitor/pages.py +0 -406
- pyfemtet/opt/visualization/_wrapped_components/__init__.py +0 -0
- pyfemtet/opt/visualization/result_viewer/__init__.py +0 -0
- pyfemtet-0.9.5.dist-info/RECORD +0 -158
- pyfemtet-0.9.5.dist-info/entry_points.txt +0 -3
- /pyfemtet/{_femtet_config_util → opt/problem}/__init__.py +0 -0
- /pyfemtet/{brep → opt/visualization/history_viewer}/__init__.py +0 -0
- /pyfemtet/opt/{_test_utils → visualization/history_viewer/_complex_components}/__init__.py +0 -0
- /pyfemtet/opt/{optimizer/_optuna → visualization/history_viewer/_process_monitor}/__init__.py +0 -0
- /pyfemtet/opt/{optimizer/_optuna/_botorch_patch → visualization/history_viewer/_wrapped_components}/__init__.py +0 -0
- /pyfemtet/opt/visualization/{_wrapped_components → history_viewer/_wrapped_components}/str_enum.py +0 -0
- /pyfemtet/opt/visualization/{result_viewer → history_viewer/result_viewer}/.gitignore +0 -0
- /pyfemtet/opt/visualization/{_complex_components → history_viewer/result_viewer}/__init__.py +0 -0
- /pyfemtet/opt/visualization/{_process_monitor → plotter}/__init__.py +0 -0
- /pyfemtet/opt/{samples/femprj_sample_jp/wat_ex14_parametric_jp.femprj → wat_ex14_parametric_jp.femprj} +0 -0
- {pyfemtet-0.9.5.dist-info → pyfemtet-1.0.0b0.dist-info}/LICENSE +0 -0
- {pyfemtet-0.9.5.dist-info → pyfemtet-1.0.0b0.dist-info}/LICENSE_THIRD_PARTY.txt +0 -0
- {pyfemtet-0.9.5.dist-info → pyfemtet-1.0.0b0.dist-info}/WHEEL +0 -0
|
@@ -0,0 +1,359 @@
|
|
|
1
|
+
import numpy as np
|
|
2
|
+
import plotly.graph_objects as go
|
|
3
|
+
|
|
4
|
+
from pyfemtet._i18n import _
|
|
5
|
+
from pyfemtet._util.df_util import *
|
|
6
|
+
from pyfemtet.opt.history import *
|
|
7
|
+
from pyfemtet.opt.prediction._model import *
|
|
8
|
+
from pyfemtet.opt.prediction._helper import *
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
__all__ = [
|
|
12
|
+
'plot2d',
|
|
13
|
+
'plot3d',
|
|
14
|
+
]
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
def get_grid_values(history: History, df, prm_name_, n) -> np.ndarray:
|
|
18
|
+
if history._records.column_manager.is_numerical_parameter(prm_name_):
|
|
19
|
+
lb_, ub_ = get_bounds_containing_entire_bounds(df, prm_name_)
|
|
20
|
+
out = np.linspace(lb_, ub_, n)
|
|
21
|
+
elif history._records.column_manager.is_categorical_parameter(prm_name_):
|
|
22
|
+
choices = get_choices_containing_entire_bounds(df, prm_name_)
|
|
23
|
+
out = np.array(list(choices))
|
|
24
|
+
else:
|
|
25
|
+
raise NotImplementedError
|
|
26
|
+
return out
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
def plot2d(
|
|
30
|
+
history: History,
|
|
31
|
+
prm_name1,
|
|
32
|
+
params: dict[str, float],
|
|
33
|
+
obj_name: str,
|
|
34
|
+
df,
|
|
35
|
+
pyfemtet_model: PyFemtetModel,
|
|
36
|
+
n=200,
|
|
37
|
+
) -> go.Figure:
|
|
38
|
+
return _plot(
|
|
39
|
+
history=history,
|
|
40
|
+
prm_name1=prm_name1,
|
|
41
|
+
prm_name2=None,
|
|
42
|
+
params=params,
|
|
43
|
+
obj_name=obj_name,
|
|
44
|
+
df=df,
|
|
45
|
+
pyfemtet_model=pyfemtet_model,
|
|
46
|
+
n=n,
|
|
47
|
+
)
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
def plot3d(
|
|
51
|
+
history: History,
|
|
52
|
+
prm_name1,
|
|
53
|
+
prm_name2,
|
|
54
|
+
params: dict[str, float],
|
|
55
|
+
obj_name: str,
|
|
56
|
+
df,
|
|
57
|
+
pyfemtet_model: PyFemtetModel,
|
|
58
|
+
n=20,
|
|
59
|
+
) -> go.Figure:
|
|
60
|
+
return _plot(
|
|
61
|
+
history=history,
|
|
62
|
+
prm_name1=prm_name1,
|
|
63
|
+
prm_name2=prm_name2,
|
|
64
|
+
params=params,
|
|
65
|
+
obj_name=obj_name,
|
|
66
|
+
df=df,
|
|
67
|
+
pyfemtet_model=pyfemtet_model,
|
|
68
|
+
n=n,
|
|
69
|
+
)
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
def _plot(
|
|
73
|
+
history: History,
|
|
74
|
+
prm_name1: str,
|
|
75
|
+
prm_name2: str | None,
|
|
76
|
+
params: dict[str, float],
|
|
77
|
+
obj_name: str,
|
|
78
|
+
df,
|
|
79
|
+
pyfemtet_model: PyFemtetModel,
|
|
80
|
+
n,
|
|
81
|
+
) -> go.Figure:
|
|
82
|
+
|
|
83
|
+
is_3d = prm_name2 is not None
|
|
84
|
+
|
|
85
|
+
# prepare input
|
|
86
|
+
if is_3d:
|
|
87
|
+
prm_values1 = get_grid_values(history, df, prm_name1, n)
|
|
88
|
+
prm_values2 = get_grid_values(history, df, prm_name2, n)
|
|
89
|
+
|
|
90
|
+
# plot 用の格子点を作成
|
|
91
|
+
xx1, xx2 = np.meshgrid(prm_values1, prm_values2)
|
|
92
|
+
|
|
93
|
+
# predict 用のデータを作成
|
|
94
|
+
x1 = xx1.ravel()
|
|
95
|
+
x2 = xx2.ravel()
|
|
96
|
+
else:
|
|
97
|
+
prm_values1 = get_grid_values(history, df, prm_name1, n)
|
|
98
|
+
xx1 = prm_values1
|
|
99
|
+
x1 = xx1
|
|
100
|
+
prm_values2 = None
|
|
101
|
+
xx2 = None
|
|
102
|
+
x2 = None
|
|
103
|
+
|
|
104
|
+
# predict 用の入力を作成
|
|
105
|
+
x = np.empty((int(np.prod(xx1.shape)), len(history.prm_names))).astype(object)
|
|
106
|
+
for i, prm_name in enumerate(history.prm_names):
|
|
107
|
+
if prm_name == prm_name1:
|
|
108
|
+
x[:, i] = x1
|
|
109
|
+
elif prm_name == prm_name2:
|
|
110
|
+
assert x2 is not None, 'prm_name2 must be None.'
|
|
111
|
+
x[:, i] = x2
|
|
112
|
+
else:
|
|
113
|
+
x[:, i] = params[prm_name]
|
|
114
|
+
|
|
115
|
+
# predict
|
|
116
|
+
z_mean_, z_std_ = pyfemtet_model.predict(x)
|
|
117
|
+
|
|
118
|
+
# target objective を抽出
|
|
119
|
+
obj_idx = history.obj_names.index(obj_name)
|
|
120
|
+
z_mean, z_std = z_mean_[:, obj_idx], z_std_[:, obj_idx]
|
|
121
|
+
|
|
122
|
+
# 3d 用 grid に変換
|
|
123
|
+
if is_3d:
|
|
124
|
+
zz_mean, zz_std = z_mean.reshape(xx1.shape), z_std.reshape(xx1.shape)
|
|
125
|
+
else:
|
|
126
|
+
zz_mean, zz_std = None, None
|
|
127
|
+
|
|
128
|
+
# plot
|
|
129
|
+
fig = go.Figure()
|
|
130
|
+
|
|
131
|
+
# rsm
|
|
132
|
+
if is_3d:
|
|
133
|
+
assert prm_name2 is not None
|
|
134
|
+
assert prm_values2 is not None
|
|
135
|
+
assert xx2 is not None
|
|
136
|
+
assert zz_mean is not None
|
|
137
|
+
assert zz_std is not None
|
|
138
|
+
|
|
139
|
+
zz_upper = zz_mean + zz_std
|
|
140
|
+
zz_lower = zz_mean - zz_std
|
|
141
|
+
|
|
142
|
+
# std
|
|
143
|
+
fig.add_trace(go.Surface(
|
|
144
|
+
z=zz_upper, x=xx1, y=xx2,
|
|
145
|
+
showscale=False, opacity=0.3, showlegend=True,
|
|
146
|
+
name=_('Upper of pred. std-dev')))
|
|
147
|
+
fig.add_trace(go.Surface(
|
|
148
|
+
z=zz_lower, x=xx1, y=xx2,
|
|
149
|
+
showscale=False, opacity=0.3, showlegend=True,
|
|
150
|
+
name=_('Lower of pred. std-dev')))
|
|
151
|
+
|
|
152
|
+
# mean
|
|
153
|
+
contours = {}
|
|
154
|
+
for key, prm_name, prm_values in zip(('x', 'y'), (prm_name1, prm_name2), (prm_values1, prm_values2)):
|
|
155
|
+
if history._records.column_manager.is_numerical_parameter(prm_name):
|
|
156
|
+
lb, ub = prm_values.min(), prm_values.max()
|
|
157
|
+
contours.update({key: dict(
|
|
158
|
+
highlight=True, show=True, color='blue',
|
|
159
|
+
start=lb, end=ub, size=(ub - lb) / n,
|
|
160
|
+
)})
|
|
161
|
+
elif history._records.column_manager.is_categorical_parameter(prm_name):
|
|
162
|
+
contours.update({key: dict(
|
|
163
|
+
highlight=True, show=True, color='blue',
|
|
164
|
+
)})
|
|
165
|
+
fig.add_trace(
|
|
166
|
+
go.Surface(
|
|
167
|
+
x=xx1, y=xx2, z=zz_mean,
|
|
168
|
+
name=_('Prediction'),
|
|
169
|
+
showlegend=True,
|
|
170
|
+
contours=contours,
|
|
171
|
+
colorbar=dict(
|
|
172
|
+
x=0.2,
|
|
173
|
+
xref="container",
|
|
174
|
+
),
|
|
175
|
+
)
|
|
176
|
+
)
|
|
177
|
+
else:
|
|
178
|
+
# std
|
|
179
|
+
fig.add_trace(
|
|
180
|
+
go.Scatter(
|
|
181
|
+
x=list(x1) + list(x1)[::-1],
|
|
182
|
+
y=list(z_mean + z_std) + list(z_mean - z_std)[::-1],
|
|
183
|
+
name=_('Std-dev of pred.'),
|
|
184
|
+
fill='toself',
|
|
185
|
+
opacity=0.3,
|
|
186
|
+
)
|
|
187
|
+
)
|
|
188
|
+
|
|
189
|
+
# mean
|
|
190
|
+
fig.add_trace(
|
|
191
|
+
go.Scatter(
|
|
192
|
+
x=x1, y=z_mean,
|
|
193
|
+
name=_('Prediction'),
|
|
194
|
+
)
|
|
195
|
+
)
|
|
196
|
+
|
|
197
|
+
# scatter
|
|
198
|
+
sub_fidelity_names = history.sub_fidelity_names
|
|
199
|
+
obj_names_per_sub_fidelity_list: list[list[str]] = [
|
|
200
|
+
history.obj_names for __ in sub_fidelity_names
|
|
201
|
+
]
|
|
202
|
+
|
|
203
|
+
if is_3d:
|
|
204
|
+
|
|
205
|
+
# main
|
|
206
|
+
df_main = get_partial_df(df, MAIN_FILTER)
|
|
207
|
+
fig.add_trace(go.Scatter3d(
|
|
208
|
+
x=df_main[prm_name1], y=df_main[prm_name2], z=df_main[obj_name],
|
|
209
|
+
mode='markers',
|
|
210
|
+
marker=dict(
|
|
211
|
+
size=3,
|
|
212
|
+
line=dict(
|
|
213
|
+
width=1,
|
|
214
|
+
color='white',
|
|
215
|
+
),
|
|
216
|
+
),
|
|
217
|
+
name='trial',
|
|
218
|
+
))
|
|
219
|
+
|
|
220
|
+
# sub fidelity
|
|
221
|
+
for (
|
|
222
|
+
sub_fidelity_name,
|
|
223
|
+
obj_names_per_sub_fidelity,
|
|
224
|
+
# color
|
|
225
|
+
) in zip(
|
|
226
|
+
sub_fidelity_names,
|
|
227
|
+
obj_names_per_sub_fidelity_list,
|
|
228
|
+
# px.colors.qualitative.G10[::-1]
|
|
229
|
+
):
|
|
230
|
+
|
|
231
|
+
if sub_fidelity_name == MAIN_FILTER:
|
|
232
|
+
continue
|
|
233
|
+
df_sub = get_partial_df(df, equality_filters=dict(sub_fidelity_name=sub_fidelity_name))
|
|
234
|
+
|
|
235
|
+
fig.add_trace(go.Scatter3d(
|
|
236
|
+
x=df_sub[prm_name1], y=df_sub[prm_name2], z=df_sub[obj_name],
|
|
237
|
+
mode='markers',
|
|
238
|
+
marker=dict(
|
|
239
|
+
size=3,
|
|
240
|
+
line=dict(
|
|
241
|
+
width=1,
|
|
242
|
+
color='white',
|
|
243
|
+
),
|
|
244
|
+
symbol='square-open', # TODO: sequence 化
|
|
245
|
+
),
|
|
246
|
+
name=f'trial of {sub_fidelity_name}',
|
|
247
|
+
))
|
|
248
|
+
|
|
249
|
+
else:
|
|
250
|
+
# main
|
|
251
|
+
df_main = get_partial_df(df, MAIN_FILTER)
|
|
252
|
+
fig.add_trace(go.Scatter(
|
|
253
|
+
x=df_main[prm_name1], y=df_main[obj_name],
|
|
254
|
+
mode='markers',
|
|
255
|
+
marker=dict(
|
|
256
|
+
line=dict(
|
|
257
|
+
width=1,
|
|
258
|
+
color='white',
|
|
259
|
+
),
|
|
260
|
+
),
|
|
261
|
+
name='trial',
|
|
262
|
+
))
|
|
263
|
+
|
|
264
|
+
# sub fidelity
|
|
265
|
+
for (
|
|
266
|
+
sub_fidelity_name,
|
|
267
|
+
obj_names_per_sub_fidelity,
|
|
268
|
+
# color
|
|
269
|
+
) in zip(
|
|
270
|
+
sub_fidelity_names,
|
|
271
|
+
obj_names_per_sub_fidelity_list,
|
|
272
|
+
# px.colors.qualitative.G10[::-1]
|
|
273
|
+
):
|
|
274
|
+
|
|
275
|
+
if sub_fidelity_name == MAIN_FILTER:
|
|
276
|
+
continue
|
|
277
|
+
df_sub = get_partial_df(df, equality_filters=dict(sub_fidelity_name=sub_fidelity_name))
|
|
278
|
+
|
|
279
|
+
fig.add_trace(go.Scatter(
|
|
280
|
+
x=df_sub[prm_name1], y=df_sub[obj_name],
|
|
281
|
+
mode='markers',
|
|
282
|
+
marker=dict(
|
|
283
|
+
line=dict(
|
|
284
|
+
width=1,
|
|
285
|
+
color='white',
|
|
286
|
+
),
|
|
287
|
+
symbol='square-open', # TODO: sequence 化
|
|
288
|
+
),
|
|
289
|
+
name=f'trial of {sub_fidelity_name}',
|
|
290
|
+
))
|
|
291
|
+
|
|
292
|
+
# set opacity by its distance
|
|
293
|
+
params_ = params.copy()
|
|
294
|
+
params_.pop(prm_name1)
|
|
295
|
+
if is_3d:
|
|
296
|
+
params_.pop(prm_name2)
|
|
297
|
+
if len(params_) == 0:
|
|
298
|
+
opacity = np.ones(len(df))
|
|
299
|
+
else:
|
|
300
|
+
# distance を計算する用のデータを分割
|
|
301
|
+
prm_names_for_distances = []
|
|
302
|
+
prm_values_for_distances = []
|
|
303
|
+
prm_names_for_categorical = []
|
|
304
|
+
prm_values_for_categorical = []
|
|
305
|
+
for prm_name in params_.keys():
|
|
306
|
+
if history.is_numerical_parameter(prm_name):
|
|
307
|
+
prm_names_for_distances.append(prm_name)
|
|
308
|
+
prm_values_for_distances.append(params_[prm_name])
|
|
309
|
+
elif history.is_categorical_parameter(prm_name):
|
|
310
|
+
prm_names_for_categorical.append(prm_name)
|
|
311
|
+
prm_values_for_categorical.append(params_[prm_name])
|
|
312
|
+
else:
|
|
313
|
+
raise NotImplementedError
|
|
314
|
+
|
|
315
|
+
# distance が大きい程 opacity を小さくする
|
|
316
|
+
if len(prm_names_for_distances) > 0:
|
|
317
|
+
target_points = df[prm_names_for_distances]
|
|
318
|
+
hyper_plane = np.array(prm_values_for_distances)
|
|
319
|
+
distances_to_hyper_plane = np.linalg.norm(target_points - hyper_plane, axis=1, keepdims=False)
|
|
320
|
+
opacity = 1 - (distances_to_hyper_plane / distances_to_hyper_plane.max())
|
|
321
|
+
else:
|
|
322
|
+
opacity = np.ones(len(df))
|
|
323
|
+
|
|
324
|
+
# categorical データが一致しないぶんだけ opacity を 1/N する
|
|
325
|
+
target_points = df[prm_names_for_categorical].values
|
|
326
|
+
hyper_plane = np.array(prm_values_for_categorical)
|
|
327
|
+
# noinspection PyUnresolvedReferences
|
|
328
|
+
count = (target_points == hyper_plane).astype(float).sum(axis=1)
|
|
329
|
+
count = count + 1 # 0 になると困る
|
|
330
|
+
# noinspection PyUnusedLocal
|
|
331
|
+
opacity = opacity * (count / count.max()) # FIXME: 0 除算エラーが取り切れていない場合がある
|
|
332
|
+
|
|
333
|
+
def set_opacity(trace):
|
|
334
|
+
if isinstance(trace, go.Scatter3d) or isinstance(trace, go.Scatter):
|
|
335
|
+
trace.marker.color = [f'rgba(0, 0, 0, {o: .2f})' for o in opacity]
|
|
336
|
+
|
|
337
|
+
fig.for_each_trace(set_opacity)
|
|
338
|
+
|
|
339
|
+
# axis name
|
|
340
|
+
if is_3d:
|
|
341
|
+
# layout
|
|
342
|
+
fig.update_layout(
|
|
343
|
+
title=_('Prediction Model'),
|
|
344
|
+
xaxis_title=prm_name1,
|
|
345
|
+
yaxis_title=obj_name,
|
|
346
|
+
)
|
|
347
|
+
|
|
348
|
+
else:
|
|
349
|
+
fig.update_layout(
|
|
350
|
+
title=_('Prediction Model'),
|
|
351
|
+
scene=dict(
|
|
352
|
+
xaxis_title=prm_name1,
|
|
353
|
+
yaxis_title=prm_name2,
|
|
354
|
+
zaxis_title=obj_name
|
|
355
|
+
),
|
|
356
|
+
margin=dict(l=0, r=0, b=0, t=30),
|
|
357
|
+
)
|
|
358
|
+
|
|
359
|
+
return fig
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
import math
|
|
4
|
+
|
|
5
|
+
from pyfemtet._util.dask_util import *
|
|
6
|
+
from pyfemtet.logger import get_module_logger
|
|
7
|
+
|
|
8
|
+
__all__ = [
|
|
9
|
+
'WorkerStatus',
|
|
10
|
+
'ENTIRE_PROCESS_STATUS_KEY'
|
|
11
|
+
]
|
|
12
|
+
|
|
13
|
+
logger = get_module_logger('opt.worker_status', False)
|
|
14
|
+
ENTIRE_PROCESS_STATUS_KEY = 'entire_process_status'
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
class _WorkerStatus(float):
|
|
18
|
+
|
|
19
|
+
string: str
|
|
20
|
+
|
|
21
|
+
# noinspection PyUnusedLocal
|
|
22
|
+
def __init__(self, x, string):
|
|
23
|
+
self.string = string
|
|
24
|
+
|
|
25
|
+
def __new__(cls, __x=..., string=...):
|
|
26
|
+
return super().__new__(cls, __x) # クラス変数インスタンス
|
|
27
|
+
|
|
28
|
+
def __repr__(self):
|
|
29
|
+
return self.string
|
|
30
|
+
|
|
31
|
+
def str(self):
|
|
32
|
+
return str(self)
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
def worker_status_from_float(value: float):
|
|
36
|
+
if math.isnan(value):
|
|
37
|
+
return _WorkerStatus(value, 'Undefined')
|
|
38
|
+
elif value == float(0):
|
|
39
|
+
return _WorkerStatus(value, 'Initializing')
|
|
40
|
+
elif value == float(10):
|
|
41
|
+
return _WorkerStatus(value, 'Launching FEM')
|
|
42
|
+
elif value == float(20):
|
|
43
|
+
return _WorkerStatus(value, 'Waiting for other workers')
|
|
44
|
+
elif value == float(30):
|
|
45
|
+
return _WorkerStatus(value, 'Running')
|
|
46
|
+
elif value == float(40):
|
|
47
|
+
return _WorkerStatus(value, 'Interrupting')
|
|
48
|
+
elif value == float(45):
|
|
49
|
+
return _WorkerStatus(value, 'Finishing')
|
|
50
|
+
elif value == float(50):
|
|
51
|
+
return _WorkerStatus(value, 'Finished')
|
|
52
|
+
elif value == float(60):
|
|
53
|
+
return _WorkerStatus(value, 'Crashed')
|
|
54
|
+
elif value == float('inf'):
|
|
55
|
+
return _WorkerStatus(value, 'Terminated')
|
|
56
|
+
else:
|
|
57
|
+
raise NotImplementedError(f'worker_status_from_float: {value=}')
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
class WorkerStatus:
|
|
61
|
+
|
|
62
|
+
undefined = worker_status_from_float(float('nan'))
|
|
63
|
+
initializing = worker_status_from_float(0)
|
|
64
|
+
launching_fem = worker_status_from_float(10)
|
|
65
|
+
waiting = worker_status_from_float(20)
|
|
66
|
+
running = worker_status_from_float(30)
|
|
67
|
+
interrupting = worker_status_from_float(40)
|
|
68
|
+
finishing = worker_status_from_float(45)
|
|
69
|
+
finished = worker_status_from_float(50)
|
|
70
|
+
crashed = worker_status_from_float(60)
|
|
71
|
+
terminated = worker_status_from_float(float('inf'))
|
|
72
|
+
|
|
73
|
+
def __init__(self, dataset_name: str):
|
|
74
|
+
self._dataset_name = dataset_name
|
|
75
|
+
self.__value: _WorkerStatus
|
|
76
|
+
self.value = WorkerStatus.undefined
|
|
77
|
+
|
|
78
|
+
@property
|
|
79
|
+
def value(self) -> _WorkerStatus:
|
|
80
|
+
|
|
81
|
+
out = None
|
|
82
|
+
|
|
83
|
+
client = get_client()
|
|
84
|
+
if client is not None:
|
|
85
|
+
if client.scheduler is not None:
|
|
86
|
+
key = self._dataset_name
|
|
87
|
+
value: float | None = client.get_metadata(key, default=None)
|
|
88
|
+
|
|
89
|
+
# value は単なる float になるので型変換
|
|
90
|
+
if isinstance(value, float):
|
|
91
|
+
value: _WorkerStatus = worker_status_from_float(value)
|
|
92
|
+
|
|
93
|
+
# setter の時点では client がなかった場合など
|
|
94
|
+
elif value is None:
|
|
95
|
+
value = self.__value
|
|
96
|
+
client.set_metadata(key, value)
|
|
97
|
+
|
|
98
|
+
out = value
|
|
99
|
+
|
|
100
|
+
# client はあるが、close された後である場合
|
|
101
|
+
else:
|
|
102
|
+
self.__value = WorkerStatus.terminated
|
|
103
|
+
out = self.__value
|
|
104
|
+
else:
|
|
105
|
+
out = self.__value
|
|
106
|
+
|
|
107
|
+
assert out is not None
|
|
108
|
+
|
|
109
|
+
self.__value = out
|
|
110
|
+
return out
|
|
111
|
+
|
|
112
|
+
@value.setter
|
|
113
|
+
def value(self, value: _WorkerStatus):
|
|
114
|
+
client = get_client()
|
|
115
|
+
if client is not None:
|
|
116
|
+
if client.scheduler is not None:
|
|
117
|
+
key = self._dataset_name
|
|
118
|
+
client.set_metadata(key, value)
|
|
119
|
+
# sleep(0.1)
|
|
120
|
+
self.__value = value
|
|
@@ -1,40 +1,39 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: pyfemtet
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 1.0.0b0
|
|
4
4
|
Summary: Design parameter optimization using Femtet.
|
|
5
5
|
License: MIT
|
|
6
6
|
Author: kazuma.naito
|
|
7
7
|
Author-email: 148934231+pyfemtet@users.noreply.github.com
|
|
8
|
-
Requires-Python: >=3.10
|
|
8
|
+
Requires-Python: >= 3.10, < 3.14
|
|
9
9
|
Classifier: License :: OSI Approved :: MIT License
|
|
10
10
|
Classifier: Programming Language :: Python :: 3
|
|
11
11
|
Classifier: Programming Language :: Python :: 3.10
|
|
12
12
|
Classifier: Programming Language :: Python :: 3.11
|
|
13
13
|
Classifier: Programming Language :: Python :: 3.12
|
|
14
|
-
|
|
15
|
-
Requires-Dist: babel (>=2.15.0,<3
|
|
16
|
-
Requires-Dist: botorch (>=0.12.0,<0.
|
|
17
|
-
Requires-Dist:
|
|
18
|
-
Requires-Dist:
|
|
19
|
-
Requires-Dist: dash (>=
|
|
20
|
-
Requires-Dist:
|
|
21
|
-
Requires-Dist:
|
|
22
|
-
Requires-Dist:
|
|
23
|
-
Requires-Dist:
|
|
24
|
-
Requires-Dist:
|
|
25
|
-
Requires-Dist:
|
|
26
|
-
Requires-Dist: openpyxl (>=3.1.2,<4.0.0)
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
15
|
+
Requires-Dist: babel (>=2.15.0,<3)
|
|
16
|
+
Requires-Dist: botorch (>=0.12.0,<0.15.0)
|
|
17
|
+
Requires-Dist: colorlog (>=6.8.0,<7)
|
|
18
|
+
Requires-Dist: dash (>=2.17.0,<3)
|
|
19
|
+
Requires-Dist: dash-bootstrap-components (>=1.5.0,<2)
|
|
20
|
+
Requires-Dist: dask (>=2024.12.1,<2024.13.0)
|
|
21
|
+
Requires-Dist: distributed (>=2024.12.1,<2024.13.0)
|
|
22
|
+
Requires-Dist: femtetutils (>=1.0.0,<2) ; sys_platform == "win32"
|
|
23
|
+
Requires-Dist: fire (>=0.7)
|
|
24
|
+
Requires-Dist: numpy (>=2.0.0,<3)
|
|
25
|
+
Requires-Dist: openpyxl (>=3.1.2,<4)
|
|
27
26
|
Requires-Dist: optuna (>=3.4.0,<5.0.0)
|
|
28
27
|
Requires-Dist: optuna-integration (>=3.6.0,<5.0.0)
|
|
29
|
-
Requires-Dist: pandas (>=2.2.3,<3
|
|
30
|
-
Requires-Dist: plotly (>=5.22.0,<6
|
|
31
|
-
Requires-Dist: psutil (>=5.9.6,<6
|
|
32
|
-
Requires-Dist: pywin32 (
|
|
33
|
-
Requires-Dist:
|
|
34
|
-
Requires-Dist:
|
|
35
|
-
Requires-Dist:
|
|
36
|
-
Requires-Dist: torch
|
|
37
|
-
Requires-Dist: tqdm (>=4.66.1,<5
|
|
28
|
+
Requires-Dist: pandas (>=2.2.3,<3)
|
|
29
|
+
Requires-Dist: plotly (>=5.22.0,<6)
|
|
30
|
+
Requires-Dist: psutil (>=5.9.6,<6)
|
|
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"
|
|
33
|
+
Requires-Dist: pyyaml (>=6.0.2,<7)
|
|
34
|
+
Requires-Dist: scipy (>=1.11.4,<2)
|
|
35
|
+
Requires-Dist: torch
|
|
36
|
+
Requires-Dist: tqdm (>=4.66.1,<5)
|
|
38
37
|
Project-URL: Repository, https://github.com/pyfemtet/pyfemtet
|
|
39
38
|
Description-Content-Type: text/markdown
|
|
40
39
|
|