pyfemtet 1.0.5__py3-none-any.whl → 1.0.7__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.

@@ -722,6 +722,7 @@ class Tutorial(AbstractPage):
722
722
  parameters=history._records.column_manager.parameters,
723
723
  obj_names=history.obj_names,
724
724
  cns_names=history.cns_names,
725
+ other_output_names=history.other_output_names,
725
726
  sub_fidelity_names=history.sub_fidelity_names,
726
727
  additional_data=additional_data,
727
728
  )
@@ -0,0 +1,105 @@
1
+ import pandas as pd
2
+ import plotly.graph_objects as go
3
+ from plotly.subplots import make_subplots
4
+
5
+ from pyfemtet.logger import get_module_logger
6
+
7
+
8
+ __all__ = [
9
+ 'contour_creator',
10
+ ]
11
+
12
+
13
+ def contour_creator(df: pd.DataFrame) -> go.Figure | str:
14
+
15
+ logger = get_module_logger('opt.contour_creator')
16
+
17
+ target_column = tuple(df.columns)[-1]
18
+ explain_columns = [column for column in df.columns if column != target_column]
19
+
20
+ subplots = make_subplots(
21
+ rows=len(explain_columns),
22
+ cols=len(explain_columns),
23
+ shared_xaxes=True,
24
+ shared_yaxes=True,
25
+ row_titles=explain_columns,
26
+ column_titles=explain_columns,
27
+ start_cell='bottom-left',
28
+ )
29
+
30
+ is_first = True
31
+
32
+ for r, r_key in enumerate(explain_columns):
33
+ for c, c_key in enumerate(explain_columns):
34
+
35
+ r_dtype = df.dtypes[r_key]
36
+ c_dtype = df.dtypes[c_key]
37
+
38
+ if not ('float' in r_dtype.name or 'int' in r_dtype.name):
39
+ logger.error(f'dtype is {r_dtype}. Not implemented.')
40
+ return 'Not implemented: including categorical parameters.'
41
+ if not ('float' in c_dtype.name or 'int' in c_dtype.name):
42
+ logger.error(f'dtype is {c_dtype}. Not implemented.')
43
+ return 'Not implemented: including categorical parameters.'
44
+
45
+ x = df[c_key]
46
+ y = df[r_key]
47
+ z = df[target_column]
48
+
49
+ scatter = go.Scatter(
50
+ x=x, y=y, mode='markers',
51
+ marker=go.scatter.Marker(
52
+ symbol='circle',
53
+ color='black',
54
+ size=5,
55
+ line=dict(
56
+ color='white',
57
+ width=1,
58
+ )
59
+ ),
60
+ name='points (click to switch visibility)',
61
+ legendgroup='points (click to switch visibility)',
62
+ showlegend=is_first,
63
+ )
64
+
65
+ is_first = False
66
+
67
+ if r == c:
68
+ pass
69
+
70
+ else:
71
+
72
+ contour = go.Contour(
73
+ x=x, y=y, z=z,
74
+ connectgaps=True,
75
+ name=f'contour of\n{target_column}',
76
+ colorscale='Turbo',
77
+ )
78
+
79
+ subplots.add_trace(contour, row=r + 1, col=c + 1)
80
+
81
+ subplots.add_trace(scatter, row=r + 1, col=c + 1)
82
+ subplots.update_layout(
83
+ legend=dict(
84
+ orientation='h',
85
+ xanchor='center',
86
+ x=0.5,
87
+ yanchor='bottom',
88
+ y=-0.2,
89
+ bgcolor='rgba(0, 0, 0, 0.15)',
90
+ ),
91
+ # margin=dict(b=50),
92
+ )
93
+
94
+ return subplots
95
+
96
+
97
+ if __name__ == '__main__':
98
+ import numpy as np
99
+ contour_creator(pd.DataFrame(dict(
100
+ x1=np.random.rand(20),
101
+ x2=np.random.rand(20),
102
+ x3=np.random.rand(20),
103
+ x4=np.random.rand(20),
104
+ y=np.random.rand(20),
105
+ ))).show()
@@ -0,0 +1,33 @@
1
+ import pandas as pd
2
+ import plotly.graph_objects as go
3
+ import plotly.express as px
4
+
5
+ from pyfemtet.logger import get_module_logger
6
+
7
+
8
+ __all__ = [
9
+ 'parallel_plot',
10
+ ]
11
+
12
+
13
+ def parallel_plot(df: pd.DataFrame) -> go.Figure | str:
14
+
15
+ logger = get_module_logger('opt.parallel_plot')
16
+
17
+ if any([
18
+ not ('float' in dtype.name or 'int' in dtype.name)
19
+ for dtype in df.dtypes.values
20
+ ]):
21
+ logger.error('Not implemented: including categorical parameters.')
22
+ # fig = px.parallel_categories()
23
+ fig = 'Not implemented: including categorical parameters.'
24
+
25
+ else:
26
+ fig = px.parallel_coordinates(
27
+ df,
28
+ dimensions=df.columns,
29
+ color=df.columns[-1],
30
+ color_continuous_scale=px.colors.sequential.Turbo
31
+ )
32
+
33
+ return fig
@@ -341,18 +341,18 @@ def _plot(
341
341
  # layout
342
342
  fig.update_layout(
343
343
  title=_('Prediction Model'),
344
- xaxis_title=prm_name1,
345
- yaxis_title=obj_name,
344
+ scene=dict(
345
+ xaxis=dict(title=dict(text=prm_name1)),
346
+ yaxis=dict(title=dict(text=prm_name2)),
347
+ zaxis=dict(title=dict(text=obj_name)),
348
+ ),
346
349
  )
347
350
 
348
351
  else:
349
352
  fig.update_layout(
350
353
  title=_('Prediction Model'),
351
- scene=dict(
352
- xaxis_title=prm_name1,
353
- yaxis_title=prm_name2,
354
- zaxis_title=obj_name
355
- ),
354
+ xaxis=dict(title=dict(text=prm_name1)),
355
+ yaxis=dict(title=dict(text=obj_name)),
356
356
  margin=dict(l=0, r=0, b=0, t=30),
357
357
  )
358
358
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: pyfemtet
3
- Version: 1.0.5
3
+ Version: 1.0.7
4
4
  Summary: Design parameter optimization using Femtet.
5
5
  License: MIT
6
6
  Author: kazuma.naito
@@ -29,9 +29,9 @@ pyfemtet/logger/__init__.py,sha256=lofBrZHr0P1hsxPUiPG1SQqKxCuSBk8zGnR7vUfCHYw,5
29
29
  pyfemtet/logger/_impl.py,sha256=uJ9el3kR-A4W2DvO_G5A6k9z2u1lkyl7GSvZ68uPy-U,6321
30
30
  pyfemtet/opt/__init__.py,sha256=1LcwTddtoi8plemxkzmX0YEKiNpAZvKn9OoNQysyDLE,339
31
31
  pyfemtet/opt/exceptions.py,sha256=M_O7jm20Y4e_QxsKF6tnEl-OrAtErUOj6hNT7eEXCO4,1327
32
- pyfemtet/opt/femopt.py,sha256=Ufp9qJuJIEtP_lJtR-FeCkGtH_Us8imlJ1c-FVrVyLU,23186
32
+ pyfemtet/opt/femopt.py,sha256=4DqNhhykJKlE6g0aPv3MAG_Yrgzly84RE97MD_htQ6U,23438
33
33
  pyfemtet/opt/history/__init__.py,sha256=pUp3SO4R7RGzmpNDLBg_pQH0X2yzBd-oqsHXWmB33os,201
34
- pyfemtet/opt/history/_history.py,sha256=wyj0omvisQWz-BZ5mIFPyTJhJ77izOtdkGgjN6G4ZDA,51033
34
+ pyfemtet/opt/history/_history.py,sha256=5b9ACZdsAL2pr0rcSQkTpHGcSKynxuCQo8ml44cfKtw,53492
35
35
  pyfemtet/opt/history/_hypervolume.py,sha256=_IvGH71ZNreWvDQCG815Q2hS1OEvPFPQhUnNXf1UxRQ,4449
36
36
  pyfemtet/opt/history/_optimality.py,sha256=6vLySZmrrklr04Qir0hGethTykf8NYFod88NDGrBrG0,2407
37
37
  pyfemtet/opt/interface/__init__.py,sha256=wiVSUlzLF_6gFXBw0T_JOKOOg5l5SJ24-HfaYWp7E0Y,1459
@@ -63,7 +63,7 @@ pyfemtet/opt/meta_script/__main__.py,sha256=9-QM6eZOLpZ_CxERpRu3RAMqpudorSJdPCiK
63
63
  pyfemtet/opt/meta_script/sample/sample.bas,sha256=2iuSYMgPDyAdiSDVGxRu3avjcZYnULz0l8e25YBa7SQ,27966
64
64
  pyfemtet/opt/meta_script/sample/sample.femprj,sha256=6_0ywhgXxZjdzZzQFog8mgMUEjKNCFVNlEgAWoptovk,292885
65
65
  pyfemtet/opt/optimizer/__init__.py,sha256=A4QYeF0KHEFdwoxLfkDND7ikDQ186Ryy3oXEGdakFSg,463
66
- pyfemtet/opt/optimizer/_base_optimizer.py,sha256=GVE4HKQI-l0WvVM3xmrm3sQ04A9tJKfiA-5SECfG6aM,31683
66
+ pyfemtet/opt/optimizer/_base_optimizer.py,sha256=4Jcnj5WTKXpuHzMgjsBk1W8nhUbbBFfHUybQF2jB5kw,33495
67
67
  pyfemtet/opt/optimizer/optuna_optimizer/__init__.py,sha256=u2Bwc79tkZTU5dMbhzzrPQi0RlFg22UgXc-m9K9G6wQ,242
68
68
  pyfemtet/opt/optimizer/optuna_optimizer/_optuna_attribute.py,sha256=7eZsruVCGgMlcnf3a9Vf55FOEE-D7V777MJQajI12Cw,1842
69
69
  pyfemtet/opt/optimizer/optuna_optimizer/_optuna_optimizer.py,sha256=UWD2o0pUqsQg8ZGE2J847czmNYmAbXvQpVSsDxWmElI,28772
@@ -80,10 +80,10 @@ pyfemtet/opt/prediction/_gpytorch_modules_extension.py,sha256=B_qUtFn06dQENOmUOO
80
80
  pyfemtet/opt/prediction/_helper.py,sha256=7MyVSISOVqBksKxLAE-cCbsVLcAJPbadNWUlk4-q5Ew,4370
81
81
  pyfemtet/opt/prediction/_model.py,sha256=rqp_CT3c3ddu-pT2f2_msoQjlv0CVKS2B5OyD45gVEE,3873
82
82
  pyfemtet/opt/problem/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
83
- pyfemtet/opt/problem/problem.py,sha256=ohdZ450XH4YoFK4T9t52t8BSja6DpFTfMePQM1DdllU,9782
83
+ pyfemtet/opt/problem/problem.py,sha256=X9mro2yVJ6Uw9ck0F0OjG-0M2ReKtuWltu-JUEFIkzQ,10025
84
84
  pyfemtet/opt/problem/variable_manager/__init__.py,sha256=uzuraWUZfLzB3uZHIQHFL7uMxWvv7Oaf940zEozXtNY,476
85
85
  pyfemtet/opt/problem/variable_manager/_string_as_expression.py,sha256=aTJ9W9Gs6BS0Z_OsxWByJs9dAt32opD2_9913MCggPg,3626
86
- pyfemtet/opt/problem/variable_manager/_variable_manager.py,sha256=XrcmFIfE4J_5zkz4Yx6j4QyDAuJX3M2zJ4wESf8oE1Q,12697
86
+ pyfemtet/opt/problem/variable_manager/_variable_manager.py,sha256=o6wtaHlgZ-1gbMrLrZYX555M_gTkLDO4p-VHIXE42-k,12725
87
87
  pyfemtet/opt/visualization/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
88
88
  pyfemtet/opt/visualization/_create_wrapped_components.py,sha256=9AltJHr1DM6imZfpNp867rC-uAYqQ-emdgTLChKDrl8,2513
89
89
  pyfemtet/opt/visualization/history_viewer/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -93,10 +93,12 @@ pyfemtet/opt/visualization/history_viewer/_common_pages.py,sha256=uslb21IG3Ll58H
93
93
  pyfemtet/opt/visualization/history_viewer/_complex_components/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
94
94
  pyfemtet/opt/visualization/history_viewer/_complex_components/alert_region.py,sha256=0plsq5cqVFiPPYCLtvDlmf_S_onjyOhrWvU2aWcQ-8o,2097
95
95
  pyfemtet/opt/visualization/history_viewer/_complex_components/control_femtet.py,sha256=FQUR9bYtMoj_3bvHXfzAhYMoYpbIWcDP8j7M2EwnYQM,6253
96
+ pyfemtet/opt/visualization/history_viewer/_complex_components/detail_graphs.py,sha256=friaHAJOG5BEUAkoy7ukpO-vUhJ0DlJFwMB2ayNJ4so,19134
96
97
  pyfemtet/opt/visualization/history_viewer/_complex_components/main_graph.py,sha256=dMphOHbSV2R3oQvPlIQj7GwtV0phPiBwKniblxTAxMY,25978
97
98
  pyfemtet/opt/visualization/history_viewer/_complex_components/pm_graph.py,sha256=JafoGlLGFrOH7XQe46DWjg5TftqVs27gpLO4sEBssF8,24769
99
+ pyfemtet/opt/visualization/history_viewer/_detail_page.py,sha256=2LdCFSCcxZkAH6QMa9q6QX-KLYhVrRf-iTh7jNPrnnA,3406
98
100
  pyfemtet/opt/visualization/history_viewer/_process_monitor/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
99
- pyfemtet/opt/visualization/history_viewer/_process_monitor/_application.py,sha256=XROddkYHVVgy8QsQxUpqdcwFsl4NGRwde_98YfNMtiI,5888
101
+ pyfemtet/opt/visualization/history_viewer/_process_monitor/_application.py,sha256=sP2oOIy5u4gtyMq428NKBFECsYxHCJthMFHJkqyWZcI,5956
100
102
  pyfemtet/opt/visualization/history_viewer/_process_monitor/_pages.py,sha256=v6ytmJgtBql0pKn7O0UAeyX0P_V_nFX1KW4esBzHdJg,10921
101
103
  pyfemtet/opt/visualization/history_viewer/_wrapped_components/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
102
104
  pyfemtet/opt/visualization/history_viewer/_wrapped_components/dbc.py,sha256=8kCNhr1HZOgKc6XV5VLUjiEEjqraPcx9p2f_X-r9uDM,42130
@@ -106,8 +108,8 @@ pyfemtet/opt/visualization/history_viewer/_wrapped_components/str_enum.py,sha256
106
108
  pyfemtet/opt/visualization/history_viewer/result_viewer/.gitignore,sha256=ryvb4aqbbsHireHWlPQfxxqDHQJo6YkVYhE9imKt0b8,6
107
109
  pyfemtet/opt/visualization/history_viewer/result_viewer/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
108
110
  pyfemtet/opt/visualization/history_viewer/result_viewer/__main__.py,sha256=5bskvqYMxmgktfoakI19zgy08XlKOkuVhID6MNZNIyE,154
109
- pyfemtet/opt/visualization/history_viewer/result_viewer/_application.py,sha256=bhAi8xraVhOmjjY-RhFGIW8zjCOVJnw3wwdbr8rAOa0,1696
110
- pyfemtet/opt/visualization/history_viewer/result_viewer/_pages.py,sha256=9Z1EAAvBiEC6oTKk4Y_8AEZFMGVwVlCqk_dutIk11WA,33313
111
+ pyfemtet/opt/visualization/history_viewer/result_viewer/_application.py,sha256=iq9Eyj0G7vtz-SGmkr8n4tVjmyARz5_qKd3UGZH7gTQ,1764
112
+ pyfemtet/opt/visualization/history_viewer/result_viewer/_pages.py,sha256=4QAVY2GUtfqActhZlCEAFcBwOL8hSTEWEOGsa478_tg,33376
111
113
  pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08.csv,sha256=O-6cGVjr4xMYgpkGUDyfm02ccE42cE9DyLl7ioeGbL0,3319
112
114
  pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08.db,sha256=4WWrvxgWAFdL36Kk7XxK02RvZbOgGkVMerrRfoF_oJw,122880
113
115
  pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8.jpg,sha256=yC5EAxhDCB2Vm0eKH1Ufjp7vdt1GPQWr9Y3rlay-U2E,49141
@@ -160,13 +162,15 @@ pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_
160
162
  pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_9.pdt,sha256=LTC70uuGAtMvY0i-LNqOMvvSp4X8uVEDvugJ31jsp6o,6828366
161
163
  pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.femprj,sha256=uPqOara56FAt_T4x2P6tvcIXnISw_fX7RECbVoJlAFs,280214
162
164
  pyfemtet/opt/visualization/plotter/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
165
+ pyfemtet/opt/visualization/plotter/contour_creator.py,sha256=bvGGWNBLZawHq0fAIHfZOUAXw0f9GTlNROiJThoXZ2A,3043
163
166
  pyfemtet/opt/visualization/plotter/main_figure_creator.py,sha256=9RXz6Wt52MiSz3Hbew6sDq6KZrYU8ojvhCTHSEup6Ys,16403
164
- pyfemtet/opt/visualization/plotter/pm_graph_creator.py,sha256=hUvvYeckMhkE1nH0FAOkXrA5K3A8PbfpxKYaYnBllB4,10864
167
+ pyfemtet/opt/visualization/plotter/parallel_plot_creator.py,sha256=VRhT0CUG1mCHDoVO8e6LR_-FiD0QB3GsB95016iXmYc,802
168
+ pyfemtet/opt/visualization/plotter/pm_graph_creator.py,sha256=hds2Z9jGnj4exFrj-gdfr4RmvfmzhsfHItKeKKC7Wt4,10950
165
169
  pyfemtet/opt/wat_ex14_parametric_jp.femprj,sha256=dMwQMt6yok_PbZLyxPYdmg5wJQwgQDZ4RhS76zdGLGk,177944
166
170
  pyfemtet/opt/worker_status.py,sha256=xSVW9lcw5jzYBwnmlVzk-1zCCyvmXVOH6EoRjqVbE9M,3605
167
- pyfemtet-1.0.5.dist-info/LICENSE,sha256=LWUL5LlMGjSRTvsalS8_fFuwS4VMw18fJSNWFwDK8pc,1060
168
- pyfemtet-1.0.5.dist-info/LICENSE_THIRD_PARTY.txt,sha256=8_9-cgzTpmeuCqItPZb9-lyAZcH2Qp9sZTU_hYuOZIQ,191
169
- pyfemtet-1.0.5.dist-info/METADATA,sha256=yorqWz1uHFA05tLR0Mr7nGJTc9vBjfEOWx0J4Z6ww9U,3471
170
- pyfemtet-1.0.5.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
171
- pyfemtet-1.0.5.dist-info/entry_points.txt,sha256=Tsb_l_8Z6pyyq2tRfuKiwfJUV3nq_cHoLS61foALtsg,134
172
- pyfemtet-1.0.5.dist-info/RECORD,,
171
+ pyfemtet-1.0.7.dist-info/LICENSE,sha256=LWUL5LlMGjSRTvsalS8_fFuwS4VMw18fJSNWFwDK8pc,1060
172
+ pyfemtet-1.0.7.dist-info/LICENSE_THIRD_PARTY.txt,sha256=8_9-cgzTpmeuCqItPZb9-lyAZcH2Qp9sZTU_hYuOZIQ,191
173
+ pyfemtet-1.0.7.dist-info/METADATA,sha256=O8oC45bYbEfJHUGtf04oNkwwBq-HEMMHsX-xYGz56tI,3471
174
+ pyfemtet-1.0.7.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
175
+ pyfemtet-1.0.7.dist-info/entry_points.txt,sha256=Tsb_l_8Z6pyyq2tRfuKiwfJUV3nq_cHoLS61foALtsg,134
176
+ pyfemtet-1.0.7.dist-info/RECORD,,