boris-behav-obs 9.7.2__py3-none-any.whl → 9.7.4__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/about.py CHANGED
@@ -40,7 +40,7 @@ def actionAbout_activated(self):
40
40
  About dialog
41
41
  """
42
42
 
43
- programs_versions: list = ["MPV media player"]
43
+ programs_versions: list[str] = ["MPV media player"]
44
44
 
45
45
  mpv_lib_version, mpv_lib_file_path, mpv_api_version = util.mpv_lib_version()
46
46
  programs_versions.append(
@@ -53,13 +53,13 @@ def actionAbout_activated(self):
53
53
 
54
54
  # ffmpeg
55
55
  if self.ffmpeg_bin == "ffmpeg" and sys.platform.startswith("linux"):
56
- ffmpeg_true_path = subprocess.getoutput("which ffmpeg")
56
+ ffmpeg_true_path: str = subprocess.getoutput("which ffmpeg")
57
57
  else:
58
58
  ffmpeg_true_path = self.ffmpeg_bin
59
59
  programs_versions.extend(
60
60
  [
61
61
  "\nFFmpeg",
62
- subprocess.getoutput(f'"{self.ffmpeg_bin}" -version').split("\n")[0],
62
+ subprocess.getoutput(cmd=f'"{self.ffmpeg_bin}" -version').split(sep="\n")[0],
63
63
  f"Path: {ffmpeg_true_path}",
64
64
  "https://www.ffmpeg.org",
65
65
  ]
@@ -75,11 +75,11 @@ def actionAbout_activated(self):
75
75
  programs_versions.extend(["\nPandas", f"version {pd.__version__}", "https://pandas.pydata.org"])
76
76
 
77
77
  # graphviz
78
- gv_result = subprocess.getoutput("dot -V")
78
+ gv_result = subprocess.getoutput(cmd="dot -V")
79
79
 
80
80
  programs_versions.extend(["\nGraphViz", gv_result if "graphviz" in gv_result else "not installed", "https://www.graphviz.org/"])
81
81
 
82
- about_dialog = QMessageBox()
82
+ about_dialog: QMessageBox = QMessageBox()
83
83
  about_dialog.setIconPixmap(QPixmap(":/boris_unito"))
84
84
 
85
85
  about_dialog.setWindowTitle(f"About {cfg.programName}")
boris/core.py CHANGED
@@ -3950,7 +3950,14 @@ class MainWindow(QMainWindow, Ui_MainWindow):
3950
3950
  slider_position = self.video_slider.value() / (cfg.SLIDER_MAXIMUM - 1)
3951
3951
  if self.dw_player[0].player.duration is None:
3952
3952
  return
3953
- video_position = slider_position * self.dw_player[0].player.duration
3953
+ print(f"{slider_position=}")
3954
+
3955
+ d = self.dw_player[0].player.duration
3956
+ print(f"{d=}")
3957
+ if d is None:
3958
+ return
3959
+ video_position = slider_position * d
3960
+ #video_position = slider_position * self.dw_player[0].player.duration
3954
3961
  # self.dw_player[0].player.command("seek", str(video_position), "absolute")
3955
3962
  self.dw_player[0].player.seek(video_position, "absolute")
3956
3963
 
@@ -4311,8 +4318,6 @@ class MainWindow(QMainWindow, Ui_MainWindow):
4311
4318
 
4312
4319
  self.actionPlay.setIcon(QIcon(f":/play_{gui_utilities.theme_mode()}"))
4313
4320
 
4314
- print(f"{msg=}")
4315
-
4316
4321
  if msg:
4317
4322
  self.lb_current_media_time.setText(msg)
4318
4323
 
boris/ipc_mpv.py CHANGED
@@ -36,6 +36,7 @@ class IPC_MPV:
36
36
  self.process = subprocess.Popen(
37
37
  [
38
38
  "mpv",
39
+ "--ontop",
39
40
  "--no-border",
40
41
  "--osc=no", # no on screen commands
41
42
  "--input-ipc-server=" + self.socket_path,
@@ -48,30 +49,6 @@ class IPC_MPV:
48
49
  stderr=subprocess.PIPE,
49
50
  )
50
51
 
51
- '''
52
- def init_socket(self):
53
- """
54
- Initialize the JSON IPC socket.
55
- """
56
- print("init socket")
57
- self.sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
58
- QTimer.singleShot(5000, self.connect_socket) # Allow time for mpv to initialize
59
- '''
60
-
61
- '''
62
- def connect_socket(self):
63
- """
64
- Connect to the mpv IPC socket.
65
- """
66
- print("connect socket")
67
- try:
68
- self.sock.connect(self.socket_path)
69
- print("Connected to mpv IPC server.")
70
- except socket.error as e:
71
- print(f"Failed to connect to mpv IPC server: {e}")
72
- print("end of connect_socket fucntion")
73
- '''
74
-
75
52
  def send_command(self, command):
76
53
  """
