pyfemtet 0.4.24__py3-none-any.whl → 0.5.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of pyfemtet might be problematic. Click here for more details.

Files changed (113) hide show
  1. pyfemtet/__init__.py +1 -1
  2. pyfemtet/message/locales/ja/LC_MESSAGES/messages.mo +0 -0
  3. pyfemtet/message/locales/ja/LC_MESSAGES/messages.po +114 -62
  4. pyfemtet/message/locales/messages.pot +114 -62
  5. pyfemtet/message/messages.py +6 -2
  6. pyfemtet/opt/__init__.py +4 -2
  7. pyfemtet/opt/_femopt.py +27 -46
  8. pyfemtet/opt/_femopt_core.py +50 -33
  9. pyfemtet/opt/_test_utils/__init__.py +0 -0
  10. pyfemtet/opt/_test_utils/control_femtet.py +45 -0
  11. pyfemtet/opt/_test_utils/hyper_sphere.py +24 -0
  12. pyfemtet/opt/_test_utils/record_history.py +72 -0
  13. pyfemtet/opt/interface/_femtet.py +39 -1
  14. pyfemtet/opt/optimizer/__init__.py +12 -0
  15. pyfemtet/opt/{opt → optimizer}/_base.py +30 -9
  16. pyfemtet/opt/{opt → optimizer}/_optuna.py +15 -34
  17. pyfemtet/opt/optimizer/_optuna_botorchsampler_parameter_constraint_helper.py +331 -0
  18. pyfemtet/opt/{opt → optimizer}/_scipy.py +10 -6
  19. pyfemtet/opt/{opt → optimizer}/_scipy_scalar.py +24 -12
  20. pyfemtet/opt/{femprj_sample → samples/femprj_sample}/gal_ex58_parametric_test_result.reccsv +1 -1
  21. pyfemtet/opt/{femprj_sample → samples/femprj_sample}/her_ex40_parametric.py +10 -8
  22. pyfemtet/opt/samples/femprj_sample/her_ex40_parametric_test_result.reccsv +18 -0
  23. pyfemtet/opt/{femprj_sample_jp → samples/femprj_sample_jp}/her_ex40_parametric_jp.py +10 -8
  24. pyfemtet/opt/visualization/complex_components/main_figure_creator.py +69 -0
  25. pyfemtet/opt/visualization/complex_components/main_graph.py +299 -14
  26. pyfemtet/opt/visualization/process_monitor/pages.py +1 -1
  27. pyfemtet/opt/visualization/result_viewer/application.py +1 -1
  28. pyfemtet/opt/visualization/result_viewer/pages.py +9 -9
  29. {pyfemtet-0.4.24.dist-info → pyfemtet-0.5.0.dist-info}/METADATA +1 -1
  30. pyfemtet-0.5.0.dist-info/RECORD +112 -0
  31. pyfemtet/_test_util.py +0 -135
  32. pyfemtet/opt/femprj_sample/her_ex40_parametric_test_result.reccsv +0 -18
  33. pyfemtet/opt/femprj_sample/wat_ex14_parametric.Results/Ex14.pdt +0 -0
  34. pyfemtet/opt/femprj_sample/wat_ex14_parametric.Results/Ex14_trial1.jpg +0 -0
  35. pyfemtet/opt/femprj_sample/wat_ex14_parametric.Results/Ex14_trial1.pdt +0 -0
  36. pyfemtet/opt/femprj_sample/wat_ex14_parametric.Results/Ex14_trial10.jpg +0 -0
  37. pyfemtet/opt/femprj_sample/wat_ex14_parametric.Results/Ex14_trial10.pdt +0 -0
  38. pyfemtet/opt/femprj_sample/wat_ex14_parametric.Results/Ex14_trial11.jpg +0 -0
  39. pyfemtet/opt/femprj_sample/wat_ex14_parametric.Results/Ex14_trial11.pdt +0 -0
  40. pyfemtet/opt/femprj_sample/wat_ex14_parametric.Results/Ex14_trial12.jpg +0 -0
  41. pyfemtet/opt/femprj_sample/wat_ex14_parametric.Results/Ex14_trial12.pdt +0 -0
  42. pyfemtet/opt/femprj_sample/wat_ex14_parametric.Results/Ex14_trial13.jpg +0 -0
  43. pyfemtet/opt/femprj_sample/wat_ex14_parametric.Results/Ex14_trial13.pdt +0 -0
  44. pyfemtet/opt/femprj_sample/wat_ex14_parametric.Results/Ex14_trial14.jpg +0 -0
  45. pyfemtet/opt/femprj_sample/wat_ex14_parametric.Results/Ex14_trial14.pdt +0 -0
  46. pyfemtet/opt/femprj_sample/wat_ex14_parametric.Results/Ex14_trial15.jpg +0 -0
  47. pyfemtet/opt/femprj_sample/wat_ex14_parametric.Results/Ex14_trial15.pdt +0 -0
  48. pyfemtet/opt/femprj_sample/wat_ex14_parametric.Results/Ex14_trial2.jpg +0 -0
  49. pyfemtet/opt/femprj_sample/wat_ex14_parametric.Results/Ex14_trial2.pdt +0 -0
  50. pyfemtet/opt/femprj_sample/wat_ex14_parametric.Results/Ex14_trial3.jpg +0 -0
  51. pyfemtet/opt/femprj_sample/wat_ex14_parametric.Results/Ex14_trial3.pdt +0 -0
  52. pyfemtet/opt/femprj_sample/wat_ex14_parametric.Results/Ex14_trial4.jpg +0 -0
  53. pyfemtet/opt/femprj_sample/wat_ex14_parametric.Results/Ex14_trial4.pdt +0 -0
  54. pyfemtet/opt/femprj_sample/wat_ex14_parametric.Results/Ex14_trial5.jpg +0 -0
  55. pyfemtet/opt/femprj_sample/wat_ex14_parametric.Results/Ex14_trial5.pdt +0 -0
  56. pyfemtet/opt/femprj_sample/wat_ex14_parametric.Results/Ex14_trial6.jpg +0 -0
  57. pyfemtet/opt/femprj_sample/wat_ex14_parametric.Results/Ex14_trial6.pdt +0 -0
  58. pyfemtet/opt/femprj_sample/wat_ex14_parametric.Results/Ex14_trial7.jpg +0 -0
  59. pyfemtet/opt/femprj_sample/wat_ex14_parametric.Results/Ex14_trial7.pdt +0 -0
  60. pyfemtet/opt/femprj_sample/wat_ex14_parametric.Results/Ex14_trial8.jpg +0 -0
  61. pyfemtet/opt/femprj_sample/wat_ex14_parametric.Results/Ex14_trial8.pdt +0 -0
  62. pyfemtet/opt/femprj_sample/wat_ex14_parametric.Results/Ex14_trial9.jpg +0 -0
  63. pyfemtet/opt/femprj_sample/wat_ex14_parametric.Results/Ex14_trial9.pdt +0 -0
  64. pyfemtet/opt/opt/__init__.py +0 -12
  65. pyfemtet/opt/opt/_optuna_botorch_helper.py +0 -209
  66. pyfemtet-0.4.24.dist-info/RECORD +0 -140
  67. /pyfemtet/opt/{femprj_sample → samples/femprj_sample}/.gitignore +0 -0
  68. /pyfemtet/opt/{femprj_sample → samples/femprj_sample}/ParametricIF - True.femprj +0 -0
  69. /pyfemtet/opt/{femprj_sample → samples/femprj_sample}/ParametricIF.femprj +0 -0
  70. /pyfemtet/opt/{femprj_sample → samples/femprj_sample}/ParametricIF.py +0 -0
  71. /pyfemtet/opt/{femprj_sample → samples/femprj_sample}/ParametricIF_test_result.reccsv +0 -0
  72. /pyfemtet/opt/{femprj_sample → samples/femprj_sample}/cad_ex01_NX.femprj +0 -0
  73. /pyfemtet/opt/{femprj_sample → samples/femprj_sample}/cad_ex01_NX.prt +0 -0
  74. /pyfemtet/opt/{femprj_sample → samples/femprj_sample}/cad_ex01_NX.py +0 -0
  75. /pyfemtet/opt/{femprj_sample → samples/femprj_sample}/cad_ex01_NX_test_result.reccsv +0 -0
  76. /pyfemtet/opt/{femprj_sample → samples/femprj_sample}/cad_ex01_SW.SLDPRT +0 -0
  77. /pyfemtet/opt/{femprj_sample → samples/femprj_sample}/cad_ex01_SW.femprj +0 -0
  78. /pyfemtet/opt/{femprj_sample → samples/femprj_sample}/cad_ex01_SW.py +0 -0
  79. /pyfemtet/opt/{femprj_sample → samples/femprj_sample}/cad_ex01_SW_test_result.reccsv +0 -0
  80. /pyfemtet/opt/{femprj_sample → samples/femprj_sample}/gal_ex58_parametric.femprj +0 -0
  81. /pyfemtet/opt/{femprj_sample → samples/femprj_sample}/gal_ex58_parametric.py +0 -0
  82. /pyfemtet/opt/{femprj_sample → samples/femprj_sample}/gau_ex08_parametric.femprj +0 -0
  83. /pyfemtet/opt/{femprj_sample → samples/femprj_sample}/gau_ex08_parametric.py +0 -0
  84. /pyfemtet/opt/{femprj_sample → samples/femprj_sample}/gau_ex08_parametric_test_result.reccsv +0 -0
  85. /pyfemtet/opt/{femprj_sample → samples/femprj_sample}/her_ex40_parametric.femprj +0 -0
  86. /pyfemtet/opt/{femprj_sample → samples/femprj_sample}/paswat_ex1_parametric.femprj +0 -0
  87. /pyfemtet/opt/{femprj_sample → samples/femprj_sample}/paswat_ex1_parametric.py +0 -0
  88. /pyfemtet/opt/{femprj_sample → samples/femprj_sample}/paswat_ex1_parametric_parallel.py +0 -0
  89. /pyfemtet/opt/{femprj_sample → samples/femprj_sample}/paswat_ex1_parametric_test_result.reccsv +0 -0
  90. /pyfemtet/opt/{femprj_sample → samples/femprj_sample}/wat_ex14_parametric.femprj +0 -0
  91. /pyfemtet/opt/{femprj_sample → samples/femprj_sample}/wat_ex14_parametric.py +0 -0
  92. /pyfemtet/opt/{femprj_sample → samples/femprj_sample}/wat_ex14_parametric_parallel.py +0 -0
  93. /pyfemtet/opt/{femprj_sample → samples/femprj_sample}/wat_ex14_parametric_test_result.reccsv +0 -0
  94. /pyfemtet/opt/{femprj_sample_jp → samples/femprj_sample_jp}/ParametricIF_jp.femprj +0 -0
  95. /pyfemtet/opt/{femprj_sample_jp → samples/femprj_sample_jp}/ParametricIF_jp.py +0 -0
  96. /pyfemtet/opt/{femprj_sample_jp → samples/femprj_sample_jp}/cad_ex01_NX_jp.femprj +0 -0
  97. /pyfemtet/opt/{femprj_sample_jp → samples/femprj_sample_jp}/cad_ex01_NX_jp.py +0 -0
  98. /pyfemtet/opt/{femprj_sample_jp → samples/femprj_sample_jp}/cad_ex01_SW_jp.femprj +0 -0
  99. /pyfemtet/opt/{femprj_sample_jp → samples/femprj_sample_jp}/cad_ex01_SW_jp.py +0 -0
  100. /pyfemtet/opt/{femprj_sample_jp → samples/femprj_sample_jp}/gal_ex58_parametric_jp.femprj +0 -0
  101. /pyfemtet/opt/{femprj_sample_jp → samples/femprj_sample_jp}/gal_ex58_parametric_jp.py +0 -0
  102. /pyfemtet/opt/{femprj_sample_jp → samples/femprj_sample_jp}/gau_ex08_parametric_jp.femprj +0 -0
  103. /pyfemtet/opt/{femprj_sample_jp → samples/femprj_sample_jp}/gau_ex08_parametric_jp.py +0 -0
  104. /pyfemtet/opt/{femprj_sample_jp → samples/femprj_sample_jp}/her_ex40_parametric_jp.femprj +0 -0
  105. /pyfemtet/opt/{femprj_sample_jp → samples/femprj_sample_jp}/paswat_ex1_parametric_jp.femprj +0 -0
  106. /pyfemtet/opt/{femprj_sample_jp → samples/femprj_sample_jp}/paswat_ex1_parametric_jp.py +0 -0
  107. /pyfemtet/opt/{femprj_sample_jp → samples/femprj_sample_jp}/paswat_ex1_parametric_parallel_jp.py +0 -0
  108. /pyfemtet/opt/{femprj_sample_jp → samples/femprj_sample_jp}/wat_ex14_parametric_jp.femprj +0 -0
  109. /pyfemtet/opt/{femprj_sample_jp → samples/femprj_sample_jp}/wat_ex14_parametric_jp.py +0 -0
  110. /pyfemtet/opt/{femprj_sample_jp → samples/femprj_sample_jp}/wat_ex14_parametric_parallel_jp.py +0 -0
  111. {pyfemtet-0.4.24.dist-info → pyfemtet-0.5.0.dist-info}/LICENSE +0 -0
  112. {pyfemtet-0.4.24.dist-info → pyfemtet-0.5.0.dist-info}/WHEEL +0 -0
  113. {pyfemtet-0.4.24.dist-info → pyfemtet-0.5.0.dist-info}/entry_points.txt +0 -0
