boris-behav-obs 9.7.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 boris-behav-obs might be problematic. Click here for more details.

Files changed (109) hide show
  1. boris/__init__.py +26 -0
  2. boris/__main__.py +25 -0
  3. boris/about.py +143 -0
  4. boris/add_modifier.py +635 -0
  5. boris/add_modifier_ui.py +303 -0
  6. boris/advanced_event_filtering.py +455 -0
  7. boris/analysis_plugins/__init__.py +0 -0
  8. boris/analysis_plugins/_latency.py +59 -0
  9. boris/analysis_plugins/irr_cohen_kappa.py +109 -0
  10. boris/analysis_plugins/irr_cohen_kappa_with_modifiers.py +112 -0
  11. boris/analysis_plugins/irr_weighted_cohen_kappa.py +157 -0
  12. boris/analysis_plugins/irr_weighted_cohen_kappa_with_modifiers.py +162 -0
  13. boris/analysis_plugins/list_of_dataframe_columns.py +22 -0
  14. boris/analysis_plugins/number_of_occurences.py +22 -0
  15. boris/analysis_plugins/number_of_occurences_by_independent_variable.py +54 -0
  16. boris/analysis_plugins/time_budget.py +61 -0
  17. boris/behav_coding_map_creator.py +1110 -0
  18. boris/behavior_binary_table.py +305 -0
  19. boris/behaviors_coding_map.py +239 -0
  20. boris/boris_cli.py +340 -0
  21. boris/cmd_arguments.py +49 -0
  22. boris/coding_pad.py +280 -0
  23. boris/config.py +785 -0
  24. boris/config_file.py +356 -0
  25. boris/connections.py +409 -0
  26. boris/converters.py +333 -0
  27. boris/converters_ui.py +225 -0
  28. boris/cooccurence.py +250 -0
  29. boris/core.py +5901 -0
  30. boris/core_qrc.py +15958 -0
  31. boris/core_ui.py +1107 -0
  32. boris/db_functions.py +324 -0
  33. boris/dev.py +134 -0
  34. boris/dialog.py +1108 -0
  35. boris/duration_widget.py +238 -0
  36. boris/edit_event.py +245 -0
  37. boris/edit_event_ui.py +233 -0
  38. boris/event_operations.py +1040 -0
  39. boris/events_cursor.py +61 -0
  40. boris/events_snapshots.py +596 -0
  41. boris/exclusion_matrix.py +141 -0
  42. boris/export_events.py +1006 -0
  43. boris/export_observation.py +1203 -0
  44. boris/external_processes.py +332 -0
  45. boris/geometric_measurement.py +941 -0
  46. boris/gui_utilities.py +135 -0
  47. boris/image_overlay.py +72 -0
  48. boris/import_observations.py +242 -0
  49. boris/ipc_mpv.py +325 -0
  50. boris/irr.py +634 -0
  51. boris/latency.py +244 -0
  52. boris/measurement_widget.py +161 -0
  53. boris/media_file.py +115 -0
  54. boris/menu_options.py +213 -0
  55. boris/modifier_coding_map_creator.py +1013 -0
  56. boris/modifiers_coding_map.py +157 -0
  57. boris/mpv.py +2016 -0
  58. boris/mpv2.py +2193 -0
  59. boris/observation.py +1453 -0
  60. boris/observation_operations.py +2538 -0
  61. boris/observation_ui.py +679 -0
  62. boris/observations_list.py +337 -0
  63. boris/otx_parser.py +442 -0
  64. boris/param_panel.py +201 -0
  65. boris/param_panel_ui.py +305 -0
  66. boris/player_dock_widget.py +198 -0
  67. boris/plot_data_module.py +536 -0
  68. boris/plot_events.py +634 -0
  69. boris/plot_events_rt.py +237 -0
  70. boris/plot_spectrogram_rt.py +316 -0
  71. boris/plot_waveform_rt.py +230 -0
  72. boris/plugins.py +431 -0
  73. boris/portion/__init__.py +31 -0
  74. boris/portion/const.py +95 -0
  75. boris/portion/dict.py +365 -0
  76. boris/portion/func.py +52 -0
  77. boris/portion/interval.py +581 -0
  78. boris/portion/io.py +181 -0
  79. boris/preferences.py +510 -0
  80. boris/preferences_ui.py +770 -0
  81. boris/project.py +2007 -0
  82. boris/project_functions.py +2041 -0
  83. boris/project_import_export.py +1096 -0
  84. boris/project_ui.py +794 -0
  85. boris/qrc_boris.py +10389 -0
  86. boris/qrc_boris5.py +2579 -0
  87. boris/select_modifiers.py +312 -0
  88. boris/select_observations.py +210 -0
  89. boris/select_subj_behav.py +286 -0
  90. boris/state_events.py +197 -0
  91. boris/subjects_pad.py +106 -0
  92. boris/synthetic_time_budget.py +290 -0
  93. boris/time_budget_functions.py +1136 -0
  94. boris/time_budget_widget.py +1039 -0
  95. boris/transitions.py +365 -0
  96. boris/utilities.py +1810 -0
  97. boris/version.py +24 -0
  98. boris/video_equalizer.py +159 -0
  99. boris/video_equalizer_ui.py +248 -0
  100. boris/video_operations.py +310 -0
  101. boris/view_df.py +104 -0
  102. boris/view_df_ui.py +75 -0
  103. boris/write_event.py +538 -0
  104. boris_behav_obs-9.7.7.dist-info/METADATA +139 -0
  105. boris_behav_obs-9.7.7.dist-info/RECORD +109 -0
  106. boris_behav_obs-9.7.7.dist-info/WHEEL +5 -0
  107. boris_behav_obs-9.7.7.dist-info/entry_points.txt +2 -0
  108. boris_behav_obs-9.7.7.dist-info/licenses/LICENSE.TXT +674 -0
  109. boris_behav_obs-9.7.7.dist-info/top_level.txt +1 -0