77
54
  Send a JSON command to the mpv IPC server.
@@ -92,9 +69,7 @@ class IPC_MPV:
92
69
  # Parse the response as JSON
93
70
  response_data = json.loads(response.decode("utf-8"))
94
71
  if response_data["error"] != "success":
95
- print(f"send command: {command}")
96
- print(f"{response_data=}")
97
- print()
72
+ logging.warning(f"send command: {command} response data: {response_data}")
98
73
  # Return the 'data' field which contains the playback position
99
74
  return response_data.get("data")
100
75
  except FileNotFoundError:
@@ -128,7 +103,6 @@ class IPC_MPV:
128
103
 
129
104
  @pause.setter
130
105
  def pause(self, value):
131
- print(f"set pause to {value}")
132
106
  return self.send_command({"command": ["set_property", "pause", value]})
133
107
 
134
108
  @property
@@ -168,7 +142,6 @@ class IPC_MPV:
168
142
  @property
169
143
  def playback_time(self):
170
144
  playback_time_ = self.send_command({"command": ["get_property", "playback-time"]})
171
- print(f"playback_time: {playback_time_}")
172
145
  return playback_time_
173
146
 
174
147
  def frame_step(self):
boris/observation.py CHANGED
@@ -42,6 +42,7 @@ from PySide6.QtWidgets import (
42
42
  QApplication,
43
43
  QMenu,
44
44
  QListWidgetItem,
45
+ QHeaderView
45
46
  )
46
47
 
47
48
  from . import config as cfg
@@ -224,6 +225,10 @@ class Observation(QDialog, Ui_Form):
224
225
  self.pbCancel.clicked.connect(self.pbCancel_clicked)
225
226
 
226
227
  self.tw_data_files.cellDoubleClicked[int, int].connect(self.tw_data_files_cellDoubleClicked)
228
+ self.tw_data_files.horizontalHeader().setSectionResizeMode(QHeaderView.ResizeToContents)
229
+
230
+ self.twVideo1.horizontalHeader().setSectionResizeMode(QHeaderView.ResizeToContents)
231
+
227
232
 
228
233
  self.mediaDurations, self.mediaFPS, self.mediaHasVideo, self.mediaHasAudio, self.media_creation_time = {}, {}, {}, {}, {}
229
234
 
@@ -1964,7 +1964,7 @@ def initialize_new_media_observation(self) -> bool:
1964
1964
 
1965
1965
  menu_options.update_menu(self)
1966
1966
 
1967
- if not self.MPV_IPC_MODE:
1967
+ if self.MPV_IPC_MODE:
1968
1968
  # activate timer
1969
1969
  self.ipc_mpv_timer = QTimer()
1970
1970
  self.ipc_mpv_timer.setInterval(500)
boris/plot_data_module.py CHANGED
@@ -134,6 +134,8 @@ class Plot_data(QWidget):
134
134
  column_converter=column_converter,
135
135
  )
136
136
 
137
+ print(f"{error_msg=}")
138
+
137
139
  if not result:
138
140
  self.error_msg = error_msg
139
141
  return