@@ -8,7 +8,7 @@ msgid ""
8
8
  msgstr ""
9
9
  "Project-Id-Version: PROJECT VERSION\n"
10
10
  "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
11
- "POT-Creation-Date: 2024-08-20 10:15+0900\n"
11
+ "POT-Creation-Date: 2024-08-31 04:27+0900\n"
12
12
  "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13
13
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14
14
  "Language-Team: LANGUAGE <LL@li.org>\n"
@@ -197,251 +197,303 @@ msgstr ""
197
197
  msgid "Optimization has been interrupted. Note that you cannot acquire the OptimizationResult in case of `trust-constr`, `TNC`, `SLSQP` or `COBYLA`."
198
198
  msgstr ""
199
199
 
200
- #: pyfemtet/message/messages.py:95
201
- msgid "Connect to Femtet"
200
+ #: pyfemtet/message/messages.py:92
201
+ msgid "You can use parameter constraint only with BoTorchSampler."
202
202
  msgstr ""
203
203
 
204
204
  #: pyfemtet/message/messages.py:96
205
- msgid "Analysis model name described in csv does not exist in project."
205
+ msgid "Connect to Femtet"
206
206
  msgstr ""
207
207
 
208
208
  #: pyfemtet/message/messages.py:97
209
- msgid "History csv is not read yet. Open your project manually."
209
+ msgid "Analysis model name described in csv does not exist in project."
210
210
  msgstr ""
