boris-behav-obs 8.16.5__py3-none-any.whl → 9.7.12__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.
- boris/__init__.py +1 -1
- boris/__main__.py +1 -1
- boris/about.py +28 -40
- boris/add_modifier.py +88 -80
- boris/add_modifier_ui.py +266 -144
- boris/advanced_event_filtering.py +23 -29
- boris/analysis_plugins/__init__.py +0 -0
- boris/analysis_plugins/_export_to_feral.py +225 -0
- boris/analysis_plugins/_latency.py +59 -0
- boris/analysis_plugins/irr_cohen_kappa.py +109 -0
- boris/analysis_plugins/irr_cohen_kappa_with_modifiers.py +112 -0
- boris/analysis_plugins/irr_weighted_cohen_kappa.py +157 -0
- boris/analysis_plugins/irr_weighted_cohen_kappa_with_modifiers.py +162 -0
- boris/analysis_plugins/list_of_dataframe_columns.py +22 -0
- boris/analysis_plugins/number_of_occurences.py +22 -0
- boris/analysis_plugins/number_of_occurences_by_independent_variable.py +54 -0
- boris/analysis_plugins/time_budget.py +61 -0
- boris/behav_coding_map_creator.py +235 -236
- boris/behavior_binary_table.py +33 -50
- boris/behaviors_coding_map.py +17 -18
- boris/boris_cli.py +6 -25
- boris/cmd_arguments.py +12 -1
- boris/coding_pad.py +19 -36
- boris/config.py +109 -50
- boris/config_file.py +58 -67
- boris/connections.py +105 -58
- boris/converters.py +13 -37
- boris/converters_ui.py +187 -110
- boris/cooccurence.py +250 -0
- boris/core.py +2174 -1303
- boris/core_qrc.py +15892 -10829
- boris/core_ui.py +941 -806
- boris/db_functions.py +17 -42
- boris/dev.py +27 -7
- boris/dialog.py +461 -242
- boris/duration_widget.py +9 -14
- boris/edit_event.py +61 -31
- boris/edit_event_ui.py +208 -97
- boris/event_operations.py +405 -281
- boris/events_cursor.py +25 -17
- boris/events_snapshots.py +36 -82
- boris/exclusion_matrix.py +4 -9
- boris/export_events.py +180 -203
- boris/export_observation.py +60 -73
- boris/external_processes.py +123 -98
- boris/geometric_measurement.py +427 -218
- boris/gui_utilities.py +91 -14
- boris/image_overlay.py +4 -4
- boris/import_observations.py +190 -98
- boris/ipc_mpv.py +325 -0
- boris/irr.py +20 -57
- boris/latency.py +31 -24
- boris/measurement_widget.py +14 -18
- boris/media_file.py +17 -19
- boris/menu_options.py +16 -6
- boris/modifier_coding_map_creator.py +1013 -0
- boris/modifiers_coding_map.py +7 -9
- boris/mpv2.py +128 -35
- boris/observation.py +501 -211
- boris/observation_operations.py +1037 -393
- boris/observation_ui.py +573 -363
- boris/observations_list.py +51 -58
- boris/otx_parser.py +74 -68
- boris/param_panel.py +45 -59
- boris/param_panel_ui.py +254 -138
- boris/player_dock_widget.py +91 -56
- boris/plot_data_module.py +20 -53
- boris/plot_events.py +56 -153
- boris/plot_events_rt.py +16 -30
- boris/plot_spectrogram_rt.py +83 -56
- boris/plot_waveform_rt.py +27 -49
- boris/plugins.py +468 -0
- boris/portion/__init__.py +18 -8
- boris/portion/const.py +35 -18
- boris/portion/dict.py +5 -5
- boris/portion/func.py +2 -2
- boris/portion/interval.py +21 -41
- boris/portion/io.py +41 -32
- boris/preferences.py +307 -123
- boris/preferences_ui.py +686 -227
- boris/project.py +294 -271
- boris/project_functions.py +626 -537
- boris/project_import_export.py +204 -213
- boris/project_ui.py +673 -441
- boris/qrc_boris.py +6 -3
- boris/qrc_boris5.py +6 -3
- boris/select_modifiers.py +62 -90
- boris/select_observations.py +19 -197
- boris/select_subj_behav.py +67 -39
- boris/state_events.py +51 -33
- boris/subjects_pad.py +7 -9
- boris/synthetic_time_budget.py +42 -26
- boris/time_budget_functions.py +169 -169
- boris/time_budget_widget.py +77 -89
- boris/transitions.py +41 -41
- boris/utilities.py +594 -226
- boris/version.py +3 -3
- boris/video_equalizer.py +16 -14
- boris/video_equalizer_ui.py +199 -130
- boris/video_operations.py +86 -28
- boris/view_df.py +104 -0
- boris/view_df_ui.py +75 -0
- boris/write_event.py +240 -136
- boris_behav_obs-9.7.12.dist-info/METADATA +139 -0
- boris_behav_obs-9.7.12.dist-info/RECORD +110 -0
- {boris_behav_obs-8.16.5.dist-info → boris_behav_obs-9.7.12.dist-info}/WHEEL +1 -1
- boris_behav_obs-9.7.12.dist-info/entry_points.txt +2 -0
- boris/README.TXT +0 -22
- boris/add_modifier.ui +0 -323
- boris/converters.ui +0 -289
- boris/core.qrc +0 -37
- boris/core.ui +0 -1571
- boris/edit_event.ui +0 -233
- boris/icons/logo_eye.ico +0 -0
- boris/map_creator.py +0 -982
- boris/observation.ui +0 -814
- boris/param_panel.ui +0 -379
- boris/preferences.ui +0 -537
- boris/project.ui +0 -1074
- boris/vlc_local.py +0 -90
- boris_behav_obs-8.16.5.dist-info/LICENSE.TXT +0 -674
- boris_behav_obs-8.16.5.dist-info/METADATA +0 -134
- boris_behav_obs-8.16.5.dist-info/RECORD +0 -107
- boris_behav_obs-8.16.5.dist-info/entry_points.txt +0 -2
- {boris → boris_behav_obs-9.7.12.dist-info/licenses}/LICENSE.TXT +0 -0
- {boris_behav_obs-8.16.5.dist-info → boris_behav_obs-9.7.12.dist-info}/top_level.txt +0 -0
boris/add_modifier_ui.py
CHANGED
|
@@ -1,181 +1,303 @@
|
|
|
1
1
|
# -*- coding: utf-8 -*-
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
from PyQt5 import QtCore, QtGui, QtWidgets
|
|
3
|
+
################################################################################
|
|
4
|
+
## Form generated from reading UI file 'add_modifier.ui'
|
|
5
|
+
##
|
|
6
|
+
## Created by: Qt User Interface Compiler version 6.10.0
|
|
7
|
+
##
|
|
8
|
+
## WARNING! All changes made in this file will be lost when recompiling UI file!
|
|
9
|
+
################################################################################
|
|
12
10
|
|
|
11
|
+
from PySide6.QtCore import (QCoreApplication, QDate, QDateTime, QLocale,
|
|
12
|
+
QMetaObject, QObject, QPoint, QRect,
|
|
13
|
+
QSize, QTime, QUrl, Qt)
|
|
14
|
+
from PySide6.QtGui import (QBrush, QColor, QConicalGradient, QCursor,
|
|
15
|
+
QFont, QFontDatabase, QGradient, QIcon,
|
|
16
|
+
QImage, QKeySequence, QLinearGradient, QPainter,
|
|
17
|
+
QPalette, QPixmap, QRadialGradient, QTransform)
|
|
18
|
+
from PySide6.QtWidgets import (QApplication, QCheckBox, QComboBox, QDialog,
|
|
19
|
+
QHBoxLayout, QLabel, QLineEdit, QListWidget,
|
|
20
|
+
QListWidgetItem, QPushButton, QSizePolicy, QSpacerItem,
|
|
21
|
+
QTabWidget, QVBoxLayout, QWidget)
|
|
13
22
|
|
|
14
23
|
class Ui_Dialog(object):
|
|
15
24
|
def setupUi(self, Dialog):
|
|
16
|
-
Dialog.
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
self.
|
|
20
|
-
self.verticalLayout_4
|
|
21
|
-
self.
|
|
22
|
-
self.
|
|
23
|
-
|
|
24
|
-
self.
|
|
25
|
-
|
|
26
|
-
self.
|
|
27
|
-
self.
|
|
25
|
+
if not Dialog.objectName():
|
|
26
|
+
Dialog.setObjectName(u"Dialog")
|
|
27
|
+
Dialog.resize(1339, 789)
|
|
28
|
+
self.verticalLayout_4 = QVBoxLayout(Dialog)
|
|
29
|
+
self.verticalLayout_4.setObjectName(u"verticalLayout_4")
|
|
30
|
+
self.cb_ask_at_stop = QCheckBox(Dialog)
|
|
31
|
+
self.cb_ask_at_stop.setObjectName(u"cb_ask_at_stop")
|
|
32
|
+
|
|
33
|
+
self.verticalLayout_4.addWidget(self.cb_ask_at_stop)
|
|
34
|
+
|
|
35
|
+
self.horizontalLayout_8 = QHBoxLayout()
|
|
36
|
+
self.horizontalLayout_8.setObjectName(u"horizontalLayout_8")
|
|
37
|
+
self.verticalLayout_2 = QVBoxLayout()
|
|
38
|
+
self.verticalLayout_2.setObjectName(u"verticalLayout_2")
|
|
39
|
+
self.lbModifier = QLabel(Dialog)
|
|
40
|
+
self.lbModifier.setObjectName(u"lbModifier")
|
|
41
|
+
|
|
28
42
|
self.verticalLayout_2.addWidget(self.lbModifier)
|
|
29
|
-
|
|
30
|
-
self.leModifier
|
|
43
|
+
|
|
44
|
+
self.leModifier = QLineEdit(Dialog)
|
|
45
|
+
self.leModifier.setObjectName(u"leModifier")
|
|
46
|
+
|
|
31
47
|
self.verticalLayout_2.addWidget(self.leModifier)
|
|
32
|
-
|
|
33
|
-
self.lbCode
|
|
48
|
+
|
|
49
|
+
self.lbCode = QLabel(Dialog)
|
|
50
|
+
self.lbCode.setObjectName(u"lbCode")
|
|
51
|
+
|
|
34
52
|
self.verticalLayout_2.addWidget(self.lbCode)
|
|
35
|
-
|
|
36
|
-
self.leCode
|
|
53
|
+
|
|
54
|
+
self.leCode = QLineEdit(Dialog)
|
|
55
|
+
self.leCode.setObjectName(u"leCode")
|
|
56
|
+
|
|
37
57
|
self.verticalLayout_2.addWidget(self.leCode)
|
|
38
|
-
|
|
58
|
+
|
|
59
|
+
self.lbCodeHelp = QLabel(Dialog)
|
|
60
|
+
self.lbCodeHelp.setObjectName(u"lbCodeHelp")
|
|
39
61
|
self.lbCodeHelp.setWordWrap(True)
|
|
40
|
-
|
|
62
|
+
|
|
41
63
|
self.verticalLayout_2.addWidget(self.lbCodeHelp)
|
|
42
|
-
|
|
43
|
-
self.
|
|
44
|
-
|
|
45
|
-
self.
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
self.
|
|
49
|
-
|
|
64
|
+
|
|
65
|
+
self.verticalSpacer = QSpacerItem(20, 40, QSizePolicy.Policy.Minimum, QSizePolicy.Policy.Expanding)
|
|
66
|
+
|
|
67
|
+
self.verticalLayout_2.addItem(self.verticalSpacer)
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
self.horizontalLayout_8.addLayout(self.verticalLayout_2)
|
|
71
|
+
|
|
72
|
+
self.verticalLayout_3 = QVBoxLayout()
|
|
73
|
+
self.verticalLayout_3.setObjectName(u"verticalLayout_3")
|
|
74
|
+
self.pbAddModifier = QPushButton(Dialog)
|
|
75
|
+
self.pbAddModifier.setObjectName(u"pbAddModifier")
|
|
76
|
+
|
|
50
77
|
self.verticalLayout_3.addWidget(self.pbAddModifier)
|
|
51
|
-
|
|
52
|
-
self.pbModifyModifier
|
|
53
|
-
self.pbModifyModifier.setObjectName("pbModifyModifier")
|
|
78
|
+
|
|
79
|
+
self.pbModifyModifier = QPushButton(Dialog)
|
|
80
|
+
self.pbModifyModifier.setObjectName(u"pbModifyModifier")
|
|
81
|
+
|
|
54
82
|
self.verticalLayout_3.addWidget(self.pbModifyModifier)
|
|
55
|
-
|
|
56
|
-
self.
|
|
57
|
-
|
|
58
|
-
self.
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
self.
|
|
62
|
-
|
|
63
|
-
self.
|
|
64
|
-
self.
|
|
83
|
+
|
|
84
|
+
self.verticalSpacer_2 = QSpacerItem(20, 40, QSizePolicy.Policy.Minimum, QSizePolicy.Policy.Expanding)
|
|
85
|
+
|
|
86
|
+
self.verticalLayout_3.addItem(self.verticalSpacer_2)
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
self.horizontalLayout_8.addLayout(self.verticalLayout_3)
|
|
90
|
+
|
|
91
|
+
self.verticalLayout = QVBoxLayout()
|
|
92
|
+
self.verticalLayout.setObjectName(u"verticalLayout")
|
|
93
|
+
self.tabWidgetModifiersSets = QTabWidget(Dialog)
|
|
94
|
+
self.tabWidgetModifiersSets.setObjectName(u"tabWidgetModifiersSets")
|
|
95
|
+
self.tabWidgetModifiersSets.setMaximumSize(QSize(16777215, 30))
|
|
96
|
+
self.tabWidgetModifiersSets.setTabPosition(QTabWidget.TabPosition.North)
|
|
97
|
+
self.tabWidgetModifiersSets.setTabShape(QTabWidget.TabShape.Rounded)
|
|
98
|
+
self.tabWidgetModifiersSets.setElideMode(Qt.TextElideMode.ElideNone)
|
|
65
99
|
self.tabWidgetModifiersSets.setDocumentMode(True)
|
|
66
|
-
|
|
100
|
+
|
|
67
101
|
self.verticalLayout.addWidget(self.tabWidgetModifiersSets)
|
|
68
|
-
|
|
69
|
-
self.
|
|
70
|
-
self.
|
|
71
|
-
self.
|
|
72
|
-
self.
|
|
73
|
-
|
|
74
|
-
self.
|
|
75
|
-
|
|
76
|
-
self.
|
|
77
|
-
self.
|
|
78
|
-
|
|
79
|
-
self.
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
self.verticalLayout.
|
|
83
|
-
|
|
84
|
-
self.
|
|
102
|
+
|
|
103
|
+
self.horizontalLayout_5 = QHBoxLayout()
|
|
104
|
+
self.horizontalLayout_5.setObjectName(u"horizontalLayout_5")
|
|
105
|
+
self.lb_name = QLabel(Dialog)
|
|
106
|
+
self.lb_name.setObjectName(u"lb_name")
|
|
107
|
+
|
|
108
|
+
self.horizontalLayout_5.addWidget(self.lb_name)
|
|
109
|
+
|
|
110
|
+
self.le_name = QLineEdit(Dialog)
|
|
111
|
+
self.le_name.setObjectName(u"le_name")
|
|
112
|
+
|
|
113
|
+
self.horizontalLayout_5.addWidget(self.le_name)
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
self.verticalLayout.addLayout(self.horizontalLayout_5)
|
|
117
|
+
|
|
118
|
+
self.horizontalLayout_6 = QHBoxLayout()
|
|
119
|
+
self.horizontalLayout_6.setObjectName(u"horizontalLayout_6")
|
|
120
|
+
self.lb_description = QLabel(Dialog)
|
|
121
|
+
self.lb_description.setObjectName(u"lb_description")
|
|
122
|
+
|
|
123
|
+
self.horizontalLayout_6.addWidget(self.lb_description)
|
|
124
|
+
|
|
125
|
+
self.le_description = QLineEdit(Dialog)
|
|
126
|
+
self.le_description.setObjectName(u"le_description")
|
|
127
|
+
|
|
128
|
+
self.horizontalLayout_6.addWidget(self.le_description)
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
self.verticalLayout.addLayout(self.horizontalLayout_6)
|
|
132
|
+
|
|
133
|
+
self.horizontalLayout_7 = QHBoxLayout()
|
|
134
|
+
self.horizontalLayout_7.setObjectName(u"horizontalLayout_7")
|
|
135
|
+
self.lbType = QLabel(Dialog)
|
|
136
|
+
self.lbType.setObjectName(u"lbType")
|
|
137
|
+
|
|
138
|
+
self.horizontalLayout_7.addWidget(self.lbType)
|
|
139
|
+
|
|
140
|
+
self.cbType = QComboBox(Dialog)
|
|
85
141
|
self.cbType.addItem("")
|
|
86
142
|
self.cbType.addItem("")
|
|
87
143
|
self.cbType.addItem("")
|
|
88
144
|
self.cbType.addItem("")
|
|
89
|
-
self.
|
|
90
|
-
|
|
91
|
-
self.
|
|
145
|
+
self.cbType.setObjectName(u"cbType")
|
|
146
|
+
|
|
147
|
+
self.horizontalLayout_7.addWidget(self.cbType)
|
|
148
|
+
|
|
149
|
+
self.horizontalSpacer_3 = QSpacerItem(40, 20, QSizePolicy.Policy.Expanding, QSizePolicy.Policy.Minimum)
|
|
150
|
+
|
|
151
|
+
self.horizontalLayout_7.addItem(self.horizontalSpacer_3)
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
self.verticalLayout.addLayout(self.horizontalLayout_7)
|
|
155
|
+
|
|
156
|
+
self.lbValues = QLabel(Dialog)
|
|
157
|
+
self.lbValues.setObjectName(u"lbValues")
|
|
158
|
+
|
|
92
159
|
self.verticalLayout.addWidget(self.lbValues)
|
|
93
|
-
|
|
94
|
-
self.lwModifiers
|
|
160
|
+
|
|
161
|
+
self.lwModifiers = QListWidget(Dialog)
|
|
162
|
+
self.lwModifiers.setObjectName(u"lwModifiers")
|
|
163
|
+
|
|
95
164
|
self.verticalLayout.addWidget(self.lwModifiers)
|
|
96
|
-
|
|
97
|
-
self.horizontalLayout
|
|
98
|
-
self.
|
|
99
|
-
self.pbMoveUp
|
|
165
|
+
|
|
166
|
+
self.horizontalLayout = QHBoxLayout()
|
|
167
|
+
self.horizontalLayout.setObjectName(u"horizontalLayout")
|
|
168
|
+
self.pbMoveUp = QPushButton(Dialog)
|
|
169
|
+
self.pbMoveUp.setObjectName(u"pbMoveUp")
|
|
170
|
+
|
|
100
171
|
self.horizontalLayout.addWidget(self.pbMoveUp)
|
|
101
|
-
|
|
102
|
-
self.pbMoveDown
|
|
172
|
+
|
|
173
|
+
self.pbMoveDown = QPushButton(Dialog)
|
|
174
|
+
self.pbMoveDown.setObjectName(u"pbMoveDown")
|
|
175
|
+
|
|
103
176
|
self.horizontalLayout.addWidget(self.pbMoveDown)
|
|
177
|
+
|
|
178
|
+
self.pb_sort_modifiers = QPushButton(Dialog)
|
|
179
|
+
self.pb_sort_modifiers.setObjectName(u"pb_sort_modifiers")
|
|
180
|
+
|
|
181
|
+
self.horizontalLayout.addWidget(self.pb_sort_modifiers)
|
|
182
|
+
|
|
183
|
+
self.pbRemoveModifier = QPushButton(Dialog)
|
|
184
|
+
self.pbRemoveModifier.setObjectName(u"pbRemoveModifier")
|
|
185
|
+
|
|
186
|
+
self.horizontalLayout.addWidget(self.pbRemoveModifier)
|
|
187
|
+
|
|
188
|
+
|
|
104
189
|
self.verticalLayout.addLayout(self.horizontalLayout)
|
|
105
|
-
|
|
106
|
-
self.
|
|
107
|
-
self.
|
|
108
|
-
self.
|
|
109
|
-
self.
|
|
110
|
-
|
|
111
|
-
self.horizontalLayout_3 = QtWidgets.QHBoxLayout()
|
|
112
|
-
self.horizontalLayout_3.setObjectName("horizontalLayout_3")
|
|
113
|
-
self.pbAddSet = QtWidgets.QPushButton(Dialog)
|
|
114
|
-
self.pbAddSet.setObjectName("pbAddSet")
|
|
190
|
+
|
|
191
|
+
self.horizontalLayout_3 = QHBoxLayout()
|
|
192
|
+
self.horizontalLayout_3.setObjectName(u"horizontalLayout_3")
|
|
193
|
+
self.pbAddSet = QPushButton(Dialog)
|
|
194
|
+
self.pbAddSet.setObjectName(u"pbAddSet")
|
|
195
|
+
|
|
115
196
|
self.horizontalLayout_3.addWidget(self.pbAddSet)
|
|
116
|
-
|
|
117
|
-
self.
|
|
197
|
+
|
|
198
|
+
self.pbMoveSetLeft = QPushButton(Dialog)
|
|
199
|
+
self.pbMoveSetLeft.setObjectName(u"pbMoveSetLeft")
|
|
200
|
+
|
|
201
|
+
self.horizontalLayout_3.addWidget(self.pbMoveSetLeft)
|
|
202
|
+
|
|
203
|
+
self.pbMoveSetRight = QPushButton(Dialog)
|
|
204
|
+
self.pbMoveSetRight.setObjectName(u"pbMoveSetRight")
|
|
205
|
+
|
|
206
|
+
self.horizontalLayout_3.addWidget(self.pbMoveSetRight)
|
|
207
|
+
|
|
208
|
+
self.pbRemoveSet = QPushButton(Dialog)
|
|
209
|
+
self.pbRemoveSet.setObjectName(u"pbRemoveSet")
|
|
210
|
+
|
|
118
211
|
self.horizontalLayout_3.addWidget(self.pbRemoveSet)
|
|
212
|
+
|
|
213
|
+
|
|
119
214
|
self.verticalLayout.addLayout(self.horizontalLayout_3)
|
|
120
|
-
|
|
121
|
-
self.horizontalLayout_4
|
|
122
|
-
self.
|
|
123
|
-
self.
|
|
124
|
-
self.
|
|
125
|
-
|
|
126
|
-
self.
|
|
127
|
-
|
|
215
|
+
|
|
216
|
+
self.horizontalLayout_4 = QHBoxLayout()
|
|
217
|
+
self.horizontalLayout_4.setObjectName(u"horizontalLayout_4")
|
|
218
|
+
self.pb_add_subjects = QPushButton(Dialog)
|
|
219
|
+
self.pb_add_subjects.setObjectName(u"pb_add_subjects")
|
|
220
|
+
|
|
221
|
+
self.horizontalLayout_4.addWidget(self.pb_add_subjects)
|
|
222
|
+
|
|
223
|
+
self.pb_load_file = QPushButton(Dialog)
|
|
224
|
+
self.pb_load_file.setObjectName(u"pb_load_file")
|
|
225
|
+
|
|
226
|
+
self.horizontalLayout_4.addWidget(self.pb_load_file)
|
|
227
|
+
|
|
228
|
+
self.horizontalSpacer_2 = QSpacerItem(40, 20, QSizePolicy.Policy.Expanding, QSizePolicy.Policy.Minimum)
|
|
229
|
+
|
|
230
|
+
self.horizontalLayout_4.addItem(self.horizontalSpacer_2)
|
|
231
|
+
|
|
232
|
+
|
|
128
233
|
self.verticalLayout.addLayout(self.horizontalLayout_4)
|
|
129
|
-
|
|
130
|
-
self.
|
|
131
|
-
|
|
132
|
-
self.
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
self.verticalLayout_4.addLayout(self.
|
|
139
|
-
|
|
140
|
-
self.horizontalLayout_2
|
|
141
|
-
|
|
142
|
-
self.
|
|
143
|
-
|
|
144
|
-
self.
|
|
234
|
+
|
|
235
|
+
self.verticalSpacer_3 = QSpacerItem(20, 40, QSizePolicy.Policy.Minimum, QSizePolicy.Policy.Expanding)
|
|
236
|
+
|
|
237
|
+
self.verticalLayout.addItem(self.verticalSpacer_3)
|
|
238
|
+
|
|
239
|
+
|
|
240
|
+
self.horizontalLayout_8.addLayout(self.verticalLayout)
|
|
241
|
+
|
|
242
|
+
|
|
243
|
+
self.verticalLayout_4.addLayout(self.horizontalLayout_8)
|
|
244
|
+
|
|
245
|
+
self.horizontalLayout_2 = QHBoxLayout()
|
|
246
|
+
self.horizontalLayout_2.setObjectName(u"horizontalLayout_2")
|
|
247
|
+
self.horizontalSpacer = QSpacerItem(40, 20, QSizePolicy.Policy.Expanding, QSizePolicy.Policy.Minimum)
|
|
248
|
+
|
|
249
|
+
self.horizontalLayout_2.addItem(self.horizontalSpacer)
|
|
250
|
+
|
|
251
|
+
self.pbCancel = QPushButton(Dialog)
|
|
252
|
+
self.pbCancel.setObjectName(u"pbCancel")
|
|
253
|
+
|
|
145
254
|
self.horizontalLayout_2.addWidget(self.pbCancel)
|
|
146
|
-
|
|
147
|
-
self.pbOK
|
|
255
|
+
|
|
256
|
+
self.pbOK = QPushButton(Dialog)
|
|
257
|
+
self.pbOK.setObjectName(u"pbOK")
|
|
258
|
+
|
|
148
259
|
self.horizontalLayout_2.addWidget(self.pbOK)
|
|
260
|
+
|
|
261
|
+
|
|
149
262
|
self.verticalLayout_4.addLayout(self.horizontalLayout_2)
|
|
150
|
-
|
|
263
|
+
|
|
151
264
|
|
|
152
265
|
self.retranslateUi(Dialog)
|
|
266
|
+
|
|
153
267
|
self.tabWidgetModifiersSets.setCurrentIndex(-1)
|
|
154
|
-
|
|
268
|
+
|
|
269
|
+
|
|
270
|
+
QMetaObject.connectSlotsByName(Dialog)
|
|
271
|
+
# setupUi
|
|
155
272
|
|
|
156
273
|
def retranslateUi(self, Dialog):
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
self.lbModifier.setText(
|
|
160
|
-
self.lbCode.setText(
|
|
161
|
-
self.lbCodeHelp.setText(
|
|
162
|
-
self.
|
|
163
|
-
self.
|
|
164
|
-
self.
|
|
165
|
-
self.
|
|
166
|
-
self.
|
|
167
|
-
self.cbType.setItemText(
|
|
168
|
-
self.cbType.setItemText(
|
|
169
|
-
self.
|
|
170
|
-
self.
|
|
171
|
-
|
|
172
|
-
self.
|
|
173
|
-
self.
|
|
174
|
-
self.
|
|
175
|
-
self.
|
|
176
|
-
self.
|
|
177
|
-
self.
|
|
178
|
-
self.
|
|
179
|
-
self.
|
|
180
|
-
self.
|
|
181
|
-
self.
|
|
274
|
+
Dialog.setWindowTitle(QCoreApplication.translate("Dialog", u"Set modifiers", None))
|
|
275
|
+
self.cb_ask_at_stop.setText(QCoreApplication.translate("Dialog", u"Ask for modifier(s) when behavior stops", None))
|
|
276
|
+
self.lbModifier.setText(QCoreApplication.translate("Dialog", u"Modifier", None))
|
|
277
|
+
self.lbCode.setText(QCoreApplication.translate("Dialog", u"Shortcut", None))
|
|
278
|
+
self.lbCodeHelp.setText(QCoreApplication.translate("Dialog", u"The shortcut is case sensitive. Type one character or a function key (F1, F2... F12)", None))
|
|
279
|
+
self.pbAddModifier.setText(QCoreApplication.translate("Dialog", u"->", None))
|
|
280
|
+
self.pbModifyModifier.setText(QCoreApplication.translate("Dialog", u"<-", None))
|
|
281
|
+
self.lb_name.setText(QCoreApplication.translate("Dialog", u"Set name", None))
|
|
282
|
+
self.lb_description.setText(QCoreApplication.translate("Dialog", u"Description", None))
|
|
283
|
+
self.lbType.setText(QCoreApplication.translate("Dialog", u"Modifier type", None))
|
|
284
|
+
self.cbType.setItemText(0, QCoreApplication.translate("Dialog", u"Single selection", None))
|
|
285
|
+
self.cbType.setItemText(1, QCoreApplication.translate("Dialog", u"Multiple selection", None))
|
|
286
|
+
self.cbType.setItemText(2, QCoreApplication.translate("Dialog", u"Numeric", None))
|
|
287
|
+
self.cbType.setItemText(3, QCoreApplication.translate("Dialog", u"Value from external data file", None))
|
|
288
|
+
|
|
289
|
+
self.lbValues.setText(QCoreApplication.translate("Dialog", u"Values", None))
|
|
290
|
+
self.pbMoveUp.setText(QCoreApplication.translate("Dialog", u"Move modifier up", None))
|
|
291
|
+
self.pbMoveDown.setText(QCoreApplication.translate("Dialog", u"Move modifier down", None))
|
|
292
|
+
self.pb_sort_modifiers.setText(QCoreApplication.translate("Dialog", u"Sort modifiers", None))
|
|
293
|
+
self.pbRemoveModifier.setText(QCoreApplication.translate("Dialog", u"Remove modifier", None))
|
|
294
|
+
self.pbAddSet.setText(QCoreApplication.translate("Dialog", u"Add set of modifiers", None))
|
|
295
|
+
self.pbMoveSetLeft.setText(QCoreApplication.translate("Dialog", u"Move set left", None))
|
|
296
|
+
self.pbMoveSetRight.setText(QCoreApplication.translate("Dialog", u"Move set right", None))
|
|
297
|
+
self.pbRemoveSet.setText(QCoreApplication.translate("Dialog", u"Remove set of modifiers", None))
|
|
298
|
+
self.pb_add_subjects.setText(QCoreApplication.translate("Dialog", u"Add subjects as modifiers", None))
|
|
299
|
+
self.pb_load_file.setText(QCoreApplication.translate("Dialog", u"Load modifiers from file", None))
|
|
300
|
+
self.pbCancel.setText(QCoreApplication.translate("Dialog", u"Cancel", None))
|
|
301
|
+
self.pbOK.setText(QCoreApplication.translate("Dialog", u"OK", None))
|
|
302
|
+
# retranslateUi
|
|
303
|
+
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"""
|
|
2
2
|
BORIS
|
|
3
3
|
Behavioral Observation Research Interactive Software
|
|
4
|
-
Copyright 2012-
|
|
4
|
+
Copyright 2012-2025 Olivier Friard
|
|
5
5
|
|
|
6
6
|
This program is free software; you can redistribute it and/or modify
|
|
7
7
|
it under the terms of the GNU General Public License as published by
|
|
@@ -19,16 +19,15 @@ Copyright 2012-2023 Olivier Friard
|
|
|
19
19
|
MA 02110-1301, USA.
|
|
20
20
|
"""
|
|
21
21
|
|
|
22
|
-
from decimal import Decimal as dec
|
|
23
22
|
import pathlib
|
|
24
23
|
import re
|
|
25
24
|
import statistics
|
|
26
25
|
import sys
|
|
27
26
|
|
|
28
27
|
import tablib
|
|
29
|
-
from
|
|
30
|
-
from
|
|
31
|
-
from
|
|
28
|
+
from PySide6.QtCore import Qt
|
|
29
|
+
from PySide6.QtGui import QIcon
|
|
30
|
+
from PySide6.QtWidgets import (
|
|
32
31
|
QDialog,
|
|
33
32
|
QFileDialog,
|
|
34
33
|
QHBoxLayout,
|
|
@@ -156,7 +155,7 @@ class Advanced_event_filtering_dialog(QDialog):
|
|
|
156
155
|
hbox.addItem(QSpacerItem(241, 20, QSizePolicy.Expanding, QSizePolicy.Minimum))
|
|
157
156
|
self.pb_save = QPushButton("Save results", clicked=self.save_results)
|
|
158
157
|
hbox.addWidget(self.pb_save)
|
|
159
|
-
self.pb_close = QPushButton(
|
|
158
|
+
self.pb_close = QPushButton(cfg.CLOSE, clicked=self.close)
|
|
160
159
|
hbox.addWidget(self.pb_close)
|
|
161
160
|
vbox.addLayout(hbox)
|
|
162
161
|
|
|
@@ -190,7 +189,6 @@ class Advanced_event_filtering_dialog(QDialog):
|
|
|
190
189
|
add selected logic operaton to lineedit
|
|
191
190
|
"""
|
|
192
191
|
if self.lw3.currentItem():
|
|
193
|
-
|
|
194
192
|
text = ""
|
|
195
193
|
if self.lw3.currentItem().text() == "AND":
|
|
196
194
|
text = " & "
|
|
@@ -208,7 +206,7 @@ class Advanced_event_filtering_dialog(QDialog):
|
|
|
208
206
|
if not self.logic.text():
|
|
209
207
|
return
|
|
210
208
|
if self.logic.text().count('"') % 2:
|
|
211
|
-
QMessageBox.warning(self, cfg.programName,
|
|
209
|
+
QMessageBox.warning(self, cfg.programName, 'Wrong number of double quotes (")')
|
|
212
210
|
return
|
|
213
211
|
|
|
214
212
|
sb_list = re.findall('"([^"]*)"', self.logic.text())
|
|
@@ -237,15 +235,13 @@ class Advanced_event_filtering_dialog(QDialog):
|
|
|
237
235
|
self.tw.clear()
|
|
238
236
|
|
|
239
237
|
if flag_error or self.rb_details.isChecked():
|
|
240
|
-
|
|
241
|
-
self.lb_results.setText(f"Results ({len(self.out)} event{'s'*(len(self.out) > 1)})")
|
|
238
|
+
self.lb_results.setText(f"Results ({len(self.out)} event{'s' * (len(self.out) > 1)})")
|
|
242
239
|
|
|
243
240
|
self.tw.setRowCount(len(self.out))
|
|
244
241
|
self.tw.setColumnCount(len(self.details_header)) # obs_id, comment, start, stop, duration
|
|
245
242
|
self.tw.setHorizontalHeaderLabels(self.details_header)
|
|
246
243
|
|
|
247
244
|
if not flag_error and self.rb_summary.isChecked():
|
|
248
|
-
|
|
249
245
|
summary = {}
|
|
250
246
|
for row in self.out:
|
|
251
247
|
obs_id, _, start, stop, duration = row
|
|
@@ -255,7 +251,6 @@ class Advanced_event_filtering_dialog(QDialog):
|
|
|
255
251
|
|
|
256
252
|
self.out = []
|
|
257
253
|
for obs_id in summary:
|
|
258
|
-
|
|
259
254
|
self.out.append(
|
|
260
255
|
[
|
|
261
256
|
obs_id,
|
|
@@ -266,7 +261,7 @@ class Advanced_event_filtering_dialog(QDialog):
|
|
|
266
261
|
]
|
|
267
262
|
)
|
|
268
263
|
|
|
269
|
-
self.lb_results.setText(f"Results ({len(summary)} observation{'s'*(len(summary) > 1)})")
|
|
264
|
+
self.lb_results.setText(f"Results ({len(summary)} observation{'s' * (len(summary) > 1)})")
|
|
270
265
|
self.tw.setRowCount(len(summary))
|
|
271
266
|
self.tw.setColumnCount(len(self.summary_header)) # obs_id, mean, stdev
|
|
272
267
|
self.tw.setHorizontalHeaderLabels(self.summary_header)
|
|
@@ -303,9 +298,7 @@ class Advanced_event_filtering_dialog(QDialog):
|
|
|
303
298
|
# check if file with new extension already exists
|
|
304
299
|
if pathlib.Path(file_name).is_file():
|
|
305
300
|
if (
|
|
306
|
-
dialog.MessageDialog(
|
|
307
|
-
cfg.programName, f"The file {file_name} already exists.", [cfg.CANCEL, cfg.OVERWRITE]
|
|
308
|
-
)
|
|
301
|
+
dialog.MessageDialog(cfg.programName, f"The file {file_name} already exists.", [cfg.CANCEL, cfg.OVERWRITE])
|
|
309
302
|
== cfg.CANCEL
|
|
310
303
|
):
|
|
311
304
|
return
|
|
@@ -357,22 +350,27 @@ def event_filtering(self):
|
|
|
357
350
|
)
|
|
358
351
|
return
|
|
359
352
|
|
|
360
|
-
max_media_duration_all_obs, _ = observation_operations.media_duration(
|
|
361
|
-
|
|
362
|
-
)
|
|
353
|
+
max_media_duration_all_obs, _ = observation_operations.media_duration(self.pj[cfg.OBSERVATIONS], selected_observations)
|
|
354
|
+
|
|
355
|
+
start_interval, end_interval = observation_operations.time_intervals_range(self.pj[cfg.OBSERVATIONS], selected_observations)
|
|
363
356
|
|
|
364
357
|
parameters = select_subj_behav.choose_obs_subj_behav_category(
|
|
365
358
|
self,
|
|
366
359
|
selected_observations,
|
|
367
360
|
start_coding=start_coding,
|
|
368
361
|
end_coding=end_coding,
|
|
362
|
+
# start_interval=start_interval,
|
|
363
|
+
# end_interval=end_interval,
|
|
364
|
+
start_interval=None,
|
|
365
|
+
end_interval=None,
|
|
369
366
|
maxTime=max_media_duration_all_obs,
|
|
370
|
-
|
|
371
|
-
|
|
367
|
+
show_include_modifiers=False,
|
|
368
|
+
show_exclude_non_coded_behaviors=False,
|
|
372
369
|
by_category=False,
|
|
373
370
|
n_observations=len(selected_observations),
|
|
374
371
|
)
|
|
375
|
-
|
|
372
|
+
|
|
373
|
+
if not parameters:
|
|
376
374
|
return
|
|
377
375
|
|
|
378
376
|
if not parameters[cfg.SELECTED_SUBJECTS] or not parameters[cfg.SELECTED_BEHAVIORS]:
|
|
@@ -389,7 +387,7 @@ def event_filtering(self):
|
|
|
389
387
|
cursor.execute("SELECT MIN(start), MAX(stop) FROM aggregated_events")
|
|
390
388
|
min_time, max_time = cursor.fetchone()
|
|
391
389
|
|
|
392
|
-
if parameters[cfg.TIME_INTERVAL]
|
|
390
|
+
if parameters[cfg.TIME_INTERVAL] in (cfg.TIME_ARBITRARY_INTERVAL, cfg.TIME_OBS_INTERVAL):
|
|
393
391
|
min_time = float(parameters[cfg.START_TIME])
|
|
394
392
|
max_time = float(parameters[cfg.END_TIME])
|
|
395
393
|
|
|
@@ -438,7 +436,7 @@ def event_filtering(self):
|
|
|
438
436
|
for row in cursor.fetchall():
|
|
439
437
|
obs, subj, behav, start, stop = row
|
|
440
438
|
if obs not in events:
|
|
441
|
-
events[obs]
|
|
439
|
+
events[obs] = {}
|
|
442
440
|
|
|
443
441
|
# use function in base at event (state or point)
|
|
444
442
|
interval_func = icc if start == stop else ico
|
|
@@ -452,10 +450,6 @@ def event_filtering(self):
|
|
|
452
450
|
|
|
453
451
|
w = Advanced_event_filtering_dialog(events)
|
|
454
452
|
w.lb_time_interval.setText(
|
|
455
|
-
(
|
|
456
|
-
f"Time interval: "
|
|
457
|
-
f"{util.dynamic_time_format(min_time, cfg.DYNAMIC_TIME_CUTOFF_DEFAULT, self.timeFormat)} - "
|
|
458
|
-
f"{util.dynamic_time_format(max_time, cfg.DYNAMIC_TIME_CUTOFF_DEFAULT, self.timeFormat)}"
|
|
459
|
-
)
|
|
453
|
+
(f"Time interval: {util.smart_time_format(min_time, self.timeFormat)} - {util.smart_time_format(max_time, self.timeFormat)}")
|
|
460
454
|
)
|
|
461
455
|
w.exec_()
|
|
File without changes
|