pyfemtet 0.8.11__py3-none-any.whl → 0.8.13__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 +1 -1
- pyfemtet/_message/locales/ja/LC_MESSAGES/messages.mo +0 -0
- pyfemtet/_message/locales/ja/LC_MESSAGES/messages.po +3 -3
- pyfemtet/_message/locales/messages.pot +2 -2
- pyfemtet/_message/messages.py +1 -1
- pyfemtet/opt/_femopt_core.py +1 -1
- pyfemtet/opt/interface/_base.py +1 -1
- pyfemtet/opt/interface/_femtet.py +27 -3
- {pyfemtet-0.8.11.dist-info → pyfemtet-0.8.13.dist-info}/METADATA +1 -1
- {pyfemtet-0.8.11.dist-info → pyfemtet-0.8.13.dist-info}/RECORD +13 -13
- {pyfemtet-0.8.11.dist-info → pyfemtet-0.8.13.dist-info}/LICENSE +0 -0
- {pyfemtet-0.8.11.dist-info → pyfemtet-0.8.13.dist-info}/WHEEL +0 -0
- {pyfemtet-0.8.11.dist-info → pyfemtet-0.8.13.dist-info}/entry_points.txt +0 -0
pyfemtet/__init__.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
__version__ = "0.8.
|
|
1
|
+
__version__ = "0.8.13"
|
|
Binary file
|
|
@@ -7,7 +7,7 @@ msgid ""
|
|
|
7
7
|
msgstr ""
|
|
8
8
|
"Project-Id-Version: PROJECT VERSION\n"
|
|
9
9
|
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
|
|
10
|
-
"POT-Creation-Date: 2025-
|
|
10
|
+
"POT-Creation-Date: 2025-03-05 12:41+0900\n"
|
|
11
11
|
"PO-Revision-Date: 2024-07-22 14:05+0900\n"
|
|
12
12
|
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
|
13
13
|
"Language: ja\n"
|
|
@@ -79,8 +79,8 @@ msgid "Model update failed."
|
|
|
79
79
|
msgstr "モデル更新に失敗しました。"
|
|
80
80
|
|
|
81
81
|
#: pyfemtet/_message/messages.py:60
|
|
82
|
-
msgid "It was detected that the configuration of Femtet python macro constants has not been completed. The configuration was done automatically (python -m win32com.client.makepy FemtetMacro). Please restart the program."
|
|
83
|
-
msgstr "Femtet マクロの定数の設定が未完了であることが検出され、設定コマンド(python -m win32com.client.makepy FemtetMacro
|
|
82
|
+
msgid "It was detected that the configuration of Femtet python macro constants has not been completed. The configuration was done automatically (python -m win32com.client.makepy FemtetMacro). Please restart the program. If the error persists, please run \"py -m win32com.client.makepy FemtetMacro\" or \"python -m win32com.client.makepy FemtetMacro\" on the command prompt."
|
|
83
|
+
msgstr "Femtet マクロの定数の設定が未完了であることが検出され、設定コマンド(python -m win32com.client.makepy FemtetMacro)が自動実行されました。プログラムを再実行してください。もしエラーが解消されない場合は、コマンドプロンプトで「py -m win32com.client.makepy FemtetMacro」または「python -m win32com.client.makepy FemtetMacro」を実行してください。"
|
|
84
84
|
|
|
85
85
|
#: pyfemtet/_message/messages.py:61
|
|
86
86
|
msgid "Failed to connect to Femtet."
|
|
@@ -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: 2025-
|
|
11
|
+
"POT-Creation-Date: 2025-03-05 12:41+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"
|
|
@@ -78,7 +78,7 @@ msgid "Model update failed."
|
|
|
78
78
|
msgstr ""
|
|
79
79
|
|
|
80
80
|
#: pyfemtet/_message/messages.py:60
|
|
81
|
-
msgid "It was detected that the configuration of Femtet python macro constants has not been completed. The configuration was done automatically (python -m win32com.client.makepy FemtetMacro). Please restart the program."
|
|
81
|
+
msgid "It was detected that the configuration of Femtet python macro constants has not been completed. The configuration was done automatically (python -m win32com.client.makepy FemtetMacro). Please restart the program. If the error persists, please run \"py -m win32com.client.makepy FemtetMacro\" or \"python -m win32com.client.makepy FemtetMacro\" on the command prompt."
|
|
82
82
|
msgstr ""
|
|
83
83
|
|
|
84
84
|
#: pyfemtet/_message/messages.py:61
|
pyfemtet/_message/messages.py
CHANGED
|
@@ -57,7 +57,7 @@ class Message:
|
|
|
57
57
|
ERR_RUN_JOURNAL_NOT_FOUND = _(r'"%UGII_BASE_DIR%\NXBIN\run_journal.exe" is not found. Make sure you have NX installed and the environment variable UGII_BASE_DIR is set.')
|
|
58
58
|
ERR_MODEL_RECONSTRUCTION_FAILED = _('Model reconstruction failed.')
|
|
59
59
|
ERR_MODEL_UPDATE_FAILED = _('Model update failed.')
|
|
60
|
-
ERR_NO_MAKEPY = _('It was detected that the configuration of Femtet python macro constants has not been completed. The configuration was done automatically (python -m win32com.client.makepy FemtetMacro). Please restart the program.')
|
|
60
|
+
ERR_NO_MAKEPY = _('It was detected that the configuration of Femtet python macro constants has not been completed. The configuration was done automatically (python -m win32com.client.makepy FemtetMacro). Please restart the program. If the error persists, please run "py -m win32com.client.makepy FemtetMacro" or "python -m win32com.client.makepy FemtetMacro" on the command prompt.')
|
|
61
61
|
ERR_FEMTET_CONNECTION_FAILED = _('Failed to connect to Femtet.')
|
|
62
62
|
ERR_FEMTET_CRASHED_AND_RESTART_FAILED = _('The Femtet process crashed and could not be restarted successfully.')
|
|
63
63
|
WARN_FEMTET_CRASHED_AND_TRY_RESTART = _('An abnormal termination of the Femtet process has been detected. Recovery will be attempted.')
|
pyfemtet/opt/_femopt_core.py
CHANGED
|
@@ -817,7 +817,7 @@ class History:
|
|
|
817
817
|
df = self.get_df()
|
|
818
818
|
trial = df['trial'].values[-1]
|
|
819
819
|
client = get_client() # always returns valid client
|
|
820
|
-
client.run_on_scheduler(postprocess_func, trial, **postprocess_args)
|
|
820
|
+
client.run_on_scheduler(postprocess_func, *(trial, df), **postprocess_args)
|
|
821
821
|
|
|
822
822
|
def _calc_non_domi(self, objectives, df):
|
|
823
823
|
|
pyfemtet/opt/interface/_base.py
CHANGED
|
@@ -84,7 +84,7 @@ class FEMInterface(ABC):
|
|
|
84
84
|
"""Preprocessing after launching a dask worker and before run optimization (if implemented in concrete class)."""
|
|
85
85
|
pass
|
|
86
86
|
|
|
87
|
-
def _postprocess_func(self, trial: int, *args, dask_scheduler=None, **kwargs):
|
|
87
|
+
def _postprocess_func(self, trial: int, df: pd.DataFrame, *args, dask_scheduler=None, **kwargs):
|
|
88
88
|
pass
|
|
89
89
|
|
|
90
90
|
def _create_postprocess_args(self):
|
|
@@ -5,9 +5,11 @@ import os
|
|
|
5
5
|
import sys
|
|
6
6
|
from time import sleep, time
|
|
7
7
|
import winreg
|
|
8
|
+
import subprocess
|
|
8
9
|
|
|
9
10
|
import pandas as pd
|
|
10
11
|
import psutil
|
|
12
|
+
import shutil
|
|
11
13
|
from dask.distributed import get_worker
|
|
12
14
|
|
|
13
15
|
# noinspection PyUnresolvedReferences
|
|
@@ -54,6 +56,9 @@ class FailedToPostProcess(Exception):
|
|
|
54
56
|
pass
|
|
55
57
|
|
|
56
58
|
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
|
|
57
62
|
class FemtetInterface(FEMInterface):
|
|
58
63
|
"""Control Femtet from optimizer.
|
|
59
64
|
|
|
@@ -73,7 +78,8 @@ class FemtetInterface(FEMInterface):
|
|
|
73
78
|
|
|
74
79
|
save_pdt (str, optional):
|
|
75
80
|
The type to save result file.
|
|
76
|
-
|
|
81
|
+
Valid values are 'all', 'none' or 'optimal'.
|
|
82
|
+
Default is 'all'.
|
|
77
83
|
|
|
78
84
|
strictly_pid_specify (bool, optional):
|
|
79
85
|
Whether to strictly specify the PID in Femtet connection.
|
|
@@ -124,7 +130,7 @@ class FemtetInterface(FEMInterface):
|
|
|
124
130
|
femprj_path: str = None,
|
|
125
131
|
model_name: str = None,
|
|
126
132
|
connect_method: str = 'auto', # dask worker では __init__ の中で 'new' にするので super() の引数にしない。(しても意味がない)
|
|
127
|
-
save_pdt: str = 'all', # 'all' or
|
|
133
|
+
save_pdt: str = 'all', # 'all', 'none' or 'optimal'
|
|
128
134
|
strictly_pid_specify: bool = True, # dask worker では True にしたいので super() の引数にしない。
|
|
129
135
|
allow_without_project: bool = False, # main でのみ True を許容したいので super() の引数にしない。
|
|
130
136
|
open_result_with_gui: bool = True,
|
|
@@ -301,7 +307,7 @@ class FemtetInterface(FEMInterface):
|
|
|
301
307
|
# ensure makepy
|
|
302
308
|
if not hasattr(constants, 'STATIC_C'):
|
|
303
309
|
cmd = f'{sys.executable} -m win32com.client.makepy FemtetMacro'
|
|
304
|
-
|
|
310
|
+
subprocess.run(cmd, shell=True)
|
|
305
311
|
message = Msg.ERR_NO_MAKEPY
|
|
306
312
|
logger.error('================')
|
|
307
313
|
logger.error(message)
|
|
@@ -834,6 +840,7 @@ class FemtetInterface(FEMInterface):
|
|
|
834
840
|
model_name=self.model_name,
|
|
835
841
|
pdt_file_content=file_content,
|
|
836
842
|
jpg_file_content=jpg_content,
|
|
843
|
+
save_results=self.save_pdt, # 'all', 'optimal' or 'none'
|
|
837
844
|
)
|
|
838
845
|
return out
|
|
839
846
|
|
|
@@ -847,12 +854,20 @@ class FemtetInterface(FEMInterface):
|
|
|
847
854
|
@staticmethod
|
|
848
855
|
def _postprocess_func(
|
|
849
856
|
trial: int,
|
|
857
|
+
df: pd.DataFrame,
|
|
850
858
|
original_femprj_path: str,
|
|
859
|
+
save_results: str,
|
|
851
860
|
model_name: str,
|
|
852
861
|
pdt_file_content=None,
|
|
853
862
|
jpg_file_content=None,
|
|
854
863
|
dask_scheduler=None
|
|
855
864
|
):
|
|
865
|
+
|
|
866
|
+
# none なら何もしない
|
|
867
|
+
if save_results.lower() == 'none':
|
|
868
|
+
return
|
|
869
|
+
|
|
870
|
+
# all or optimal ならいったん保存する
|
|
856
871
|
result_dir = original_femprj_path.replace('.femprj', '.Results')
|
|
857
872
|
if pdt_file_content is not None:
|
|
858
873
|
pdt_path = FemtetInterface._create_pdt_path(original_femprj_path, model_name, trial)
|
|
@@ -864,6 +879,15 @@ class FemtetInterface(FEMInterface):
|
|
|
864
879
|
with open(jpg_path, 'wb') as f:
|
|
865
880
|
f.write(jpg_file_content)
|
|
866
881
|
|
|
882
|
+
# optimal なら不要ファイルの削除を実行する
|
|
883
|
+
if save_results.lower() == 'optimal':
|
|
884
|
+
for i, row in df.iterrows():
|
|
885
|
+
if not bool(row['non_domi']):
|
|
886
|
+
trial_to_remove = int(row['trial'])
|
|
887
|
+
pdt_path_to_remove = FemtetInterface._create_pdt_path(original_femprj_path, model_name, trial_to_remove)
|
|
888
|
+
if os.path.isfile(pdt_path_to_remove):
|
|
889
|
+
os.remove(pdt_path_to_remove)
|
|
890
|
+
|
|
867
891
|
def _create_result_file_content(self):
|
|
868
892
|
"""Called after solve"""
|
|
869
893
|
if self.save_pdt == 'all':
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
pyfemtet/__init__.py,sha256=
|
|
1
|
+
pyfemtet/__init__.py,sha256=n90UezNAM33B32NB_3LmwZMjC60o-5hKyMaeY9L9olc,22
|
|
2
2
|
pyfemtet/_femtet_config_util/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
3
3
|
pyfemtet/_femtet_config_util/autosave.py,sha256=dNirA9XGuFehas8_Jkj2BW9GOzMbPyhnt1WHcH_ObSU,2070
|
|
4
4
|
pyfemtet/_femtet_config_util/exit.py,sha256=0BWID-tjOkmZwmgPFkcJMkWW39voccz5ARIBWvZbHaw,1877
|
|
@@ -6,10 +6,10 @@ pyfemtet/_message/1. make_pot.bat,sha256=wrTA0YaL7nUfNB0cS8zljOmwq2qgyG6RMwHQbrw
|
|
|
6
6
|
pyfemtet/_message/2. make_mo.bat,sha256=6shJ3Yn4BXjDc0hhv_kiGUtVTq4oSRz8-iS4vW29rNE,155
|
|
7
7
|
pyfemtet/_message/__init__.py,sha256=gE1-XX_PzHj9BbhqPaK5VcIHuv6_Tec5qlPMC3IRiBg,100
|
|
8
8
|
pyfemtet/_message/babel.cfg,sha256=AQIFCQ7NlAA84PhV0gowHhbIXH41zA55mzhgyROniJk,73
|
|
9
|
-
pyfemtet/_message/locales/ja/LC_MESSAGES/messages.mo,sha256
|
|
10
|
-
pyfemtet/_message/locales/ja/LC_MESSAGES/messages.po,sha256=
|
|
11
|
-
pyfemtet/_message/locales/messages.pot,sha256=
|
|
12
|
-
pyfemtet/_message/messages.py,sha256=
|
|
9
|
+
pyfemtet/_message/locales/ja/LC_MESSAGES/messages.mo,sha256=-NK_RbmdKtl51Vwjz-fToT16LaY-oskCmQokgPruFJ8,19875
|
|
10
|
+
pyfemtet/_message/locales/ja/LC_MESSAGES/messages.po,sha256=WjA_LAT8L8PcplzHjo9lnGsA-oou_PxdK96nLeT1gIc,26414
|
|
11
|
+
pyfemtet/_message/locales/messages.pot,sha256=7t_X5bq1yo9Www5CKEmswuSNhziDeDBV3qF9pKEqlhs,15526
|
|
12
|
+
pyfemtet/_message/messages.py,sha256=UuB8Q6kXk7z6ahmKYySIIhiYsDPyY7dC6s8COTWAS3k,14335
|
|
13
13
|
pyfemtet/_util/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
14
14
|
pyfemtet/_util/dask_util.py,sha256=ufgr4m8slvyWP97lWBwolysQpJ1PmAO_-OI8IlEyvU8,233
|
|
15
15
|
pyfemtet/_util/excel_macro_util.py,sha256=cF1Z3yl9FMM0J7dpMRTsle8uYxYcfHhQC0QffnVovdY,7944
|
|
@@ -25,7 +25,7 @@ pyfemtet/logger/__init__.py,sha256=UOJ9n_U2xwdTrp0Xgg-N6geySxNzKqTBQlXsaH0kW_w,4
|
|
|
25
25
|
pyfemtet/logger/_impl.py,sha256=rsAd0HpmveOaLS39ucp3U2OcDhQMWjC5fnVGhbJtWVw,6375
|
|
26
26
|
pyfemtet/opt/__init__.py,sha256=wRR8LbEhb5I6MUgmnCgjB6-tqHlOVxDIo7yPkq0QbBs,758
|
|
27
27
|
pyfemtet/opt/_femopt.py,sha256=MSqSJzyD2sRYBNQAe0P5rpSvvVihOV2ugUa-hZyYnBA,40671
|
|
28
|
-
pyfemtet/opt/_femopt_core.py,sha256=
|
|
28
|
+
pyfemtet/opt/_femopt_core.py,sha256=AFHxZSVke1jpHAsdJtN_lY015TL5ipXO9qfZ8zYGL8g,39373
|
|
29
29
|
pyfemtet/opt/_test_utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
30
30
|
pyfemtet/opt/_test_utils/control_femtet.py,sha256=8oAl9y5V2n8Nnsgx_ebcZVzwFt1eI3swkdiKg6pg3-M,1085
|
|
31
31
|
pyfemtet/opt/_test_utils/hyper_sphere.py,sha256=nQhw8EIY0DwvcTqrbKhkxiITLZifr4-nG77E-_6ggmA,700
|
|
@@ -43,9 +43,9 @@ pyfemtet/opt/advanced_samples/surrogate_model/gal_ex13_optimize_with_surrogate.p
|
|
|
43
43
|
pyfemtet/opt/advanced_samples/surrogate_model/gal_ex13_optimize_with_surrogate_jp.py,sha256=OAOpHKyMMo1StSqNMqx4saYDn4hiGOKDypyK6uhTILQ,3215
|
|
44
44
|
pyfemtet/opt/advanced_samples/surrogate_model/gal_ex13_parametric.femprj,sha256=iIHH1X-wWBqEYj4cFJXco73LCJXSrYBsSKOD0HxYu60,87599
|
|
45
45
|
pyfemtet/opt/interface/__init__.py,sha256=SstCN9WMYqF5lKNbb8xAzq0hBV-Hk8YuCrajvF3sOg0,1350
|
|
46
|
-
pyfemtet/opt/interface/_base.py,sha256=
|
|
46
|
+
pyfemtet/opt/interface/_base.py,sha256=hDv4C8LQpKaeZJR8iEfTSVd4Na2fQblFBv0Yw78xcRY,2856
|
|
47
47
|
pyfemtet/opt/interface/_excel_interface.py,sha256=1PYB056rU2mX-LgBWRwwTUxDkt7crgHAk3fKJuMNMMU,40152
|
|
48
|
-
pyfemtet/opt/interface/_femtet.py,sha256=
|
|
48
|
+
pyfemtet/opt/interface/_femtet.py,sha256=Y1t_GY_W0ivR6obv8eiMx1_-OoJFTjQAvhnoUkIMaaQ,38657
|
|
49
49
|
pyfemtet/opt/interface/_femtet_excel.py,sha256=dWPQguKNOVdJ4jTfwLykCeM9iwA2S1KOLynw8UGzmvk,5968
|
|
50
50
|
pyfemtet/opt/interface/_femtet_parametric.py,sha256=hxNiZfhR1IPtrMXg39TZutXTcOXdoxTKiRTTcYRGgVs,10181
|
|
51
51
|
pyfemtet/opt/interface/_femtet_with_nx/__init__.py,sha256=-6W2g2FDEcKzGHmI5KAKQe-4U5jDpMj0CXuma-GZca0,83
|
|
@@ -148,8 +148,8 @@ pyfemtet/opt/visualization/result_viewer/.gitignore,sha256=ryvb4aqbbsHireHWlPQfx
|
|
|
148
148
|
pyfemtet/opt/visualization/result_viewer/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
149
149
|
pyfemtet/opt/visualization/result_viewer/application.py,sha256=WcHBx_J5eNLKSaprpk9BGifwhO04oN8FiNGYTWorrXA,1691
|
|
150
150
|
pyfemtet/opt/visualization/result_viewer/pages.py,sha256=MZAjzbuq0toZrR-iJhElM3A12_jHVCTt65gz1kdNPbw,32193
|
|
151
|
-
pyfemtet-0.8.
|
|
152
|
-
pyfemtet-0.8.
|
|
153
|
-
pyfemtet-0.8.
|
|
154
|
-
pyfemtet-0.8.
|
|
155
|
-
pyfemtet-0.8.
|
|
151
|
+
pyfemtet-0.8.13.dist-info/LICENSE,sha256=sVQBhyoglGJUu65-BP3iR6ujORI6YgEU2Qm-V4fGlOA,1485
|
|
152
|
+
pyfemtet-0.8.13.dist-info/METADATA,sha256=bUXnv1egGK3lCJUXit-_WM6Ho16ZoLmMTIUmf-GEuYQ,3549
|
|
153
|
+
pyfemtet-0.8.13.dist-info/WHEEL,sha256=XbeZDeTWKc1w7CSIyre5aMDU_-PohRwTQceYnisIYYY,88
|
|
154
|
+
pyfemtet-0.8.13.dist-info/entry_points.txt,sha256=ZfYqRaoiPtuWqFi2_msccyrVF0LurMn-IHlYamAegZo,104
|
|
155
|
+
pyfemtet-0.8.13.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|