boris-behav-obs 8.27.6__py2.py3-none-any.whl → 8.27.8__py2.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/core.py CHANGED
@@ -472,7 +472,7 @@ class MainWindow(QMainWindow, Ui_MainWindow):
472
472
  """
473
473
  allow to block Qdockwidgets on main window because they can have a strange behavior specially on Mac
474
474
  """
475
- for w in [self.dwEvents, self.dwEthogram, self.dwSubjects]:
475
+ for w in (self.dwEvents, self.dwEthogram, self.dwSubjects):
476
476
  if self.action_block_dockwidgets.isChecked():
477
477
  w.setFloating(False)
478
478
  w.setFeatures(QDockWidget.NoDockWidgetFeatures)
boris/mpv2.py CHANGED
@@ -868,6 +868,8 @@ class MPV(object):
868
868
  Extra arguments and extra keyword arguments will be passed to mpv as options.
869
869
  """
870
870
 
871
+ print(f"{extra_mpv_flags=}")
872
+
871
873
  self.handle = _mpv_create()
872
874
  self._event_thread = None
873
875
  self._core_shutdown = False
@@ -117,7 +117,7 @@ class DW_player(QDockWidget):
117
117
 
118
118
  self.player = mpv.MPV(
119
119
  wid=str(int(self.videoframe.winId())),
120
- # vo='x11', # You may not need this
120
+ vo="x11" if sys.platform.startswith("linux") else "",
121
121
  log_handler=functools.partial(mpv_logger, self.id_),
122
122
  loglevel="debug",
123
123
  )
boris/preferences.py CHANGED
@@ -146,7 +146,7 @@ def preferences(self):
146
146
  cfg.MPV_HWDEC_OPTIONS.index(self.config_param.get(cfg.MPV_HWDEC, cfg.MPV_HWDEC_DEFAULT_VALUE))
147
147
  )
148
148
  except Exception:
149
- preferencesWindow.cb_hwdec.setCurrentIndex(cfg.MPV_HWDEC_DEFAULT_VALUE)
149
+ preferencesWindow.cb_hwdec.setCurrentIndex(cfg.MPV_HWDEC_OPTIONS.index(cfg.MPV_HWDEC_DEFAULT_VALUE))
150
150
 
151
151
  # PROJET FILE INDENTATION
152
152
  preferencesWindow.combo_project_file_indentation.clear()
@@ -286,7 +286,7 @@ def preferences(self):
286
286
  # interface
287
287
  self.config_param[cfg.TOOLBAR_ICON_SIZE] = preferencesWindow.sb_toolbar_icon_size.value()
288
288
  self.config_param[cfg.DARK_MODE] = preferencesWindow.cb_darkmode.isChecked()
289
- if self.config_param[cfg.DARK_MODE]:
289
+ if self.config_param.get(cfg.DARK_MODE, cfg.DEFAULT_FRAME_MODE):
290
290
  self.setStyleSheet(qdarkstyle.load_stylesheet(qt_api="pyqt5"))
291
291
  else:
292
292
  self.setStyleSheet("")
boris/project.py CHANGED
@@ -430,7 +430,7 @@ class projectDialog(QDialog, Ui_dlgProject):
430
430
  """
431
431
  return a color for the not editable column
432
432
  """
433
- if self.config_param[cfg.DARK_MODE]:
433
+ if self.config_param.get(cfg.DARK_MODE, cfg.DEFAULT_FRAME_MODE):
434
434
  return QColor(55, 65, 79)
435
435
  else:
436
436
  return QColor(230, 230, 230)
@@ -730,7 +730,7 @@ class projectDialog(QDialog, Ui_dlgProject):
730
730
  behavioral categories manager
731
731
  """
732
732
 
733
- bc = BehavioralCategories(self.pj, self.config_param[cfg.DARK_MODE])
733
+ bc = BehavioralCategories(self.pj, self.config_param.get(cfg.DARK_MODE, cfg.DEFAULT_FRAME_MODE))
734
734
 
735
735
  if bc.exec_():
736
736
  self.pj[cfg.BEHAVIORAL_CATEGORIES] = []
@@ -1836,10 +1836,9 @@ class projectDialog(QDialog, Ui_dlgProject):
1836
1836
  # check subjects
1837
1837
  for row in range(self.twSubjects.rowCount()):
1838
1838
  # check key
1839
+ key: str = ""
1839
1840
  if self.twSubjects.item(row, 0):