211
211
 
212
212
  #: pyfemtet/message/messages.py:98
213
- msgid "Cannot read project data from csv. Open your project manually."
213
+ msgid "History csv is not read yet. Open your project manually."
214
214
  msgstr ""
215
215
 
216
216
  #: pyfemtet/message/messages.py:99
217
- msgid ".femprj file described in csv is not found. Open your project manually."
217
+ msgid "Cannot read project data from csv. Open your project manually."
218
218
  msgstr ""
219
219
 
220
220
  #: pyfemtet/message/messages.py:100
221
+ msgid ".femprj file described in csv is not found. Open your project manually."
222
+ msgstr ""
223
+
224
+ #: pyfemtet/message/messages.py:101
221
225
  msgid "Analysis model name is not specified. Open your model in the project manually."
222
226
  msgstr ""
223
227
 
224
- #: pyfemtet/message/messages.py:102
228
+ #: pyfemtet/message/messages.py:103
225
229
  msgid "Constraint"
226
230
  msgstr ""
227
231
 
228
- #: pyfemtet/message/messages.py:103
232
+ #: pyfemtet/message/messages.py:104
229
233
  msgid "feasible"
230
234
  msgstr ""
231
235
 
232
- #: pyfemtet/message/messages.py:104
236
+ #: pyfemtet/message/messages.py:105
233
237
  msgid "infeasible"
