Skip to content

Commit f322903

Browse files
fix: model selection applied to boxplots in ring planarity and bond lengths (#87)
Co-authored-by: Leon Wehrhan <mail@leonwehrhan.de>
1 parent e5c7078 commit f322903

File tree

2 files changed

+16
-14
lines changed

2 files changed

+16
-14
lines changed

src/mlipaudit/ui/bond_length_distribution.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -137,13 +137,14 @@ def bond_length_distribution_page(
137137
plot_data = []
138138

139139
for model_name, result in data.items():
140-
for mol in result.molecules:
141-
if selected_bond_type == mol.molecule_name and not mol.failed:
142-
for bond_length in mol.deviation_trajectory: # type: ignore
143-
plot_data.append({
144-
"Model name": model_name,
145-
"Bond length": bond_length,
146-
})
140+
if model_name in selected_models:
141+
for mol in result.molecules:
142+
if selected_bond_type == mol.molecule_name and not mol.failed:
143+
for bond_length in mol.deviation_trajectory: # type: ignore
144+
plot_data.append({
145+
"Model name": model_name,
146+
"Bond length": bond_length,
147+
})
147148
if plot_data:
148149
df_plot = pd.DataFrame(plot_data)
149150

src/mlipaudit/ui/ring_planarity.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -108,13 +108,14 @@ def ring_planarity_page(
108108
plot_data = []
109109

110110
for model_name, result in data.items():
111-
for mol in result.molecules:
112-
if selected_ring_type == mol.molecule_name and not mol.failed:
113-
for ring_deviation in mol.deviation_trajectory: # type: ignore
114-
plot_data.append({
115-
"Model name": model_name,
116-
"Ring deviation": ring_deviation,
117-
})
111+
if model_name in selected_models:
112+
for mol in result.molecules:
113+
if selected_ring_type == mol.molecule_name and not mol.failed:
114+
for ring_deviation in mol.deviation_trajectory: # type: ignore
115+
plot_data.append({
116+
"Model name": model_name,
117+
"Ring deviation": ring_deviation,
118+
})
118119

119120
df_plot = pd.DataFrame(plot_data)
120121

0 commit comments

Comments
 (0)