@@ -0,0 +1,141 @@
1
+ """
2
+ BORIS
3
+ Behavioral Observation Research Interactive Software
4
+ Copyright 2012-2025 Olivier Friard
5
+
6
+ This file is part of BORIS.
7
+
8
+ BORIS is free software; you can redistribute it and/or modify
9
+ it under the terms of the GNU General Public License as published by
10
+ the Free Software Foundation; either version 3 of the License, or
11
+ any later version.
12
+
13
+ BORIS is distributed in the hope that it will be useful,
14
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
15
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
+ GNU General Public License for more details.
17
+
18
+ You should have received a copy of the GNU General Public License
19
+ along with this program; if not see <http://www.gnu.org/licenses/>.
20
+
21
+ """
22
+
23
+ import logging
24
+ from PySide6.QtWidgets import (
25
+ QDialog,
26
+ QVBoxLayout,
27
+ QHBoxLayout,
28
+ QPushButton,
29
+ QLabel,
30
+ QTableWidget,
31
+ QSpacerItem,
32
+ QAbstractItemView,
33
+ QSizePolicy,
34
+ )
35
+
36
+
37
+ class ExclusionMatrix(QDialog):
38
+ def __init__(self):
39
+ super().__init__()
40
+
41
+ hbox = QVBoxLayout(self)
42
+
43
+ self.label = QLabel()
44
+ self.label.setText(
45
+ ("Check if behaviors are mutually exclusive.\nThe Point events (displayed on blue background) cannot be excluded)")
46
+ )
47
+ hbox.addWidget(self.label)
48
+
49
+ self.twExclusions = QTableWidget()
50
+ self.twExclusions.setSelectionBehavior(QAbstractItemView.SelectRows)
51
+ self.twExclusions.setAlternatingRowColors(True)
52
+ self.twExclusions.setEditTriggers(QAbstractItemView.NoEditTriggers)
53
+ hbox.addWidget(self.twExclusions)
54
+
55
+ hbox2 = QHBoxLayout()
56
+ spacer_item = QSpacerItem(40, 20, QSizePolicy.Expanding, QSizePolicy.Minimum)
57
+ hbox2.addItem(spacer_item)
58
+
59
+ self.pb_select_all = QPushButton("Check all")
60
+ self.pb_select_all.clicked.connect(lambda: self.pb_cb_selection("select"))
61
+ hbox2.addWidget(self.pb_select_all)
62
+
63
+ self.pb_unselect_all = QPushButton("Uncheck all")
64
+ self.pb_unselect_all.clicked.connect(lambda: self.pb_cb_selection("unselect"))
65
+ hbox2.addWidget(self.pb_unselect_all)
66
+
67
+ self.pb_revert_selection = QPushButton("Revert check")
68
+ self.pb_revert_selection.clicked.connect(lambda: self.pb_cb_selection("revert"))
69
+ hbox2.addWidget(self.pb_revert_selection)
70
+
71
+ self.pb_check_selected = QPushButton("Check selected")
72
+ self.pb_check_selected.clicked.connect(lambda: self.pb_selected(True))
73
+ hbox2.addWidget(self.pb_check_selected)
74
+
75
+ self.pb_uncheck_selected = QPushButton("Uncheck selected")
76
+ self.pb_uncheck_selected.clicked.connect(lambda: self.pb_selected(False))
77
+ hbox2.addWidget(self.pb_uncheck_selected)
78
+
79
+ self.pbCancel = QPushButton("Cancel")
80
+ self.pbCancel.clicked.connect(self.reject)
81
+ hbox2.addWidget(self.pbCancel)
82
+
83
+ self.pbOK = QPushButton("OK", clicked=self.accept)
84
+ hbox2.addWidget(self.pbOK)
85
+
86
+ hbox.addLayout(hbox2)
87
+ self.setLayout(hbox)
88
+
89
+ self.setWindowTitle("Behaviors exclusion matrix")
90
+ self.setGeometry(100, 100, 600, 400)
91
+
92
+ def pb_selected(self, to_check: bool):
93
+ """
94
+ check/uncheck the checkbox in selected cells
95
+
96
+ Args:
97
+ to_check (boolean): True to check else False
98
+ """
99
+ for selected_range in self.twExclusions.selectedRanges():
100
+ for row in range(selected_range.topRow(), selected_range.bottomRow() + 1):
101
+ for column in range(self.twExclusions.columnCount()):
102
+ try:
103
+ self.twExclusions.cellWidget(row, column).setChecked(to_check)
104
+ except Exception:
105
+ logging.warning(f"Error during checking/unchecking for {row}/{column} in exclusion matrix")
106
+ self.cb_clicked()
107
+
108
+ def pb_cb_selection(self, mode):
109
+ """
110
+ button for checkbox selection/deselection and revert selection
111
+
112
+ Args:
113
+ mode (str): select, unselect, revert
114
+
115
+ """
116
+
117
+ for r in range(self.twExclusions.rowCount()):
118
+ for c in range(self.twExclusions.columnCount()):
119
+ if mode == "select":
120
+ state = True
121
+ if mode == "unselect":
122
+ state = False
123
+ try:
124
+ if mode == "revert":
125
+ state = not self.twExclusions.cellWidget(r, c).isChecked()
126
+ self.twExclusions.cellWidget(r, c).setChecked(state)
127
+ except Exception:
128
+ logging.warning(f"Error during checking/unchecking for {r}/{c} in exclusion matrix")
129
+
130
+ def cb_clicked(self):
131
+ """
132
+ de/select the corresponding checkbox
133
+ """
134
+ for r, r_name in enumerate(self.stateBehaviors + self.point_behaviors):
135
+ for c, c_name in enumerate(self.stateBehaviors):
136
+ if c_name != r_name:
137
+ try:
138
+ if f"{c_name}|{r_name}" in self.checkboxes:
139
+ self.checkboxes[f"{c_name}|{r_name}"].setChecked(self.checkboxes[f"{r_name}|{c_name}"].isChecked())
140
+ except Exception:
141
+ logging.warning(f"Error during checking/unchecking for {r_name}/{c_name} in exclusion matrix")