234
238
  msgstr ""
235
239
 
236
- #: pyfemtet/message/messages.py:105
240
+ #: pyfemtet/message/messages.py:106
237
241
  msgid "Optimality"
238
242
  msgstr ""
239
243
 
240
- #: pyfemtet/message/messages.py:106
244
+ #: pyfemtet/message/messages.py:107
241
245
  msgid "non dominated"
242
246
  msgstr ""
243
247
 
244
- #: pyfemtet/message/messages.py:107
248
+ #: pyfemtet/message/messages.py:108
245
249
  msgid "dominated"
246
250
  msgstr ""
247
251
 
248
- #: pyfemtet/message/messages.py:108
252
+ #: pyfemtet/message/messages.py:109
249
253
  msgid "Hypervolume Plot"
250
254
  msgstr ""
251
255
 
252
- #: pyfemtet/message/messages.py:109
256
+ #: pyfemtet/message/messages.py:110
253
257
  msgid "Objective Plot"
254
258
  msgstr ""
255
259
 
256
- #: pyfemtet/message/messages.py:110
260
+ #: pyfemtet/message/messages.py:111
257
261
  msgid "Multi Objective Pair Plot"
258
262
  msgstr ""
259
263
 
260
- #: pyfemtet/message/messages.py:111
264
+ #: pyfemtet/message/messages.py:112
261
265
  msgid "trial number"
262
266
  msgstr ""
263
267
 
264
- #: pyfemtet/message/messages.py:113
268
+ #: pyfemtet/message/messages.py:114
265
269
  msgid "Objectives"
266
270
  msgstr ""
267
271
 
268
272
  #: pyfemtet/message/messages.py:115
273
+ msgid "Objectives (all)"
274
+ msgstr ""
275
+
276
+ #: pyfemtet/message/messages.py:117
269
277
  msgid "Prediction Model"
270
278
  msgstr ""
271
279
 
272
- #: pyfemtet/message/messages.py:116
280
+ #: pyfemtet/message/messages.py:118
273
281
  msgid " Recalculate Model"
274
282
  msgstr ""
275
283
 
276
- #: pyfemtet/message/messages.py:117
284
+ #: pyfemtet/message/messages.py:119
277
285
  msgid " Redraw graph"
278
286
  msgstr ""
279
287
 
280
- #: pyfemtet/message/messages.py:118
288
+ #: pyfemtet/message/messages.py:120
281
289
  msgid "Parameter"
282
290
  msgstr ""
283
291
 
284
- #: pyfemtet/message/messages.py:119
292
+ #: pyfemtet/message/messages.py:121
285
293
  msgid "Parameter2"
286
294
  msgstr ""
287
295
 
288
- #: pyfemtet/message/messages.py:120
296
+ #: pyfemtet/message/messages.py:122
289
297
  msgid "Objective"
290
298
  msgstr ""
291
299
 
292
- #: pyfemtet/message/messages.py:121
300
+ #: pyfemtet/message/messages.py:123
293
301
  msgid "No history selected."
294
302
  msgstr ""
295
303
 
296
- #: pyfemtet/message/messages.py:122
304
+ #: pyfemtet/message/messages.py:124
297
305
  msgid "No FEM result (yet)."
298
306
  msgstr ""
299
307
 
300
- #: pyfemtet/message/messages.py:123
308
+ #: pyfemtet/message/messages.py:125
301
309
  msgid "Prediction model is not calculated yet."
302
310
  msgstr ""
303
311
 
