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
boris/__init__.py ADDED
@@ -0,0 +1,26 @@
1
+ """
2
+ BORIS
3
+ Behavioral Observation Research Interactive Software
4
+
5
+ Copyright 2012-2025 Olivier Friard
6
+
7
+ This file is part of BORIS.
8
+
9
+ BORIS is free software; you can redistribute it and/or modify
10
+ it under the terms of the GNU General Public License as published by
11
+ the Free Software Foundation; either version 3 of the License, or
12
+ any later version.
13
+
14
+ BORIS is distributed in the hope that it will be useful,
15
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
16
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17
+ GNU General Public License for more details.
18
+
19
+ You should have received a copy of the GNU General Public License
20
+ along with this program; if not see <http://www.gnu.org/licenses/>.
21
+
22
+ """
23
+
24
+ from .core import main
25
+
26
+ name = "BORIS"
boris/__main__.py ADDED
@@ -0,0 +1,25 @@
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
+ from boris import main
24
+
25
+ main()
boris/about.py ADDED
@@ -0,0 +1,143 @@
1
+ """
2
+ BORIS
3
+ Behavioral Observation Research Interactive Software
4
+ Copyright 2012-2025 Olivier Friard
5
+
6
+ This program is free software; you can redistribute it and/or modify
7
+ it under the terms of the GNU General Public License as published by
8
+ the Free Software Foundation; either version 2 of the License, or
9
+ (at your option) any later version.
10
+
11
+ This program is distributed in the hope that it will be useful,
12
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
13
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
+ GNU General Public License for more details.
15
+
16
+ You should have received a copy of the GNU General Public License
17
+ along with this program; if not, write to the Free Software
18
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19
+ MA 02110-1301, USA.
20
+ """
21
+
22
+ import sys
23
+ import subprocess
24
+ import platform
25
+ import numpy as np
26
+ import pandas as pd
27
+ import matplotlib
28
+
29
+ from . import version
30
+ from . import config as cfg
31
+ from . import utilities as util
32
+
33
+
34
+ from PySide6.QtGui import QPixmap
35
+ from PySide6.QtWidgets import QMessageBox
36
+
37
+
38
+ def actionAbout_activated(self):
39
+ """
40
+ About dialog
41
+ """
42
+
43
+ programs_versions: list[str] = ["MPV media player"]
44
+
45
+ mpv_lib_version, mpv_lib_file_path, mpv_api_version = util.mpv_lib_version()
46
+ programs_versions.append(
47
+ (
48
+ f"Library version: {mpv_lib_version} file: {mpv_lib_file_path}\n"
49
+ f"MPV API version: {mpv_api_version}\n"
50
+ f"python-mpv version: {util.python_mpv_script_version()}"
51
+ )
52
+ )
53
+
54
+ # ffmpeg
55
+ if self.ffmpeg_bin == "ffmpeg" and sys.platform.startswith("linux"):
56
+ ffmpeg_true_path: str = subprocess.getoutput("which ffmpeg")
57
+ else:
58
+ ffmpeg_true_path = self.ffmpeg_bin
59
+ programs_versions.extend(
60
+ [
61
+ "\nFFmpeg",
62
+ subprocess.getoutput(cmd=f'"{self.ffmpeg_bin}" -version').split(sep="\n")[0],
63
+ f"Path: {ffmpeg_true_path}",
64
+ "https://www.ffmpeg.org",
65
+ ]
66
+ )
67
+
68
+ # numpy
69
+ programs_versions.extend(["\nNumpy", f"version {np.__version__}", "https://numpy.org"])
70
+
71
+ # matplotlib
72
+ programs_versions.extend(["\nMatplotlib", f"version {matplotlib.__version__}", "https://matplotlib.org"])
73
+
74
+ # pandas
75
+ programs_versions.extend(["\nPandas", f"version {pd.__version__}", "https://pandas.pydata.org"])
76
+
77
+ # graphviz
78
+ gv_result = subprocess.getoutput(cmd="dot -V")
79
+
80
+ programs_versions.extend(["\nGraphViz", gv_result if "graphviz" in gv_result else "not installed", "https://www.graphviz.org/"])
81
+
82
+ about_dialog: QMessageBox = QMessageBox()
83
+ about_dialog.setIconPixmap(QPixmap(":/boris_unito"))
84
+
85
+ about_dialog.setWindowTitle(f"About {cfg.programName}")
86
+ about_dialog.setStandardButtons(QMessageBox.Ok)
87
+ about_dialog.setDefaultButton(QMessageBox.Ok)
88
+ about_dialog.setEscapeButton(QMessageBox.Ok)
89
+
90
+ about_dialog.setInformativeText(
91
+ (
92
+ f"<b>{cfg.programName}</b> v. {version.__version__} - {version.__version_date__}"
93
+ "<p>Copyright &copy; 2012-2025 Olivier Friard - Marco Gamba<br>"
94
+ "Department of Life Sciences and Systems Biology<br>"
95
+ "University of Torino - Italy<br>"
96
+ "<br>"
97
+ 'BORIS is released under the <a href="https://www.gnu.org/copyleft/gpl.html">GNU General Public License</a><br>'
98
+ 'See <a href="https://www.boris.unito.it">www.boris.unito.it</a> for more details.<br>'
99
+ "<br>"
100
+ "The authors would like to acknowledge Valentina Matteucci for her precious help."
101
+ "<hr>"
102
+ "How to cite BORIS:<br>"
103
+ "Friard, O. and Gamba, M. (2016), BORIS: a free, versatile open-source event-logging software for video/audio "
104
+ "coding and live observations. Methods Ecol Evol, 7: 1325–1330.<br>"
105
+ '<a href="https://besjournals.onlinelibrary.wiley.com/doi/full/10.1111/2041-210X.12584">DOI:10.1111/2041-210X.12584</a>'
106
+ )
107
+ )
108
+ """
109
+ n = "\n"
110
+ current_system = platform.uname()
111
+ details = (
112
+ f"Operating system: {current_system.system} {current_system.release} {current_system.version} \n"
113
+ f"CPU: {current_system.machine} {current_system.processor}\n\n"
114
+ f"Python {platform.python_version()} ({'64-bit' if sys.maxsize > 2**32 else '32-bit'})"
115
+ f"Qt {qVersion()} - PySide {PySide6.__version__}\n"
116
+ )
117
+
118
+ r, memory = util.mem_info()
119
+ if not r:
120
+ details += (
121
+ f"Memory (RAM) Total: {memory.get('total_memory', 'Not available'):.2f} Mb "
122
+ f"Free: {memory.get('free_memory', 'Not available'):.2f} Mb\n\n"
123
+ )
124
+ """
125
+
126
+ details = util.get_systeminfo()
127
+
128
+ details += "\n".join(programs_versions)
129
+ """
130
+ memory_in_use = f"{utilities.rss_memory_used(self.pid)} Mb" if utilities.rss_memory_used(self.pid) != -1 else "Not available"
131
+ percent_memory_in_use = (f"({utilities.rss_memory_percent_used(self.pid):.1f} % of total memory)"
132
+ if utilities.rss_memory_percent_used(self.pid) != -1
133
+ else "")
134
+ """
135
+ """
136
+ f"Total memory: {psutil.virtual_memory().total / 1024 / 1024 / 1024:.1f} Gb "
137
+ f"({100 - psutil.virtual_memory().percent :.1f} % available){n}"
138
+ f"Memory in use by BORIS: {memory_in_use} {percent_memory_in_use}{n}{n}"
139
+ """
140
+
141
+ about_dialog.setDetailedText(details)
142
+
143
+ _ = about_dialog.exec()