Skip to content

Commit 6bc6c65

Browse files
committed
enh: overhaul metadata and results export
1 parent 5905aa5 commit 6bc6c65

File tree

8 files changed

+373
-82
lines changed

8 files changed

+373
-82
lines changed

CHANGELOG

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
0.6.2
2+
- enh: allow to select which metadata is exported
3+
- fix: do not apply and fit to all before exporting metadata
4+
(user may have performed individual fits)
5+
- setup: bump nanite from 1.3.0 to 1.4.0
16
0.6.1
27
- build: workaround for Pyinstaller issue 4626
38
0.6.0

pyjibe/fd/dlg_export_vals.py

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
import pkg_resources
2+
3+
from PyQt5 import uic, QtWidgets
4+
5+
from . import export
6+
7+
8+
class ExportDialog(QtWidgets.QDialog):
9+
_instance_counter = 0
10+
11+
def __init__(self, parent, fdist_list, identifier, *args, **kwargs):
12+
"""Base class for force-indentation analysis"""
13+
super(ExportDialog, self).__init__(parent=parent, *args, **kwargs)
14+
path_ui = pkg_resources.resource_filename("pyjibe.fd",
15+
"dlg_export_vals.ui")
16+
uic.loadUi(path_ui, self)
17+
18+
self.fdist_list = fdist_list
19+
self.identifier = identifier
20+
21+
def done(self, r):
22+
if r:
23+
fname, _e = QtWidgets.QFileDialog.getSaveFileName(
24+
self.parent(),
25+
"Save metadata and results",
26+
"pyjibe_export_{:03d}.tsv".format(self.identifier),
27+
"Tab Separated Values (*.tsv)"
28+
)
29+
30+
if fname:
31+
if not fname.endswith(".tsv"):
32+
fname += ".tsv"
33+
user_choices = {
34+
"dataset": self.checkBox_dataset,
35+
"experiment": self.checkBox_experiment,
36+
"qmap": self.checkBox_qmap,
37+
"params_initial": self.checkBox_initial,
38+
"params_fitted": self.checkBox_fitted,
39+
"params_ancillary": self.checkBox_ancillary,
40+
"rating": self.checkBox_rating,
41+
}
42+
which = []
43+
for mdat in user_choices:
44+
if user_choices[mdat].isChecked():
45+
which.append(mdat)
46+
47+
export.save_tsv_metadata_results(filename=fname,
48+
fdist_list=self.fdist_list,
49+
which=which)
50+
super(ExportDialog, self).done(r)

pyjibe/fd/dlg_export_vals.ui

Lines changed: 162 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,162 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<ui version="4.0">
3+
<class>Dialog</class>
4+
<widget class="QDialog" name="Dialog">
5+
<property name="geometry">
6+
<rect>
7+
<x>0</x>
8+
<y>0</y>
9+
<width>400</width>
10+
<height>357</height>
11+
</rect>
12+
</property>
13+
<property name="windowTitle">
14+
<string>Export parameters</string>
15+
</property>
16+
<layout class="QVBoxLayout" name="verticalLayout">
17+
<item>
18+
<widget class="QLabel" name="label">
19+
<property name="text">
20+
<string>Please choose which data to export.</string>
21+
</property>
22+
</widget>
23+
</item>
24+
<item>
25+
<widget class="QGroupBox" name="groupBox_2">
26+
<property name="title">
27+
<string>Metadata</string>
28+
</property>
29+
<layout class="QVBoxLayout" name="verticalLayout_3">
30+
<item>
31+
<widget class="QCheckBox" name="checkBox_dataset">
32+
<property name="toolTip">
33+
<string>Path, identifier, etc.</string>
34+
</property>
35+
<property name="text">
36+
<string>Dataset</string>
37+
</property>
38+
<property name="checked">
39+
<bool>true</bool>
40+
</property>
41+
</widget>
42+
</item>
43+
<item>
44+
<widget class="QCheckBox" name="checkBox_experiment">
45+
<property name="toolTip">
46+
<string>Duration, spring constant, etc.</string>
47+
</property>
48+
<property name="text">
49+
<string>Experiment</string>
50+
</property>
51+
</widget>
52+
</item>
53+
<item>
54+
<widget class="QCheckBox" name="checkBox_qmap">
55+
<property name="toolTip">
56+
<string>Grid position, shape, etc. (if applicable)</string>
57+
</property>
58+
<property name="text">
59+
<string>QMap</string>
60+
</property>
61+
</widget>
62+
</item>
63+
</layout>
64+
</widget>
65+
</item>
66+
<item>
67+
<widget class="QGroupBox" name="groupBox">
68+
<property name="title">
69+
<string>Modeling</string>
70+
</property>
71+
<layout class="QVBoxLayout" name="verticalLayout_2">
72+
<item>
73+
<widget class="QCheckBox" name="checkBox_initial">
74+
<property name="text">
75+
<string>Initial parameters</string>
76+
</property>
77+
</widget>
78+
</item>
79+
<item>
80+
<widget class="QCheckBox" name="checkBox_fitted">
81+
<property name="text">
82+
<string>Fitted parameters</string>
83+
</property>
84+
<property name="checked">
85+
<bool>true</bool>
86+
</property>
87+
</widget>
88+
</item>
89+
<item>
90+
<widget class="QCheckBox" name="checkBox_ancillary">
91+
<property name="toolTip">
92+
<string>additional model parameters</string>
93+
</property>
94+
<property name="text">
95+
<string>Ancillary parameters</string>
96+
</property>
97+
<property name="checked">
98+
<bool>true</bool>
99+
</property>
100+
</widget>
101+
</item>
102+
<item>
103+
<widget class="QCheckBox" name="checkBox_rating">
104+
<property name="text">
105+
<string>Rating</string>
106+
</property>
107+
<property name="checked">
108+
<bool>true</bool>
109+
</property>
110+
</widget>
111+
</item>
112+
</layout>
113+
</widget>
114+
</item>
115+
<item>
116+
<widget class="QDialogButtonBox" name="buttonBox">
117+
<property name="orientation">
118+
<enum>Qt::Horizontal</enum>
119+
</property>
120+
<property name="standardButtons">
121+
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
122+
</property>
123+
</widget>
124+
</item>
125+
</layout>
126+
</widget>
127+
<resources/>
128+
<connections>
129+
<connection>
130+
<sender>buttonBox</sender>
131+
<signal>accepted()</signal>
132+
<receiver>Dialog</receiver>
133+
<slot>accept()</slot>
134+
<hints>
135+
<hint type="sourcelabel">
136+
<x>248</x>
137+
<y>254</y>
138+
</hint>
139+
<hint type="destinationlabel">
140+
<x>157</x>
141+
<y>274</y>
142+
</hint>
143+
</hints>
144+
</connection>
145+
<connection>
146+
<sender>buttonBox</sender>
147+
<signal>rejected()</signal>
148+
<receiver>Dialog</receiver>
149+
<slot>reject()</slot>
150+
<hints>
151+
<hint type="sourcelabel">
152+
<x>316</x>
153+
<y>260</y>
154+
</hint>
155+
<hint type="destinationlabel">
156+
<x>286</x>
157+
<y>274</y>
158+
</hint>
159+
</hints>
160+
</connection>
161+
</connections>
162+
</ui>

0 commit comments

Comments
 (0)