304
- #: pyfemtet/message/messages.py:124
312
+ #: pyfemtet/message/messages.py:126
305
313
  msgid "Cannot select same parameter"
306
314
  msgstr ""
307
315
 
308
- #: pyfemtet/message/messages.py:126
316
+ #: pyfemtet/message/messages.py:127
317
+ msgid "3D graph (two or more parameters required)"
318
+ msgstr ""
319
+
320
+ #: pyfemtet/message/messages.py:129
309
321
  msgid "Prediction Model of Objective"
310
322
  msgstr ""
311
323
 
312
- #: pyfemtet/message/messages.py:127
324
+ #: pyfemtet/message/messages.py:130
313
325
  msgid "prediction model"
314
326
  msgstr ""
315
327
 
316
- #: pyfemtet/message/messages.py:128
328
+ #: pyfemtet/message/messages.py:131
317
329
  msgid "std. dev. of model"
318
330
  msgstr ""
319
331
 
320
- #: pyfemtet/message/messages.py:130
332
+ #: pyfemtet/message/messages.py:133
321
333
  msgid "Progress"
322
334
  msgstr ""
323
335
 
324
- #: pyfemtet/message/messages.py:131
336
+ #: pyfemtet/message/messages.py:134
325
337
  msgid "Prediction"
326
338
  msgstr ""
327
339
 
328
- #: pyfemtet/message/messages.py:132
340
+ #: pyfemtet/message/messages.py:135
329
341
  msgid "Workers"
330
342
  msgstr ""
331
343
 
332
- #: pyfemtet/message/messages.py:134
344
+ #: pyfemtet/message/messages.py:136
345
+ msgid "Details"
346
+ msgstr ""
347
+
348
+ #: pyfemtet/message/messages.py:138
333
349
  msgid "Optimization status will be shown here."
334
350
  msgstr ""
335
351
 
336
- #: pyfemtet/message/messages.py:135
352
+ #: pyfemtet/message/messages.py:139
337
353
  msgid "Auto-update graph"
338
354
  msgstr ""
339
355
 
340
- #: pyfemtet/message/messages.py:136
356
+ #: pyfemtet/message/messages.py:140
341
357
  msgid "Interrupt Optimization"
342
358
  msgstr ""
343
359
 
344
- #: pyfemtet/message/messages.py:138
360
+ #: pyfemtet/message/messages.py:142
345
361
  msgid "Result"
346
362
  msgstr ""
347
363
 
348
- #: pyfemtet/message/messages.py:140
364
+ #: pyfemtet/message/messages.py:144
349
365
  msgid "Open Result in Femtet"
350
366
  msgstr ""
351
367
 
352
- #: pyfemtet/message/messages.py:141
368
+ #: pyfemtet/message/messages.py:145
353
369
  msgid "Reconstruct Model"
354
370
  msgstr ""
355
371
 
356
- #: pyfemtet/message/messages.py:142
372
+ #: pyfemtet/message/messages.py:146
357
373
  msgid "Drag and drop or select csv file"
358
374
  msgstr ""
359
375
 
360
- #: pyfemtet/message/messages.py:143
376
+ #: pyfemtet/message/messages.py:147
361
377
  msgid "Connection to Femtet is not established. Launch Femtet and Open a project."
362
378
  msgstr ""
363
379
 
364
- #: pyfemtet/message/messages.py:144
380
+ #: pyfemtet/message/messages.py:148
365
381
  msgid "No result plot is selected."
366
382
  msgstr ""
367
383
 
368
- #: pyfemtet/message/messages.py:145
384
+ #: pyfemtet/message/messages.py:149
369
385
  msgid "The femprj file path in the history csv is not found or valid."
370
386
  msgstr ""
371
387
 
372
- #: pyfemtet/message/messages.py:146
388
+ #: pyfemtet/message/messages.py:150
373
389
  msgid "The model name in the history csv is not found."
374
390
  msgstr ""
375
391
 
376
- #: pyfemtet/message/messages.py:147
392
+ #: pyfemtet/message/messages.py:151
377
393
  msgid ".pdt file is not found. Please check the .Results folder. Note that .pdt file save mode depends on the `save_pdt` argument of FemtetInterface in optimization script(default to `all`)."
378
394
  msgstr ""
379
395
 
380
- #: pyfemtet/message/messages.py:152
396
+ #: pyfemtet/message/messages.py:156
381
397
  msgid "Failed to open "
382
398
  msgstr ""
383
399
 
384
- #: pyfemtet/message/messages.py:153
400
+ #: pyfemtet/message/messages.py:157
385
401
  msgid "Specified model is not in current project. Please check opened project. For example, not \"analysis model only\" but your .femprj file."
386
402
  msgstr ""
387
403
 
388
- #: pyfemtet/message/messages.py:156
404
+ #: pyfemtet/message/messages.py:160
389
405
  msgid ".femprj file path of the history csv is invalid. Please certify matching between csv and opening .femprj file."
390
406
  msgstr ""
391
407
 
392
- #: pyfemtet/message/messages.py:157
408
+ #: pyfemtet/message/messages.py:161
393
409
  msgid "Analysis model name of the history csv is invalid. Please certify matching between csv and opening analysis model."
