boris-behav-obs 8.16.5__py3-none-any.whl → 9.7.1__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 +24 -36
- boris/add_modifier.py +88 -80
- boris/add_modifier_ui.py +235 -131
- boris/advanced_event_filtering.py +23 -29
- boris/analysis_plugins/__init__.py +0 -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 +228 -229
- 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 +16 -34
- boris/config.py +102 -50
- boris/config_file.py +55 -64
- boris/connections.py +105 -58
- boris/converters.py +13 -37
- boris/converters_ui.py +187 -110
- boris/cooccurence.py +250 -0
- boris/core.py +2108 -1275
- 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 +304 -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 +493 -210
- boris/observation_operations.py +1010 -391
- 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 +18 -53
- boris/plot_events.py +56 -153
- boris/plot_events_rt.py +16 -30
- boris/plot_spectrogram_rt.py +80 -56
- boris/plot_waveform_rt.py +23 -48
- boris/plugins.py +431 -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 +298 -123
- boris/preferences_ui.py +664 -225
- boris/project.py +293 -270
- boris/project_functions.py +610 -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 +6 -8
- 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 +562 -222
- boris/version.py +3 -3
- boris/video_equalizer.py +16 -14
- boris/video_equalizer_ui.py +199 -130
- boris/video_operations.py +78 -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.1.dist-info/METADATA +140 -0
- boris_behav_obs-9.7.1.dist-info/RECORD +109 -0
- {boris_behav_obs-8.16.5.dist-info → boris_behav_obs-9.7.1.dist-info}/WHEEL +1 -1
- boris_behav_obs-9.7.1.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.1.dist-info/licenses}/LICENSE.TXT +0 -0
- {boris_behav_obs-8.16.5.dist-info → boris_behav_obs-9.7.1.dist-info}/top_level.txt +0 -0
boris/view_df.py
ADDED
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
from .view_df_ui import Ui_Form
|
|
2
|
+
from PySide6.QtWidgets import QWidget, QFileDialog
|
|
3
|
+
from PySide6.QtCore import Qt, QAbstractTableModel
|
|
4
|
+
|
|
5
|
+
from . import config as cfg
|
|
6
|
+
from pathlib import Path
|
|
7
|
+
from . import dialog
|
|
8
|
+
|
|
9
|
+
try:
|
|
10
|
+
import pyreadr
|
|
11
|
+
|
|
12
|
+
flag_pyreadr_loaded = True
|
|
13
|
+
except ModuleNotFoundError:
|
|
14
|
+
flag_pyreadr_loaded = False
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
class DataFrameModel(QAbstractTableModel):
|
|
18
|
+
def __init__(self, dataframe):
|
|
19
|
+
super().__init__()
|
|
20
|
+
self._dataframe = dataframe
|
|
21
|
+
|
|
22
|
+
def rowCount(self, parent=None):
|
|
23
|
+
return self._dataframe.shape[0]
|
|
24
|
+
|
|
25
|
+
def columnCount(self, parent=None):
|
|
26
|
+
return self._dataframe.shape[1]
|
|
27
|
+
|
|
28
|
+
def data(self, index, role=Qt.DisplayRole):
|
|
29
|
+
if role == Qt.DisplayRole:
|
|
30
|
+
return str(self._dataframe.iat[index.row(), index.column()])
|
|
31
|
+
return None
|
|
32
|
+
|
|
33
|
+
def headerData(self, section, orientation, role=Qt.DisplayRole):
|
|
34
|
+
if role == Qt.DisplayRole:
|
|
35
|
+
if orientation == Qt.Horizontal:
|
|
36
|
+
return self._dataframe.columns[section]
|
|
37
|
+
elif orientation == Qt.Vertical:
|
|
38
|
+
return self._dataframe.index[section]
|
|
39
|
+
return None
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
class View_df(QWidget, Ui_Form):
|
|
43
|
+
def __init__(self, plugin_name: str, plugin_version: str, df, parent=None):
|
|
44
|
+
super().__init__()
|
|
45
|
+
self.plugin_name = plugin_name
|
|
46
|
+
self.df = df
|
|
47
|
+
|
|
48
|
+
self.setupUi(self)
|
|
49
|
+
self.lb_plugin_info.setText(f"{plugin_name} v. {plugin_version}")
|
|
50
|
+
self.setWindowTitle(f"{plugin_name} v. {plugin_version}")
|
|
51
|
+
|
|
52
|
+
self.pb_close.clicked.connect(self.close)
|
|
53
|
+
self.pb_save.clicked.connect(self.save)
|
|
54
|
+
|
|
55
|
+
model = DataFrameModel(self.df)
|
|
56
|
+
self.tv_df.setModel(model)
|
|
57
|
+
|
|
58
|
+
def save(self):
|
|
59
|
+
file_formats = (
|
|
60
|
+
cfg.TSV,
|
|
61
|
+
cfg.CSV,
|
|
62
|
+
cfg.ODS,
|
|
63
|
+
cfg.XLSX,
|
|
64
|
+
# cfg.XLS,
|
|
65
|
+
cfg.HTML,
|
|
66
|
+
# cfg.TBS,
|
|
67
|
+
cfg.PANDAS_DF,
|
|
68
|
+
cfg.RDS,
|
|
69
|
+
)
|
|
70
|
+
|
|
71
|
+
file_dialog_options = QFileDialog.Options()
|
|
72
|
+
file_dialog_options |= QFileDialog.DontConfirmOverwrite
|
|
73
|
+
|
|
74
|
+
file_name, filter_ = QFileDialog().getSaveFileName(
|
|
75
|
+
None, f"Save {self.plugin_name}", "", ";;".join(file_formats), options=file_dialog_options
|
|
76
|
+
)
|
|
77
|
+
if not file_name:
|
|
78
|
+
return
|
|
79
|
+
|
|
80
|
+
outputFormat = cfg.FILE_NAME_SUFFIX[filter_]
|
|
81
|
+
if Path(file_name).suffix != "." + outputFormat:
|
|
82
|
+
file_name = f"{file_name}.{outputFormat}"
|
|
83
|
+
if Path(file_name).exists():
|
|
84
|
+
if (
|
|
85
|
+
dialog.MessageDialog(cfg.programName, f"The file {file_name} already exists.", [cfg.CANCEL, cfg.OVERWRITE])
|
|
86
|
+
== cfg.CANCEL
|
|
87
|
+
):
|
|
88
|
+
return
|
|
89
|
+
|
|
90
|
+
if filter_ == cfg.TSV:
|
|
91
|
+
self.df.to_csv(file_name, sep="\t", index=False)
|
|
92
|
+
if filter_ == cfg.CSV:
|
|
93
|
+
self.df.to_csv(file_name, sep=";", index=False)
|
|
94
|
+
if filter_ == cfg.XLSX:
|
|
95
|
+
self.df.to_excel(file_name, index=False)
|
|
96
|
+
if filter_ == cfg.ODS:
|
|
97
|
+
self.df.to_excel(file_name, index=False, engine="odf")
|
|
98
|
+
if filter_ == cfg.HTML:
|
|
99
|
+
self.df.to_html(file_name, index=False)
|
|
100
|
+
if filter_ == cfg.PANDAS_DF:
|
|
101
|
+
self.df.to_pickle(file_name)
|
|
102
|
+
|
|
103
|
+
if filter_ == cfg.RDS and flag_pyreadr_loaded:
|
|
104
|
+
pyreadr.write_rds(file_name, self.df)
|
boris/view_df_ui.py
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
|
|
3
|
+
################################################################################
|
|
4
|
+
## Form generated from reading UI file 'view_df.ui'
|
|
5
|
+
##
|
|
6
|
+
## Created by: Qt User Interface Compiler version 6.8.0
|
|
7
|
+
##
|
|
8
|
+
## WARNING! All changes made in this file will be lost when recompiling UI file!
|
|
9
|
+
################################################################################
|
|
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, QHBoxLayout, QHeaderView, QLabel,
|
|
19
|
+
QPushButton, QSizePolicy, QSpacerItem, QTableView,
|
|
20
|
+
QVBoxLayout, QWidget)
|
|
21
|
+
|
|
22
|
+
class Ui_Form(object):
|
|
23
|
+
def setupUi(self, Form):
|
|
24
|
+
if not Form.objectName():
|
|
25
|
+
Form.setObjectName(u"Form")
|
|
26
|
+
Form.resize(400, 300)
|
|
27
|
+
self.verticalLayout_2 = QVBoxLayout(Form)
|
|
28
|
+
self.verticalLayout_2.setObjectName(u"verticalLayout_2")
|
|
29
|
+
self.lb_plugin_info = QLabel(Form)
|
|
30
|
+
self.lb_plugin_info.setObjectName(u"lb_plugin_info")
|
|
31
|
+
|
|
32
|
+
self.verticalLayout_2.addWidget(self.lb_plugin_info)
|
|
33
|
+
|
|
34
|
+
self.verticalLayout = QVBoxLayout()
|
|
35
|
+
self.verticalLayout.setObjectName(u"verticalLayout")
|
|
36
|
+
self.tv_df = QTableView(Form)
|
|
37
|
+
self.tv_df.setObjectName(u"tv_df")
|
|
38
|
+
|
|
39
|
+
self.verticalLayout.addWidget(self.tv_df)
|
|
40
|
+
|
|
41
|
+
self.horizontalLayout = QHBoxLayout()
|
|
42
|
+
self.horizontalLayout.setObjectName(u"horizontalLayout")
|
|
43
|
+
self.horizontalSpacer = QSpacerItem(40, 20, QSizePolicy.Policy.Expanding, QSizePolicy.Policy.Minimum)
|
|
44
|
+
|
|
45
|
+
self.horizontalLayout.addItem(self.horizontalSpacer)
|
|
46
|
+
|
|
47
|
+
self.pb_save = QPushButton(Form)
|
|
48
|
+
self.pb_save.setObjectName(u"pb_save")
|
|
49
|
+
|
|
50
|
+
self.horizontalLayout.addWidget(self.pb_save)
|
|
51
|
+
|
|
52
|
+
self.pb_close = QPushButton(Form)
|
|
53
|
+
self.pb_close.setObjectName(u"pb_close")
|
|
54
|
+
|
|
55
|
+
self.horizontalLayout.addWidget(self.pb_close)
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
self.verticalLayout.addLayout(self.horizontalLayout)
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
self.verticalLayout_2.addLayout(self.verticalLayout)
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
self.retranslateUi(Form)
|
|
65
|
+
|
|
66
|
+
QMetaObject.connectSlotsByName(Form)
|
|
67
|
+
# setupUi
|
|
68
|
+
|
|
69
|
+
def retranslateUi(self, Form):
|
|
70
|
+
Form.setWindowTitle(QCoreApplication.translate("Form", u"Form", None))
|
|
71
|
+
self.lb_plugin_info.setText(QCoreApplication.translate("Form", u"TextLabel", None))
|
|
72
|
+
self.pb_save.setText(QCoreApplication.translate("Form", u"Save results", None))
|
|
73
|
+
self.pb_close.setText(QCoreApplication.translate("Form", u"Close", None))
|
|
74
|
+
# retranslateUi
|
|
75
|
+
|