1840
1841
  key = self.twSubjects.item(row, 0).text()
1841
- else:
1842
- key = ""
1843
1842
 
1844
1843
  # check subject name
1845
1844
  if self.twSubjects.item(row, 1):
@@ -1865,7 +1864,7 @@ class projectDialog(QDialog, Ui_dlgProject):
1865
1864
  return
1866
1865
 
1867
1866
  # description
1868
- subjectDescription = ""
1867
+ subjectDescription: str = ""
1869
1868
  if self.twSubjects.item(row, 2):
1870
1869
  subjectDescription = self.twSubjects.item(row, 2).text().strip()
1871
1870
 
@@ -1875,6 +1874,25 @@ class projectDialog(QDialog, Ui_dlgProject):
1875
1874
  "description": subjectDescription,
1876
1875
  }
1877
1876
 
1877
+ # check if coded subjects are defined in the subjects list
1878
+ subjects_list: list = [self.subjects_conf[x]["name"] for x in self.subjects_conf]
1879
+ coded_subjects = set(
1880
+ util.flatten_list([[y[1] for y in self.pj[cfg.OBSERVATIONS][x].get(cfg.EVENTS, [])] for x in self.pj[cfg.OBSERVATIONS]])
1881
+ )
1882
+
1883
+ not_defined_subjects: list = []
1884
+ for subject in coded_subjects:
1885
+ if subject and subject not in subjects_list:
1886
+ not_defined_subjects.append(subject)
1887
+
1888
+ if not_defined_subjects:
1889
+ QMessageBox.warning(
1890
+ self,
1891
+ cfg.programName,
1892
+ f"The coded subject(s) <b>{', '.join(not_defined_subjects)}</b> is/are not defined in the subjects list.<br>You can use the <b>Explore project</b> to fix it.",
1893
+ )
1894
+ return
1895
+
1878
1896
  self.pj[cfg.SUBJECTS] = dict(self.subjects_conf)
1879
1897
 
1880
1898
  # check ethogram
@@ -379,15 +379,16 @@ def check_project_integrity(
379
379
  media_file_available: bool = True,
380
380
  ) -> str:
381
381
  """
382
- check project integrity
383
- check if behaviors in observations are in ethogram
384
- check unpaired state events
385
- check if timestamp between -2147483647 and 2147483647 (2**31 - 1)
386
- check if behavior belong to behavioral category that do not more exist
387
- check for leading and trailing spaces and special chars in modifiers
388
- check if media file are available
389
- check if media length available
390
- check independent variables
382
+ check project integrity:
383
+ * check if coded behaviors are defined in ethogram
384
+ * check unpaired state events
385
+ * check if timestamp between -2147483647 and 2147483647 (2**31 - 1)
386
+ * check if behavior belong to behavioral category that do not more exist
387
+ * check for leading and trailing spaces and special chars in modifiers
388
+ * check if media file are available (optional)
389
+ * check if media length available
390
+ * check independent variables
391
+ * check if coded subjects are defines
391
392
 
392
393
  Args:
393
394
  pj (dict): BORIS project
@@ -398,7 +399,7 @@ def check_project_integrity(
398
399
  Returns:
399
400
  str: message
400
401
  """
401
- out = ""
402
+ out: str = ""
402
403
 
403
404
  # check if coded behaviors are defined in ethogram
404
405
  r = check_coded_behaviors(pj)
@@ -521,6 +522,14 @@ def check_project_integrity(
521
522
  f" is not allowed for {var_label} (choose between {defined_set_var_label[var_label]})<br>"
522
523
  )
523
524
 
525
+ # check if coded subjects are defined in the subjects list
526
+ subjects_list: list = [pj[cfg.SUBJECTS][x]["name"] for x in pj[cfg.SUBJECTS]]
527
+ coded_subjects = set(util.flatten_list([[y[1] for y in pj[cfg.OBSERVATIONS][x].get(cfg.EVENTS, [])] for x in pj[cfg.OBSERVATIONS]]))
528
+
529
+ for subject in coded_subjects:
530
+ if subject and subject not in subjects_list:
531
+ out += f"The coded subject <b>{subject}</b> is not defined in the subjects list.<br>You can use the <b>Explore project</b> to fix it.<br><br>"
532
+
524
533
  return out
525
534
 
526
535
 
boris/utilities.py CHANGED
@@ -505,6 +505,19 @@ def group_events(pj: dict, obs_id: str, include_modifiers: bool = False) -> dict
505
505
  return {"error": ""}