boris/utilities.py CHANGED
@@ -471,17 +471,34 @@ def txt2np_array(
471
471
  conv_name = column_converter[column_idx]
472
472
 
473
473
  function = f"""def {conv_name}(INPUT):\n"""
474
- function += """ INPUT = INPUT.decode("utf-8") if isinstance(INPUT, bytes) else INPUT"""
474
+ function += """ INPUT = INPUT.decode("utf-8") if isinstance(INPUT, bytes) else INPUT\n\n"""
475
475
  for line in converters[conv_name]["code"].split("\n"):
476
476
  function += f" {line}\n"
477
477
  function += """ return OUTPUT"""
478
478
 
479
+
480
+ print('=============')
481
+ print(function)
482
+ print('=============')
483
+
484
+ import types
485
+ mod = types.ModuleType("converter_module")
486
+ exec(function, mod.__dict__)
487
+
488
+ '''
479
489
  try:
480
490
  exec(function)
481
491
  except Exception:
482
492
  return False, f"error in converter: {sys.exc_info()[1]}", np.array([])
483
493
 
484
- np_converters[column_idx - 1] = locals()[conv_name]
494
+ print(f"{converters=}")
495
+ print(f"{column_converter=}")
496
+ print(locals())
497
+ print(f"{conv_name=}")
498
+ '''
499
+
500
+ #np_converters[column_idx - 1] = locals()['conv_name']
501
+ np_converters[column_idx - 1] = getattr(mod, conv_name)
485
502
 
486
503
  else:
487
504
  return False, f"converter {cfg.converters_param[column_idx]} not found", np.array([])
boris/version.py CHANGED
@@ -20,5 +20,5 @@ This file is part of BORIS.
20
20
 
21
21
  """
22
22
 
23
- __version__ = "9.7.2"
24
- __version_date__ = "2025-10-24"
23
+ __version__ = "9.7.4"
24
+ __version_date__ = "2025-11-06"
boris/video_operations.py CHANGED
@@ -231,6 +231,10 @@ def display_zoom_level(self) -> None:
231
231
  """
232
232
  msg: str = "Zoom level: <b>"
233
233
  for player in self.dw_player:
234
+ vz = player.player.video_zoom
235
+ if vz is None:
236
+ self.lb_zoom_level.setText("-")
237
+ return
234
238
  msg += f"{2**player.player.video_zoom:.1f} "
235
239
  msg += "</b>"
236
240
  self.lb_zoom_level.setText(msg)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: boris-behav-obs
3
- Version: 9.7.2
3
+ Version: 9.7.4
4
4
  Summary: BORIS - Behavioral Observation Research Interactive Software
5
5
  Author-email: Olivier Friard <olivier.friard@unito.it>
6
6
  License-Expression: GPL-3.0-only
@@ -44,15 +44,14 @@ BORIS (Behavioral Observation Research Interactive Software)
44
44
 
45
45
  BORIS is an easy-to-use event logging software for video/audio coding or live observations.
46
46
 
47
- BORIS is a free and open-source software available for GNU/Linux and Windows.
48
- You can not longer run BORIS natively on MacOS (since v.8). Some alternatives to run the last version of BORIS are available, see [BORIS on MacOS](https://www.boris.unito.it/download_mac).
47
+ BORIS is a free and open-source software available for GNU/Linux, Windows and macOS.
49
48
 
50
49
  It provides also some analysis tools like time budget and some plotting functions.
51
50
 
52
51
  <!-- The BO-RIS paper has more than [![BORIS citations counter](https://penelope.unito.it/friard/boris_scopus_citations.png) citations](https://www.boris.unito.it/citations) in peer-reviewed scientific publications. -->
53
52
 
54
53
 
55
- The BORIS paper has more than 2407 citations in peer-reviewed scientific publications.
54
+ The BORIS paper has more than 2423 citations in peer-reviewed scientific publications.
56
55
 
57
56
 
58
57
 
@@ -1,6 +1,6 @@
1
1
  boris/__init__.py,sha256=iAtmVMy22TJpMmxVTMSK_6-wXnCbx1ogvWgfYEcbHzU,773
2
2
  boris/__main__.py,sha256=ANjTbXgXDoz2nB1tCtOIllfIVotCa602iebACX7rXaE,764
3
- boris/about.py,sha256=VPa8zeu0bMb1LRXDq8uUSG_7mSbkb2HTk1AtWbzWQwE,5366
3
+ boris/about.py,sha256=RrK4fUbMUpyMWPZVmFYG91pVx_orvaLPw-OBWI_NcOg,5401
4
4
  boris/add_modifier.py,sha256=l9LSa_9FAV9CnBgm26tJqhMAdnFoBQafZLyt9pTKmac,26240
5
5
  boris/add_modifier_ui.py,sha256=Y7TLO5uS6zW7zpjXmjA4V_VIp_bFDNtjOTbJ9Q6m-mQ,11601
6
6
  boris/advanced_event_filtering.py,sha256=VlvU12mL6xYacZOvJAi5uLpHMcmAw5Pvuvmka-PN29c,15469
@@ -16,7 +16,7 @@ boris/connections.py,sha256=KsC17LnS4tRM6O3Nu3mD1H9kQ7uYhhad9229jXfGF94,19774
16
16
  boris/converters.py,sha256=n6gDM9x2hS-ZOoHLruiifuXxnC7ERsUukiFokhHZPoQ,11678
17
17
  boris/converters_ui.py,sha256=uu7LOBV_fKv2DBdOqsqPwjGsjgONr5ODBoscAA-EP48,9900
18
18
  boris/cooccurence.py,sha256=tVERC-V8MWjWHlGEfDuu08iS94qjt4do-38jwI62QaY,10367
19
- boris/core.py,sha256=TmKbiFFk3mh_cl4KNLJWwGpc3z4Sz_lh_T9Mqy7P68Q,232241
19
+ boris/core.py,sha256=0l6wXCn88zfFBTqKx4fw4548i-hTwVi-JDzM3jE7ED0,232445
20
20
  boris/core_qrc.py,sha256=Hz51Xw70ZIlDbYB281nfGtCm43_ItYhamMu2T5X8Tu8,639882
21
21
  boris/core_ui.py,sha256=uDAI9mbadBe2mSsgugzNfRHxASc6Mu5kUf5tB9CZCjY,77445
22
22
  boris/db_functions.py,sha256=TfCJ0Hq0pTFOKrZz3RzdvnR-NKCmrPHU2qL9BSXeeGQ,13379
@@ -36,7 +36,7 @@ boris/geometric_measurement.py,sha256=4pI-AYpBSFlJBqS-f8dnkgLtj_Z2E5kwwAdh6WwZ4k
36
36
  boris/gui_utilities.py,sha256=Kv75XgFmicPUKvdRPj_yBYoDNc912cfl1IQrgw5T2kI,5458
37
37
  boris/image_overlay.py,sha256=zZAL8MTt2i2s58CuX81Nym3rJ5pKiTeP4AO8WbIUonM,2527
38
38
  boris/import_observations.py,sha256=zKrkpk1ADxTj2BECactPPOhU6wtrh3TjtOWue2HCT5w,9074
39
- boris/ipc_mpv.py,sha256=12x1Nthp4nsYsS39fbZK9B0Jl4hCrlS2wszg680wduQ,9222
39
+ boris/ipc_mpv.py,sha256=Hb-RglR4UV1JcgK_jxKNUw0HZA4x2z_tfD7fR1gxFBY,8432
40
40
  boris/irr.py,sha256=n6Y_Y9iEKOf9_7EE_lDRNei7tq2wkFKk_JVflm9UQdk,22335
41
41
  boris/latency.py,sha256=48z9L_A582-wKCfD0M3h0uyYkeL2ezjlQAS_GzeoOe0,9739
42
42
  boris/measurement_widget.py,sha256=lZV62KtK6TjdoNbKxj3uyNAuL5dfnQnn7mYwzMo-dOM,4480
@@ -46,15 +46,15 @@ boris/modifier_coding_map_creator.py,sha256=3Ihh75TCNI0KkQKHuosYibAhGbdgjdlRZGmn
46
46
  boris/modifiers_coding_map.py,sha256=oT56ZY_PXhEJsMoblEsyNMAPbDpv7ZMOCnvmt7Ibx_Y,4554
47
47
  boris/mpv.py,sha256=EfzIHjPbgewG4w3smEtqEUPZoVwYmMQkL4Q8ZyW-a58,76410
48
48
  boris/mpv2.py,sha256=IUI4t4r9GYX7G5OXTjd3RhMMOkDdfal_15buBgksLsk,92152
49
- boris/observation.py,sha256=10UkVyY8TDySntIX_-H-IsuFdiF6tEcmC6JQUzD6wYg,57139
50
- boris/observation_operations.py,sha256=mOx3dU8x6LQF4TBVhyyWBo4yyonpvPMyaLoHLdlmrrc,105716
49
+ boris/observation.py,sha256=OuDfvwDm7fHX31N__pE5JNOG9gt22rUEMHvue-ruURE,57346
50
+ boris/observation_operations.py,sha256=PdP9K6A7z1EoOhuBQzBJo-X2vM1vJavGGgtUNBeKJ9o,105712
51
51
  boris/observation_ui.py,sha256=DAnU94QBNvkLuHT6AxTwqSk_D_n6VUhSl8PexZv_dUk,33309
52
52
  boris/observations_list.py,sha256=NqwECGHtHYmKhSe-qCfqPmJ24SSfzlXvIXS2i3op_zE,10591
53
53
  boris/otx_parser.py,sha256=70QvilzFHXbjAHR88YH0aEXJ3xxheLS5fZGgHFHGpNE,16367
54
54
  boris/param_panel.py,sha256=C7MzWg-OVjjxKbXPFC0ykOLpxbwsqEmG0jWgzBUwOEA,8695
55
55
  boris/param_panel_ui.py,sha256=4emQDFmuL4_R7bKxosLjdUb-VSPWkDm7suy38F5EKcA,13260
56
56
  boris/player_dock_widget.py,sha256=rdP0w6Wac7R3UMqJeHl7GNvT1hElu_x_VgNkg4Ut-6s,5880
57
- boris/plot_data_module.py,sha256=6QbLKfyGp4TYRyHnB9G45y5XrpeXLytcorltEAWfYak,16562
57
+ boris/plot_data_module.py,sha256=Xq70HDlAtvganwNmbRDUA3iKV-415zS9W1H1x0itXWE,16594
58
58
  boris/plot_events.py,sha256=tKiUWH0TNSkK7xz5Vf0tAD3KiuAalv6UZEVtOnoFpWY,24059
59
59
  boris/plot_events_rt.py,sha256=xJmjwqhQxCN4FDBYRQ0O2eHm356Rbexzr3m1qTefMDU,8326
60
60
  boris/plot_spectrogram_rt.py,sha256=wDhnkqwjd2UfCxrfOejOUxoNOqfMNo6vo1JSvYgM-2A,10925
@@ -77,11 +77,11 @@ boris/synthetic_time_budget.py,sha256=3Eb9onMLmgqCLd50CuxV9L8RV2ESzfaMWvPK_bXUMM
77
77
  boris/time_budget_functions.py,sha256=SbGyTF2xySEqBdRJZeWFTirruvK3r6pwM6e4Gz17W1s,52186
78
78
  boris/time_budget_widget.py,sha256=z-tyITBtIz-KH1H2OdMB5a8x9QQLK7Wu96-zkC6NVDA,43213
79
79
  boris/transitions.py,sha256=okyDCO-Vn4p_Fixd8cGiSIaUhUxG5ePIOqGSuP52g_c,12246
80
- boris/utilities.py,sha256=BJXl8IZHQC93ZcaN9cQrWmrg3Rr3F8_Q71Tz6Im3A0s,58104
81
- boris/version.py,sha256=nxNEQuFMlM61a6BDWkA3uvxezVOOghrY584zWJMO4IU,787
80
+ boris/utilities.py,sha256=wJ3McqdyBTRNPSBE3LvkHEt0YbbM1ny6W1vT0FKcMqk,58575
81
+ boris/version.py,sha256=e0Scia5msD55tBuK8IDVQvgCLY6gJGc3GwFv8heEAWQ,787
82
82
  boris/video_equalizer.py,sha256=cm2JXe1eAPkqDzxYB2OMKyuveMBdq4a9-gD1bBorbn4,5823
83
83
  boris/video_equalizer_ui.py,sha256=1CG3s79eM4JAbaCx3i1ILZXLceb41_gGXlOLNfpBgnw,10142
84
- boris/video_operations.py,sha256=BbH9NXfNL597edX2nX0s6dJcQIvv--_DXx2kjhLAkfo,10799
84
+ boris/video_operations.py,sha256=i38CTLpD1WbkQr4WA7Mj5_47ouqDvcVgPgZ6wUyggwA,10923
85
85
  boris/view_df.py,sha256=fhcNMFFVbQ4ZTpPwN_4Bg66DDIoV25zaPryZUsOxsKg,3338
86
86
  boris/view_df_ui.py,sha256=CaMeRH_vQ00CTDDFQn73ZZaS-r8BSTWpL-dMCFqzJ_Q,2775
87
87
  boris/write_event.py,sha256=xC-dUjgPS4-tvrQfvyL7O_xi-tyQI7leSiSV8_x8hgg,23817
@@ -101,9 +101,9 @@ boris/portion/dict.py,sha256=uNM-LEY52CZ2VNMMW_C9QukoyTvPlQf8vcbGa1lQBHI,11281
101
101
  boris/portion/func.py,sha256=mSQr20YS1ug7R1fRqBg8LifjtXDRvJ6Kjc3WOeL9P34,2172
102
102
  boris/portion/interval.py,sha256=sOlj3MAGGaB-JxCkigS-n3qw0fY7TANAsXv1pavr8J4,19931
103
103
  boris/portion/io.py,sha256=kpq44pw3xnIyAlPwaR5qRHKRdZ72f8HS9YVIWs5k2pk,6367
104
- boris_behav_obs-9.7.2.dist-info/licenses/LICENSE.TXT,sha256=WJ7YI-moTFb-uVrFjnzzhGJrnL9P2iqQe8NuED3hutI,35141
105
- boris_behav_obs-9.7.2.dist-info/METADATA,sha256=P6RFby3ZA3MRjLFNQyoVzUl9asye-9vIbGOw08fMEUc,5385
106
- boris_behav_obs-9.7.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
107
- boris_behav_obs-9.7.2.dist-info/entry_points.txt,sha256=k__8XvFi4vaA4QFvQehCZjYkKmZH34HSAJI2iYCWrMs,52
108
- boris_behav_obs-9.7.2.dist-info/top_level.txt,sha256=fJSgm62S7WesiwTorGbOO4nNN0yzgZ3klgfGi3Px4qI,6
109
- boris_behav_obs-9.7.2.dist-info/RECORD,,
104
+ boris_behav_obs-9.7.4.dist-info/licenses/LICENSE.TXT,sha256=WJ7YI-moTFb-uVrFjnzzhGJrnL9P2iqQe8NuED3hutI,35141
105
+ boris_behav_obs-9.7.4.dist-info/METADATA,sha256=JM3ejmFrqtzq30zoE2GkY9wrW72VsZLp9AvxtPqQu_k,5203
106
+ boris_behav_obs-9.7.4.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
107
+ boris_behav_obs-9.7.4.dist-info/entry_points.txt,sha256=k__8XvFi4vaA4QFvQehCZjYkKmZH34HSAJI2iYCWrMs,52
108
+ boris_behav_obs-9.7.4.dist-info/top_level.txt,sha256=fJSgm62S7WesiwTorGbOO4nNN0yzgZ3klgfGi3Px4qI,6
109
+ boris_behav_obs-9.7.4.dist-info/RECORD,,