394
410
  msgstr ""
395
411
 
396
- #: pyfemtet/message/messages.py:158
412
+ #: pyfemtet/message/messages.py:162
397
413
  msgid "Analysis model name of the history csv and opened in Femtet is inconsistent. Please certify matching between csv and opening analysis model."
398
414
  msgstr ""
399
415
 
400
- #: pyfemtet/message/messages.py:159
416
+ #: pyfemtet/message/messages.py:163
401
417
  msgid "tutorial mode"
402
418
  msgstr ""
403
419
 
404
- #: pyfemtet/message/messages.py:160
420
+ #: pyfemtet/message/messages.py:164
405
421
  msgid "Load Sample CSV"
406
422
  msgstr ""
407
423
 
408
- #: pyfemtet/message/messages.py:161
424
+ #: pyfemtet/message/messages.py:165
409
425
  msgid "Load CSV"
410
426
  msgstr ""
411
427
 
412
- #: pyfemtet/message/messages.py:162
428
+ #: pyfemtet/message/messages.py:166
413
429
  msgid "Open your optimization result. Then connecting to femtet will start automatically. Note that in tutorial mode, this button loads the ready-made sample csv and open sample femprj."
414
430
  msgstr ""
415
431
 
416
- #: pyfemtet/message/messages.py:164
432
+ #: pyfemtet/message/messages.py:168
417
433
  msgid "Main Graph"
418
434
  msgstr ""
419
435
 
420
- #: pyfemtet/message/messages.py:165
436
+ #: pyfemtet/message/messages.py:169
421
437
  msgid "Here the optimization history is shown. Each plot represents single FEM result. You can pick a result to open the corresponding result in Femtet. "
422
438
  msgstr ""
423
439
 
424
- #: pyfemtet/message/messages.py:168
440
+ #: pyfemtet/message/messages.py:172
425
441
  msgid "Open Result"
426
442
  msgstr ""
427
443
 
428
- #: pyfemtet/message/messages.py:169
444
+ #: pyfemtet/message/messages.py:173
429
445
  msgid "After pick a point in the main graph, This button shows the corresponding FEM result in Femtet."
430
446
  msgstr ""
431
447
 
432
- #: pyfemtet/message/messages.py:171
448
+ #: pyfemtet/message/messages.py:175
433
449
  msgid "Re-connect to Femtet."
434
450
  msgstr ""
435
451
 
436
- #: pyfemtet/message/messages.py:172
452
+ #: pyfemtet/message/messages.py:176
437
453
  msgid "Sample csv is not found. Please consider to re-install pyfemtet by `py -m pip install pyfemtet -U --force-reinstall`"
438
454
  msgstr ""
439
455
 
440
- #: pyfemtet/message/messages.py:173
456
+ #: pyfemtet/message/messages.py:177
441
457
  msgid "Sample femprj file is not found. Please consider to re-install pyfemtet by `py -m pip install pyfemtet -U --force-reinstall`"
442
458
  msgstr ""
443
459
 
444
- #: pyfemtet/message/messages.py:174
460
+ #: pyfemtet/message/messages.py:178
445
461
  msgid "Sample femprj result folder is not found. Please consider to re-install pyfemtet by `py -m pip install pyfemtet -U --force-reinstall`"
446
462
  msgstr ""
447
463
 
464
+ #: pyfemtet/message/messages.py:180
465
+ msgid "Loading data..."
466
+ msgstr ""
467
+
468
+ #: pyfemtet/message/messages.py:181
469
+ msgid "Plots of objectives versus trials"
470
+ msgstr ""
471
+
472
+ #: pyfemtet/message/messages.py:182
473
+ msgid "The vertical axis is the objective, and the horizontal axis is the number of trials."
474
+ msgstr ""
475
+
476
+ #: pyfemtet/message/messages.py:183
477
+ msgid "Parallel coordinate plots"
478
+ msgstr ""
479
+
480
+ #: pyfemtet/message/messages.py:184
481
+ msgid "The vertical axis is an objective or parameters, and one polyline indicates one result."
482
+ msgstr ""
483
+
484
+ #: pyfemtet/message/messages.py:185
485
+ msgid "The heatmap of objectives"
486
+ msgstr ""
487
+
488
+ #: pyfemtet/message/messages.py:186
489
+ msgid "The axes are parameters, and the color shows objective value."
490
+ msgstr ""
491
+
492
+ #: pyfemtet/message/messages.py:187
493
+ msgid "The response of an objective versus one parameter"
494
+ msgstr ""
495
+
496
+ #: pyfemtet/message/messages.py:188
497
+ msgid "The vertical axis is objective, and the horizontal axis is parameter."
498
+ msgstr ""
499
+
@@ -82,7 +82,7 @@ class Message:
82
82
  ERR_JPG_NOT_FOUND = _('Screenshot (.jpg) is not found.')
83
83
  ERR_UPDATE_SOLIDWORKS_MODEL_FAILED = _('Failed to update model in solidworks.')
