pyfemtet 0.8.17__py3-none-any.whl → 0.8.19__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/opt/_femopt_core.py +27 -25
- pyfemtet/opt/interface/__init__.py +1 -1
- pyfemtet/opt/interface/_excel_interface.py +21 -0
- {pyfemtet-0.8.17.dist-info → pyfemtet-0.8.19.dist-info}/METADATA +1 -1
- {pyfemtet-0.8.17.dist-info → pyfemtet-0.8.19.dist-info}/RECORD +10 -10
- {pyfemtet-0.8.17.dist-info → pyfemtet-0.8.19.dist-info}/LICENSE +0 -0
- {pyfemtet-0.8.17.dist-info → pyfemtet-0.8.19.dist-info}/LICENSE_THIRD_PARTY.txt +0 -0
- {pyfemtet-0.8.17.dist-info → pyfemtet-0.8.19.dist-info}/WHEEL +0 -0
- {pyfemtet-0.8.17.dist-info → pyfemtet-0.8.19.dist-info}/entry_points.txt +0 -0
pyfemtet/__init__.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
__version__ = "0.8.
|
|
1
|
+
__version__ = "0.8.19"
|
pyfemtet/opt/_femopt_core.py
CHANGED
|
@@ -832,39 +832,41 @@ class History:
|
|
|
832
832
|
for obj_column, (_, objective) in zip(self.obj_names, objectives.items()):
|
|
833
833
|
solution_set.loc[:, obj_column] = solution_set[obj_column].map(objective.convert)
|
|
834
834
|
|
|
835
|
-
#
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
for i, row in enumerate(non_domi_row):
|
|
846
|
-
print('=====')
|
|
847
|
-
print(row) # その非劣解について
|
|
848
|
-
print('-----')
|
|
849
|
-
is_true_non_domi = []
|
|
850
|
-
for j, other_row in enumerate(non_domi_row):
|
|
835
|
+
# 非劣解(改)の計算
|
|
836
|
+
# 「全ての項目において
|
|
837
|
+
# 重複する解を除いて
|
|
838
|
+
# より優れているか又は同等である
|
|
839
|
+
# 他の解が存在しない解」であるかどうかを判定
|
|
840
|
+
non_domi = []
|
|
841
|
+
row: np.ndarray
|
|
842
|
+
another: np.ndarray
|
|
843
|
+
for i, row in enumerate(solution_set.values):
|
|
844
|
+
for j, another in enumerate(solution_set.values):
|
|
851
845
|
if i == j:
|
|
846
|
+
# 他と比べたいので
|
|
852
847
|
continue
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
848
|
+
elif np.allclose(row, another):
|
|
849
|
+
# 重複してたら他の解との比較に
|
|
850
|
+
# 判定を委ねたいので
|
|
851
|
+
continue
|
|
852
|
+
elif all(another <= row):
|
|
853
|
+
# 全項目について
|
|
854
|
+
# another のほうが
|
|
855
|
+
# 優れているか又は同等である
|
|
856
|
+
non_domi.append(False)
|
|
857
|
+
break
|
|
858
|
+
else:
|
|
859
|
+
# 全項目について優れているか又は
|
|
860
|
+
# 同等であるような他の解が
|
|
861
|
+
# 存在しなかった
|
|
862
|
+
non_domi.append(True)
|
|
861
863
|
|
|
862
864
|
# feasible も infeasible も一旦劣解にする
|
|
863
865
|
df['non_domi'] = False
|
|
864
866
|
|
|
865
867
|
# feasible のものに non_domi の評価結果を代入する
|
|
866
868
|
if len(non_domi) > 0:
|
|
867
|
-
df.loc[idx, 'non_domi'] =
|
|
869
|
+
df.loc[idx, 'non_domi'] = non_domi
|
|
868
870
|
|
|
869
871
|
def _calc_hypervolume(self, objectives, df):
|
|
870
872
|
|
|
@@ -19,7 +19,7 @@ else:
|
|
|
19
19
|
FemtetInterface = type('FemtetInterface', (NotAvailableForWindows,), {})
|
|
20
20
|
FemtetWithSolidworksInterface = type('FemtetWithSolidworksInterface', (FemtetInterface,), {})
|
|
21
21
|
FemtetWithNXInterface = type('FemtetWithNXInterface', (FemtetInterface,), {})
|
|
22
|
-
ExcelInterface = type('
|
|
22
|
+
ExcelInterface = type('ExcelInterface', (NotAvailableForWindows,), {})
|
|
23
23
|
|
|
24
24
|
from pyfemtet.opt.interface._surrogate._base import SurrogateModelInterfaceBase
|
|
25
25
|
from pyfemtet.opt.interface._surrogate._singletaskgp import PoFBoTorchInterface
|
|
@@ -222,6 +222,8 @@ class ExcelInterface(FEMInterface):
|
|
|
222
222
|
|
|
223
223
|
use_named_range: bool # input を定義したシートにおいて input の値を名前付き範囲で指定するかどうか。
|
|
224
224
|
|
|
225
|
+
force_override_when_load: bool = False # .py で add_... されている変数などを Excel の内容で上書きするかどうか。
|
|
226
|
+
|
|
225
227
|
def __init__(
|
|
226
228
|
self,
|
|
227
229
|
input_xlsm_path: str or Path,
|
|
@@ -751,6 +753,13 @@ class ExcelInterface(FEMInterface):
|
|
|
751
753
|
# name
|
|
752
754
|
name = str(row[ParseAsParameter.name])
|
|
753
755
|
|
|
756
|
+
# if the variable is already added by
|
|
757
|
+
# add_parameter or add_expression,
|
|
758
|
+
# use it.
|
|
759
|
+
if not self.force_override_when_load:
|
|
760
|
+
if name in opt.variables.get_variables():
|
|
761
|
+
continue
|
|
762
|
+
|
|
754
763
|
# value
|
|
755
764
|
value = float(row[ParseAsParameter.value])
|
|
756
765
|
|
|
@@ -821,6 +830,12 @@ class ExcelInterface(FEMInterface):
|
|
|
821
830
|
# name
|
|
822
831
|
name = str(row[ParseAsObjective.name])
|
|
823
832
|
|
|
833
|
+
# if the objective is already added by
|
|
834
|
+
# add_objective, use it.
|
|
835
|
+
if not self.force_override_when_load:
|
|
836
|
+
if name in opt.objectives.keys():
|
|
837
|
+
continue
|
|
838
|
+
|
|
824
839
|
# direction
|
|
825
840
|
direction = row[ParseAsObjective.direction]
|
|
826
841
|
assert not is_cell_value_empty(direction), 'direction is empty.'
|
|
@@ -865,6 +880,12 @@ class ExcelInterface(FEMInterface):
|
|
|
865
880
|
# name
|
|
866
881
|
name = str(row[ParseAsConstraint.name])
|
|
867
882
|
|
|
883
|
+
# if the constraint is already added by
|
|
884
|
+
# add_constraint, use it.
|
|
885
|
+
if not self.force_override_when_load:
|
|
886
|
+
if name in opt.constraints.keys():
|
|
887
|
+
continue
|
|
888
|
+
|
|
868
889
|
# lb (optional)
|
|
869
890
|
lb = None
|
|
870
891
|
if ParseAsConstraint.lb in df.columns:
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
pyfemtet/__init__.py,sha256=
|
|
1
|
+
pyfemtet/__init__.py,sha256=aUe-EB_M3W0_VTAYzfZXTNkOENGYVr6j7OzD_Nrrafc,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
|
|
@@ -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=zweGfu4DBr_aG0IPZHG09oQWcHLWU4EqcbQIHKAfs-4,40386
|
|
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
|
|
@@ -42,9 +42,9 @@ pyfemtet/opt/advanced_samples/surrogate_model/gal_ex13_create_training_data_jp.p
|
|
|
42
42
|
pyfemtet/opt/advanced_samples/surrogate_model/gal_ex13_optimize_with_surrogate.py,sha256=s0b31wuN3iXjb78dt0ro0ZjxHa8uLIH94jRfEuj1EVY,3090
|
|
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
|
-
pyfemtet/opt/interface/__init__.py,sha256=
|
|
45
|
+
pyfemtet/opt/interface/__init__.py,sha256=Bb4ifydHpclE_jwbmXm_DC6AYCN2rdWucN2raBITJPY,1349
|
|
46
46
|
pyfemtet/opt/interface/_base.py,sha256=hDv4C8LQpKaeZJR8iEfTSVd4Na2fQblFBv0Yw78xcRY,2856
|
|
47
|
-
pyfemtet/opt/interface/_excel_interface.py,sha256=
|
|
47
|
+
pyfemtet/opt/interface/_excel_interface.py,sha256=l4t6uM64-E7E5EvTKhPh0kSdUW-boyXy72VqcjlgRNs,41009
|
|
48
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
|
|
@@ -150,9 +150,9 @@ pyfemtet/opt/visualization/result_viewer/.gitignore,sha256=ryvb4aqbbsHireHWlPQfx
|
|
|
150
150
|
pyfemtet/opt/visualization/result_viewer/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
151
151
|
pyfemtet/opt/visualization/result_viewer/application.py,sha256=WcHBx_J5eNLKSaprpk9BGifwhO04oN8FiNGYTWorrXA,1691
|
|
152
152
|
pyfemtet/opt/visualization/result_viewer/pages.py,sha256=MZAjzbuq0toZrR-iJhElM3A12_jHVCTt65gz1kdNPbw,32193
|
|
153
|
-
pyfemtet-0.8.
|
|
154
|
-
pyfemtet-0.8.
|
|
155
|
-
pyfemtet-0.8.
|
|
156
|
-
pyfemtet-0.8.
|
|
157
|
-
pyfemtet-0.8.
|
|
158
|
-
pyfemtet-0.8.
|
|
153
|
+
pyfemtet-0.8.19.dist-info/LICENSE,sha256=LWUL5LlMGjSRTvsalS8_fFuwS4VMw18fJSNWFwDK8pc,1060
|
|
154
|
+
pyfemtet-0.8.19.dist-info/LICENSE_THIRD_PARTY.txt,sha256=8_9-cgzTpmeuCqItPZb9-lyAZcH2Qp9sZTU_hYuOZIQ,191
|
|
155
|
+
pyfemtet-0.8.19.dist-info/METADATA,sha256=d40UwPFshd3a0f7kxElPY-KROfpOq03U3A-ytSSttZI,3560
|
|
156
|
+
pyfemtet-0.8.19.dist-info/WHEEL,sha256=fGIA9gx4Qxk2KDKeNJCbOEwSrmLtjWCwzBz351GyrPQ,88
|
|
157
|
+
pyfemtet-0.8.19.dist-info/entry_points.txt,sha256=ZfYqRaoiPtuWqFi2_msccyrVF0LurMn-IHlYamAegZo,104
|
|
158
|
+
pyfemtet-0.8.19.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|