506
506
 
507
507
 
508
+ def flatten_list(nested_list) -> list:
509
+ """
510
+ Flatten a list of lists.
511
+ """
512
+ flattened: list = []
513
+ for item in nested_list:
514
+ if isinstance(item, list):
515
+ flattened.extend(flatten_list(item))
516
+ else:
517
+ flattened.append(item)
518
+ return flattened
519
+
520
+
508
521
  def get_current_states_modifiers_by_subject(
509
522
  state_behaviors_codes: list, events: list, subjects: dict, time_: dec, include_modifiers: bool = False
510
523
  ) -> dict:
boris/version.py CHANGED
@@ -20,5 +20,5 @@ This file is part of BORIS.
20
20
 
21
21
  """
22
22
 
23
- __version__ = "8.27.6"
24
- __version_date__ = "2024-08-21"
23
+ __version__ = "8.27.8"
24
+ __version_date__ = "2024-08-26"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: boris-behav-obs
3
- Version: 8.27.6
3
+ Version: 8.27.8
4
4
  Summary: BORIS - Behavioral Observation Research Interactive Software
5
5
  Author-email: Olivier Friard <olivier.friard@unito.it>
6
6
  License: GNU GENERAL PUBLIC LICENSE
@@ -720,11 +720,11 @@ BORIS (Behavioral Observation Research Interactive Software)
720
720
  BORIS is an easy-to-use event logging software for video/audio coding or live observations.
721
721
 
722
722
  BORIS is a free and open-source software available for GNU/Linux and Windows.
723
- 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 <http://www.boris.unito.it/pages/download_mac>`_.
723
+ 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/>`_.
724
724
 
725
725
  It provides also some analysis tools like time budget and some plotting functions.
726
726
 
727
- The BORIS paper has more than `1700 citations in peer-reviewed scientific publications <http://www.boris.unito.it/pages/citations.html>`_.
727
+ The BORIS paper has more than `1700 citations in peer-reviewed scientific publications <https://www.boris.unito.it/citations/>`_.
728
728
 
729
729
  See http://www.boris.unito.it
730
730
 
@@ -16,7 +16,7 @@ boris/connections.py,sha256=RIQsaooiz6pzc2jJMHw9CQSyX39TgbM5JAwifCu5eWQ,19280
16
16
  boris/converters.py,sha256=FymqUxLEVLQwsUv6EVF7MRPowN1e87aVT2d3XjZJgAM,11771
17
17
  boris/converters_ui.py,sha256=firMWVgS3c492FF-YFv3FehOBLsbBHKaLEaVcoVctgc,8745
18
18
  boris/cooccurence.py,sha256=scazxKCmFQjBvv7oS9h7ylB8GJdkSmwy1LJZeUv5DOY,9824
19
- boris/core.py,sha256=xkgkxUjAg-mqXORTQUKKPH8FMRMUkAH7UY8QC1NHeJQ,224211
19
+ boris/core.py,sha256=wXJh-oLoiJthPFPjI1ZltODlWrQLxI6Bvh47D5P4RhA,224211
20
20
  boris/core_qrc.py,sha256=5YMpr7ckI4TbXaeSyCMhNJBAlrGPeLes62RedU3EbWs,865287
21
21
  boris/core_ui.py,sha256=Z_6Ehp93fRVnPGyKRtgX2GcXRXb8QZojXipHSpJ_f3M,69854
22
22
  boris/db_functions.py,sha256=YyI2LMSFn772aMGdkOIpfXbPuoSWEvDckZZKevwvB-4,13326
@@ -45,7 +45,7 @@ boris/menu_options.py,sha256=izzYx-Rc7powf8PqhAXD3XMPYvBoVZqOYbS1jaW4sII,7094
45
45
  boris/modifiers_coding_map.py,sha256=XBTubBHw6Sayw5jUNaWR_jVIw6ttaJcbhbmUSF6_lx4,4566
46
46
  boris/mpv-1.0.3.py,sha256=EXRtzQqFjOn4wMC6482Ilq3fNQ9N1GRP1VxwLzdeaBY,88077
47
47
  boris/mpv.py,sha256=EfzIHjPbgewG4w3smEtqEUPZoVwYmMQkL4Q8ZyW-a58,76410
48
- boris/mpv2.py,sha256=IUI4t4r9GYX7G5OXTjd3RhMMOkDdfal_15buBgksLsk,92152
48
+ boris/mpv2.py,sha256=WZaPHXNSMdPZKuQ2ZZiWu_1KViNsnsxg7imSx-yKaXU,92190
49
49
  boris/observation.py,sha256=pHP68WnjA1rZsefo6zNtmwaXcjwjpItZCQrefqwOCCQ,52832
50
50
  boris/observation_operations.py,sha256=eW5DPoU_21EQEWUUmOvqe6flgHxgTcFkGaJjfS6yWJo,100276
51
51
  boris/observation_ui.py,sha256=dfk7pS2DlaiEgMjouH0-_t6kPgMwovQbloHtc3ZoCmY,30278
@@ -53,16 +53,16 @@ boris/observations_list.py,sha256=rMuEVa3QccA89vjARcEVtSlLnr5s0sfihUlcwciV3OM,10
53
53
  boris/otx_parser.py,sha256=Ul5GokK46azx60P6-pk8wbSPUqUR9O4WLV42z3rE40s,16367
54
54
  boris/param_panel.py,sha256=XpFuoNtVuPx_3EieYt0JaQ2J3Bk4ZyMa4RgJha_10oE,7473
55
55
  boris/param_panel_ui.py,sha256=R6Yfxd7m41_Mo5XCD9wlyAprrEKdCyBZm0jicwh_cGk,11704
56
- boris/player_dock_widget.py,sha256=fSGrGTKX4uHuUODyOh5n8ojxdW0wW7PQI1d2md9GBQI,5717
56
+ boris/player_dock_widget.py,sha256=PJHBvpoyrXjrp39EwVS3C8Rw9cNaXsAoPqlQ_wduJI0,5735
57
57
  boris/plot_data_module.py,sha256=OazYAPHker30s1oYYKkSa0IXSj-DbB1-Qgcau0x-Il8,16582
58
58
  boris/plot_events.py,sha256=HAKrdS3qf0A_PG1pGo0FRyk62femDxfxGss3w8CrlUw,23541
59
59
  boris/plot_events_rt.py,sha256=UfO1NKSqBR7j-vnfG8CKuOcdg5o8QQI_0eYdcz29Ufc,8358
60
60
  boris/plot_spectrogram_rt.py,sha256=yc8ifg9HCl-v_upMHkH_rmIZLhWBYkWBOhtKftvRvh0,8394
61
61
  boris/plot_waveform_rt.py,sha256=kNk6NVjM3wT3MpAw5zE9ktH94Pkd2AJ4ppv6uM6BVBc,7502
62
- boris/preferences.py,sha256=W_BHck8lxODvZ9NzIgfvhvXAwUI5A66aJVmdTRTxZMo,11494
62
+ boris/preferences.py,sha256=ySGmCSjqj4rpKksdWNNP2EQEJKVYHCwp3qXyRZG9i8A,11551
63
63
  boris/preferences_ui.py,sha256=fz0jHW7Nqw2P68FLBqheaGrQsZATNz8d8J00TVMX_Ig,21981
64
- boris/project.py,sha256=wMOcWsz7tA-efmHOrKe0_s5I4Vy-u1u_fUTWzxTVdp8,83465
65
- boris/project_functions.py,sha256=R3DS_faDuMGKTpMnV0OhqgZp9yO1ojoA5wUIXdtHNIE,70972
64
+ boris/project.py,sha256=crarDFfAB3lv7BJaVz3yXsS0k9fNiuKUBLTfjaHRzwQ,84361
65
+ boris/project_functions.py,sha256=IM68W1d4U9MpGymKSpMmxmu5-41w2xNdAfZBz8vYbE8,71572
66
66
  boris/project_import_export.py,sha256=E2Jv4CQQpFxGspLZdAIxBcB-aCM7SlfobR5ZlC2QqHk,38463
67
67
  boris/project_ui.py,sha256=TRJlsqq4XbIl8k2f20BKr2PtKa0QNjFNr6UnMieZYqU,35915
68
68
  boris/qrc_boris.py,sha256=4U2cD_fIBTtsTPhirOl9I3kTArOhXWYvfuO_A0M9N0I,675001
@@ -76,8 +76,8 @@ boris/synthetic_time_budget.py,sha256=m3QJ0Ju4av7WzMUKFIvxJd5x4iNVTXc4-j9tWa3MIO
76
76
  boris/time_budget_functions.py,sha256=L-0PuPWYR33UMfqmxpcCVH-w4mLLrtZ8b8kBTmBwlsI,50299
77
77
  boris/time_budget_widget.py,sha256=9WV-iKYSl1f3HBrGcL-eHDjUswrFQh6-WUcffTtce1Y,42852
78
78
  boris/transitions.py,sha256=2zucdoa2jTpWtM6nWHr8lOvjXkrQmo9j71fz_fMLALU,11998
79
- boris/utilities.py,sha256=pNWZAy7Fsu3PrbijjQMDUZRbwkaEoJ6M0FXW6KPuB3E,48781
80
- boris/version.py,sha256=c_t6QM5YfrEuol9HnMRdzd0Xxd-rR3nlsks8vwkCdwM,788
79
+ boris/utilities.py,sha256=VdncrA1hCbMg7zGBKdwcGaBO-EQ3i0-KBHj1ZfHuM4o,49075
80
+ boris/version.py,sha256=GVQrRRG_nuhxMPmOEqfkYDpTsQWODkmLvTItV6N8pjM,788
81
81
  boris/video_equalizer.py,sha256=QpVgmdqX_E4HnMa2f_Qo_fKJTl9nBoTQd_ykv9RWlIQ,5862
82
82
  boris/video_equalizer_ui.py,sha256=A2_Sz9AAVnJygTRUeK_YXxf-WWQpxSSlFw0MjkxiwSg,9762
83
83
  boris/video_operations.py,sha256=96jR-3snNn9VeEURRD6rCwvOL2sSHXoqlP_gYFwgO8A,9379
@@ -106,9 +106,9 @@ boris/qdarkstyle/utils/__init__.py,sha256=Nlma8-zbHoJc5n2NVT7OvwxPG5765JnsmMeGzr
106
106
  boris/qdarkstyle/utils/__main__.py,sha256=J1biUyDzfutKU1n9NdH9WnD0gFHaF-OJA4Q-n6Q2ehs,3309
107
107
  boris/qdarkstyle/utils/images.py,sha256=af-BJllzWgVoVz6QMvhFcKqvF3mo44AThaBjuAuHtNE,14444
108
108
  boris/qdarkstyle/utils/scss.py,sha256=n7WNo6pPRft8-dU7_gfjB_jA-JZAy50-S792RwR7Ri0,9366
109
- boris_behav_obs-8.27.6.dist-info/LICENSE.TXT,sha256=WJ7YI-moTFb-uVrFjnzzhGJrnL9P2iqQe8NuED3hutI,35141
110
- boris_behav_obs-8.27.6.dist-info/METADATA,sha256=9DbnABxSKjvYzzfWNRn4TKzcWLT6_HX1zgq5ZJmgTpk,45526
111
- boris_behav_obs-8.27.6.dist-info/WHEEL,sha256=GUeE9LxUgRABPG7YM0jCNs9cBsAIx0YAkzCB88PMLgc,109
112
- boris_behav_obs-8.27.6.dist-info/entry_points.txt,sha256=fuO7JxKFLOm6xp6m3JHRA1UO_QW1dYU-F0IooA1NqQs,37
113
- boris_behav_obs-8.27.6.dist-info/top_level.txt,sha256=fJSgm62S7WesiwTorGbOO4nNN0yzgZ3klgfGi3Px4qI,6
114
- boris_behav_obs-8.27.6.dist-info/RECORD,,
109
+ boris_behav_obs-8.27.8.dist-info/LICENSE.TXT,sha256=WJ7YI-moTFb-uVrFjnzzhGJrnL9P2iqQe8NuED3hutI,35141
110
+ boris_behav_obs-8.27.8.dist-info/METADATA,sha256=xI4ShJlGxJ4v5NKJl5JnPC2EzL3PHet1x-67J48tRTY,45513
111
+ boris_behav_obs-8.27.8.dist-info/WHEEL,sha256=GUeE9LxUgRABPG7YM0jCNs9cBsAIx0YAkzCB88PMLgc,109
112
+ boris_behav_obs-8.27.8.dist-info/entry_points.txt,sha256=fuO7JxKFLOm6xp6m3JHRA1UO_QW1dYU-F0IooA1NqQs,37
113
+ boris_behav_obs-8.27.8.dist-info/top_level.txt,sha256=fJSgm62S7WesiwTorGbOO4nNN0yzgZ3klgfGi3Px4qI,6
114
+ boris_behav_obs-8.27.8.dist-info/RECORD,,