84
84
 
85
- # ===== pyfemtet.opt.opt =====
85
+ # ===== pyfemtet.opt.optimizer =====
86
86
  ERR_NOT_IMPLEMENTED = _('The following features are not supported by the specified optimization method. ')
87
87
  ERR_INCONSISTENT_PARAMETER = _('The parameter set does not match the one added with add_init_parameter.')
88
88
  INFO_EXCEPTION_DURING_FEM_ANALYSIS = _('An exception has occurred during FEM update. Current parameters are: ')
@@ -90,6 +90,9 @@ class Message:
90
90
  ERR_FEM_FAILED_AND_CANNOT_CONTINUE = _('Current parameter set cannot update FEM and this optimization method cannot skip current parameter set. The optimization process will be terminated.')
91
91
  WARN_INTERRUPTED_IN_SCIPY = _('Optimization has been interrupted. Note that you cannot acquire the OptimizationResult in case of `trust-constr`, `TNC`, `SLSQP` or `COBYLA`.')
92
92
  ERR_PARAMETER_CONSTRAINT_ONLY_BOTORCH = _('You can use parameter constraint only with BoTorchSampler.')
93
+ WARN_SCIPY_DOESNT_NEED_SEED = _('Scipy is deterministic, so whether you set a seed or not will not change the results.')
94
+ START_CANDIDATE_WITH_PARAMETER_CONSTRAINT = _('Start to candidate new parameter set with constraints. This process may take a long time.')
95
+ WARN_UPDATE_FEM_PARAMETER_TOOK_A_LONG_TIME = _('Updating FEM parameter during evaluating constraints take a long time. Please consider not to use FEM variables in constraint functions and set `update_fem` to False.')
93
96
 
94
97
  # ===== pyfemtet.opt.visualization =====
95
98
  # control_femtet.py
@@ -111,7 +114,8 @@ class Message:
111
114
  GRAPH_TITLE_MULTI_OBJECTIVE = _('Multi Objective Pair Plot')
112
115
  GRAPH_AXIS_LABEL_TRIAL = _('trial number')
113
116
  # main_graph.py
114
- TAB_LABEL_OBJECTIVES = _('Objectives')
117
+ TAB_LABEL_OBJECTIVE_PLOT = _('Objectives')
118
+ TAB_LABEL_OBJECTIVE_SCATTERPLOT = _('Objectives (all)')
115
119
  # pm_graph.py
116
120
  TAB_LABEL_PREDICTION_MODEL = _('Prediction Model')
117
121
  LABEL_OF_CREATE_PREDICTION_MODEL_BUTTON = _(' Recalculate Model')
pyfemtet/opt/__init__.py CHANGED
@@ -4,8 +4,8 @@ from pyfemtet.opt.interface import FemtetInterface
4
4
  from pyfemtet.opt.interface import FemtetWithNXInterface
5
5
  from pyfemtet.opt.interface import FemtetWithSolidworksInterface
6
6
 
7
- from pyfemtet.opt.opt import OptunaOptimizer, ScipyOptimizer
8
- from pyfemtet.opt.opt import AbstractOptimizer
7
+ from pyfemtet.opt.optimizer import OptunaOptimizer, ScipyOptimizer, ScipyScalarOptimizer
8
+ from pyfemtet.opt.optimizer import AbstractOptimizer
9
9
 
10
10
  from pyfemtet.opt._femopt import FEMOpt
11
11
 
@@ -19,4 +19,6 @@ __all__ = [
19
19
  'FemtetWithSolidworksInterface',
20
20
  'AbstractOptimizer',
21
21
  'OptunaOptimizer',
22
+ 'ScipyScalarOptimizer',
23
+ 'ScipyOptimizer',
22
24
  ]
pyfemtet/opt/_femopt.py CHANGED
@@ -16,11 +16,12 @@ from dask.distributed import LocalCluster, Client
16
16
 
17
17
  # pyfemtet relative
18
18
  from pyfemtet.opt.interface import FEMInterface, FemtetInterface
19
- from pyfemtet.opt.opt import AbstractOptimizer, OptunaOptimizer
19
+ from pyfemtet.opt.optimizer import AbstractOptimizer, OptunaOptimizer
20
20
  from pyfemtet.opt.visualization.process_monitor.application import main as process_monitor_main
21
21
  from pyfemtet.opt._femopt_core import (
22
22
  _check_bound,
23
23
  _is_access_gogh,
24
+ _is_access_femtet,
24
25
  Objective,
25
26
  Constraint,
26
27
  History,
@@ -98,9 +99,9 @@ class FEMOpt:
98
99
  self.fem = fem
99
100
 
100
101
  if opt is None:
101
- self.opt = OptunaOptimizer()
102
+ self.opt: AbstractOptimizer = OptunaOptimizer()
102
103
  else:
103
- self.opt = opt
104
+ self.opt: AbstractOptimizer = opt
104
105
 
105
106
  # メンバーの宣言
106
107
  self.client = None
@@ -260,6 +261,7 @@ class FEMOpt:
260
261
  strict: bool = True,
261
262
  args: tuple or None = None,
262
263
  kwargs: dict or None = None,
264
+ using_fem: bool = None,
263
265
  ):
