pyfemtet 0.8.17__py3-none-any.whl → 0.8.18__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 CHANGED
@@ -1 +1 @@
1
- __version__ = "0.8.17"
1
+ __version__ = "0.8.18"
@@ -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
- non_domi: list[bool] = []
837
- non_domi_row: list[pd.Series] = []
838
- for i, row in solution_set.iterrows():
839
- non_domi.append((row > solution_set).product(axis=1).sum(axis=0) == 0)
840
- non_domi_row.append(row)
841
- print(solution_set)
842
-
843
- # パレートフロントから裾解(他と同等というだけで残っている非劣解)を除く
844
- true_non_domi = []
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
- print(row < other_row) # 他の非劣解よりも優れている
854
- print('-----')
855
- print((row < other_row).sum()) # そのような目的がひとつでもある
856
- is_true_non_domi.append((row < other_row).sum()) # ような解が
857
-
858
- true_non_domi.append(all(is_true_non_domi)) # 全ての解に対し、ひとつの目的でも優れている
859
-
860
- # non_domi に true_non_domi を反映する
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'] = true_non_domi
869
+ df.loc[idx, 'non_domi'] = non_domi
868
870
 
869
871
  def _calc_hypervolume(self, objectives, df):
870
872
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: pyfemtet
3
- Version: 0.8.17
3
+ Version: 0.8.18
4
4
  Summary: Design parameter optimization using Femtet.
5
5
  License: MIT
6
6
  Author: kazuma.naito
@@ -1,4 +1,4 @@
1
- pyfemtet/__init__.py,sha256=PT_XvBlwQd4u02vEgI5X087DusCd996RJt03glxbUCg,22
1
+ pyfemtet/__init__.py,sha256=JhVwJTiRKMlMbkGesmi3xha7ApeH6eYngBm1czvd8Tc,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=DtbzqhZ5zjHpRYQ2EtS2YTHrduDBLeIosPWYOA2vLXM,40402
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
@@ -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.17.dist-info/LICENSE,sha256=LWUL5LlMGjSRTvsalS8_fFuwS4VMw18fJSNWFwDK8pc,1060
154
- pyfemtet-0.8.17.dist-info/LICENSE_THIRD_PARTY.txt,sha256=8_9-cgzTpmeuCqItPZb9-lyAZcH2Qp9sZTU_hYuOZIQ,191
155
- pyfemtet-0.8.17.dist-info/METADATA,sha256=1cpHFveSodbOcGqRw2Ill8btupTGMC_XAZRkAatotso,3560
156
- pyfemtet-0.8.17.dist-info/WHEEL,sha256=fGIA9gx4Qxk2KDKeNJCbOEwSrmLtjWCwzBz351GyrPQ,88
157
- pyfemtet-0.8.17.dist-info/entry_points.txt,sha256=ZfYqRaoiPtuWqFi2_msccyrVF0LurMn-IHlYamAegZo,104
158
- pyfemtet-0.8.17.dist-info/RECORD,,
153
+ pyfemtet-0.8.18.dist-info/LICENSE,sha256=LWUL5LlMGjSRTvsalS8_fFuwS4VMw18fJSNWFwDK8pc,1060
154
+ pyfemtet-0.8.18.dist-info/LICENSE_THIRD_PARTY.txt,sha256=8_9-cgzTpmeuCqItPZb9-lyAZcH2Qp9sZTU_hYuOZIQ,191
155
+ pyfemtet-0.8.18.dist-info/METADATA,sha256=aWDQ7WzqwRW4hFzxuVsyRr1_G9sVMTsXjkMxYLdeNG4,3560
156
+ pyfemtet-0.8.18.dist-info/WHEEL,sha256=fGIA9gx4Qxk2KDKeNJCbOEwSrmLtjWCwzBz351GyrPQ,88
157
+ pyfemtet-0.8.18.dist-info/entry_points.txt,sha256=ZfYqRaoiPtuWqFi2_msccyrVF0LurMn-IHlYamAegZo,104
158
+ pyfemtet-0.8.18.dist-info/RECORD,,