264
266
  """Adds a constraint to the optimization problem.
265
267
 
@@ -271,6 +273,7 @@ class FEMOpt:
271
273
  strict (bool, optional): Flag indicating if it is a strict constraint. Defaults to True.
272
274
  args (tuple or None, optional): Additional arguments for the constraint function. Defaults to None.
273
275
  kwargs (dict): Additional arguments for the constraint function. Defaults to None.
276
+ using_fem (bool, optional): Using FEM or not in the constraint function. It may make the processing time in strict constraints in BoTorchSampler. Defaults to None. If None, PyFemtet checks the access to Femtet and estimate using Femtet or not automatically.
274
277
 
275
278
  Note:
276
279
  If the FEMInterface is FemtetInterface, the 1st argument of fun should be Femtet (IPyDispatch) object.
@@ -298,55 +301,33 @@ class FEMOpt:
298
301
  else:
299
302
  i += 1
300
303
  name = candidate
304
+ if using_fem is None:
305
+ # 自動推定機能は Femtet 特有の処理とする
306
+ if isinstance(self.fem, FemtetInterface):
307
+ using_fem = _is_access_femtet(fun)
308
+ else:
309
+ using_fem = False
301
310
 
302
311
  # strict constraint の場合、solve 前に評価したいので Gogh へのアクセスを禁ずる
303
- if strict:
312
+ if strict and isinstance(self.fem, FemtetInterface):
304
313
  if _is_access_gogh(fun):
305
314
  message = Msg.ERR_CONTAIN_GOGH_ACCESS_IN_STRICT_CONSTRAINT
306
315
  raise Exception(message)
307
316
 
308
- self.opt.constraints[name] = Constraint(fun, name, lower_bound, upper_bound, strict, args, kwargs)
309
-
310
- def add_parameter_constraint(
311
- self,
312
- fun: Callable[[List[float], Any], float],
313
- name: Optional[str] = None,
314
- lower_bound: Optional[float] = None,
315
- upper_bound: Optional[float] = None,
316
- ):
317
- """Add constraint in case of parameter-only.
318
-
319
- Args:
320
- fun (Callable[[List[float], Any], float]): Function to constraint. The name of arguments must be one of ones of parameter or variables.
321
- name (Optional[str], optional): Name of constraint. Defaults to None and then name is set to 'cns_{i}'.
322
- lower_bound (Optional[float], optional): Lower bound of return value. Defaults to None.
323
- upper_bound (Optional[float], optional): Upper bound of return value. Defaults to None.
324
- """
325
-
326
- # candidate default name
327
- if name is None:
328
- prefix = Constraint.default_name
329
- i = 0
330
- while True:
331
- candidate = f'{prefix}_{str(int(i))}'
332
- is_existing = candidate in list(self.opt.constraints.keys())
333
- if not is_existing:
334
- break
335
- else:
336
- i += 1
337
- name = candidate
338
-
339
- # assert at least 1 bound exist
340
- assert lower_bound is not None or upper_bound is not None, Msg.ERR_NO_BOUNDS
341
-
342
- from pyfemtet.opt._femopt_core import ParameterConstraint
343
- self.opt.constraints[name] = ParameterConstraint(fun, name, lower_bound, upper_bound, self.opt)
344
- if hasattr(self.opt, 'add_parameter_constraints'):
345
- prm_args = [p.name for p in inspect.signature(fun).parameters.values()]
346
- if lower_bound is not None:
347
- self.opt.add_parameter_constraints(lambda *args, **kwargs: fun(*args, **kwargs) - lower_bound, prm_args=prm_args)
348
- if upper_bound is not None:
349
- self.opt.add_parameter_constraints(lambda *args, **kwargs: upper_bound - fun(*args, **kwargs), prm_args=prm_args)
317
+ # strict constraint かつ BoTorchSampler の場合、
318
+ # 最適化実行時に monkey patch を実行するフラグを立てる。
319
+ # ただし using_fem が True ならば非常に低速なので警告を出す。
320
+ if strict and isinstance(self.opt, OptunaOptimizer):
321
+ self.opt: OptunaOptimizer
322
+ from optuna_integration import BoTorchSampler
323
+ if issubclass(self.opt.sampler_class, BoTorchSampler):
324
+ # パッチ実行フラグ
325
+ self.opt._do_monkey_patch = True
326
+ # 警告
327
+ if using_fem:
328
+ logger.warning(Msg.WARN_UPDATE_FEM_PARAMETER_TOOK_A_LONG_TIME)
329
+
330
+ self.opt.constraints[name] = Constraint(fun, name, lower_bound, upper_bound, strict, args, kwargs, using_fem)
350
331
 
351
332
  def get_parameter(self, format='dict'):
352
333
  raise DeprecationWarning('FEMOpt.get_parameter() was deprecated. Use Femopt.opt.get_parameter() instead.')