boris-behav-obs 8.27.10__py2.py3-none-any.whl → 9.0.2__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.
Files changed (105) hide show
  1. boris/about.py +7 -5
  2. boris/add_modifier.py +35 -35
  3. boris/add_modifier_ui.py +229 -129
  4. boris/advanced_event_filtering.py +3 -3
  5. boris/analysis_plugins/__init__.py +0 -0
  6. boris/analysis_plugins/number_of_occurences.py +60 -0
  7. boris/analysis_plugins/number_of_occurences_by_independent_variable.py +72 -0
  8. boris/analysis_plugins/time_budget.py +95 -0
  9. boris/behav_coding_map_creator.py +103 -108
  10. boris/behavior_binary_table.py +1 -1
  11. boris/behaviors_coding_map.py +8 -8
  12. boris/coding_pad.py +6 -6
  13. boris/config.py +6 -0
  14. boris/config_file.py +1 -1
  15. boris/connections.py +4 -2
  16. boris/converters.py +2 -3
  17. boris/converters_ui.py +187 -110
  18. boris/cooccurence.py +2 -2
  19. boris/core.py +341 -94
  20. boris/core_qrc.py +16088 -13246
  21. boris/core_ui.py +922 -812
  22. boris/dialog.py +14 -13
  23. boris/duration_widget.py +5 -5
  24. boris/edit_event.py +1 -1
  25. boris/edit_event_ui.py +162 -88
  26. boris/event_operations.py +4 -25
  27. boris/events_cursor.py +17 -9
  28. boris/events_snapshots.py +5 -5
  29. boris/exclusion_matrix.py +1 -1
  30. boris/export_events.py +38 -28
  31. boris/export_observation.py +1 -1
  32. boris/external_processes.py +3 -5
  33. boris/geometric_measurement.py +49 -26
  34. boris/gui_utilities.py +31 -30
  35. boris/import_observations.py +2 -4
  36. boris/irr.py +1 -1
  37. boris/latency.py +1 -1
  38. boris/map_creator.py +77 -89
  39. boris/measurement_widget.py +4 -4
  40. boris/media_file.py +2 -4
  41. boris/menu_options.py +1 -3
  42. boris/modifiers_coding_map.py +4 -4
  43. boris/mpv2.py +0 -2
  44. boris/observation.py +124 -29
  45. boris/observation_operations.py +18 -40
  46. boris/observation_ui.py +566 -374
  47. boris/observations_list.py +6 -6
  48. boris/param_panel.py +2 -2
  49. boris/param_panel_ui.py +246 -141
  50. boris/player_dock_widget.py +16 -21
  51. boris/plot_data_module.py +6 -6
  52. boris/plot_events_rt.py +7 -8
  53. boris/plot_spectrogram_rt.py +7 -8
  54. boris/plot_waveform_rt.py +6 -7
  55. boris/plugins.py +79 -0
  56. boris/preferences.py +127 -17
  57. boris/preferences_ui.py +464 -240
  58. boris/project.py +69 -72
  59. boris/project_functions.py +233 -31
  60. boris/project_import_export.py +59 -67
  61. boris/project_ui.py +672 -440
  62. boris/qrc_boris.py +6 -3
  63. boris/qrc_boris5.py +6 -3
  64. boris/select_modifiers.py +2 -2
  65. boris/select_observations.py +2 -2
  66. boris/select_subj_behav.py +3 -3
  67. boris/state_events.py +1 -1
  68. boris/subjects_pad.py +5 -5
  69. boris/synthetic_time_budget.py +2 -2
  70. boris/time_budget_functions.py +15 -0
  71. boris/time_budget_widget.py +4 -4
  72. boris/transitions.py +34 -25
  73. boris/utilities.py +96 -3
  74. boris/version.py +2 -2
  75. boris/video_equalizer.py +4 -4
  76. boris/video_equalizer_ui.py +199 -130
  77. boris/video_operations.py +1 -1
  78. boris/view_df.py +106 -0
  79. boris/view_df_ui.py +75 -0
  80. boris/write_event.py +9 -1
  81. {boris_behav_obs-8.27.10.dist-info → boris_behav_obs-9.0.2.dist-info}/METADATA +5 -5
  82. boris_behav_obs-9.0.2.dist-info/RECORD +103 -0
  83. {boris_behav_obs-8.27.10.dist-info → boris_behav_obs-9.0.2.dist-info}/WHEEL +1 -1
  84. boris/qdarkstyle/__init__.py +0 -479
  85. boris/qdarkstyle/__main__.py +0 -66
  86. boris/qdarkstyle/colorsystem.py +0 -38
  87. boris/qdarkstyle/dark/__init__.py +0 -1
  88. boris/qdarkstyle/dark/darkstyle_rc.py +0 -11379
  89. boris/qdarkstyle/dark/palette.py +0 -38
  90. boris/qdarkstyle/example/__init__.py +0 -4
  91. boris/qdarkstyle/example/__main__.py +0 -386
  92. boris/qdarkstyle/example/ui/__init__.py +0 -4
  93. boris/qdarkstyle/light/__init__.py +0 -1
  94. boris/qdarkstyle/light/lightstyle_rc.py +0 -11305
  95. boris/qdarkstyle/light/palette.py +0 -37
  96. boris/qdarkstyle/palette.py +0 -102
  97. boris/qdarkstyle/utils/__init__.py +0 -73
  98. boris/qdarkstyle/utils/__main__.py +0 -96
  99. boris/qdarkstyle/utils/images.py +0 -449
  100. boris/qdarkstyle/utils/scss.py +0 -318
  101. boris/vlc_local.py +0 -83
  102. boris_behav_obs-8.27.10.dist-info/RECORD +0 -114
  103. {boris_behav_obs-8.27.10.dist-info → boris_behav_obs-9.0.2.dist-info}/LICENSE.TXT +0 -0
  104. {boris_behav_obs-8.27.10.dist-info → boris_behav_obs-9.0.2.dist-info}/entry_points.txt +0 -0
  105. {boris_behav_obs-8.27.10.dist-info → boris_behav_obs-9.0.2.dist-info}/top_level.txt +0 -0
@@ -28,9 +28,9 @@ import pandas as pd
28
28
  import tablib
29
29
  import pickle
30
30
 
31
- from PyQt5.QtCore import Qt
32
- from PyQt5.QtGui import QColor, QFont
33
- from PyQt5.QtWidgets import QApplication, QFileDialog, QListWidgetItem, QMessageBox, QTableWidgetItem
31
+ from PySide6.QtCore import Qt
32
+ from PySide6.QtGui import QColor, QFont
33
+ from PySide6.QtWidgets import QApplication, QFileDialog, QListWidgetItem, QMessageBox, QTableWidgetItem
34
34
 
35
35
 
36
36
  from . import config as cfg
@@ -347,7 +347,8 @@ def import_ethogram_from_dict(self, project: dict):
347
347
  if field == cfg.TYPE:
348
348
  item.setText(project[cfg.ETHOGRAM][i][field])
349
349
  item.setFlags(Qt.ItemIsEnabled)
350
- item.setBackground(QColor(230, 230, 230))
350
+ # item.setBackground(QColor(230, 230, 230))
351
+ item.setBackground(self.not_editable_column_color())
351
352
 
352
353
  else:
353
354
  if field == cfg.MODIFIERS:
@@ -369,7 +370,8 @@ def import_ethogram_from_dict(self, project: dict):
369
370
 
370
371
  if field not in cfg.ETHOGRAM_EDITABLE_FIELDS:
371
372
  item.setFlags(Qt.ItemIsEnabled)
372
- item.setBackground(QColor(230, 230, 230))
373
+ # item.setBackground(QColor(230, 230, 230))
374
+ item.setBackground(self.not_editable_column_color())
373
375
 
374
376
  self.twBehaviors.setItem(self.twBehaviors.rowCount() - 1, cfg.behavioursFields[field], item)
375
377
 
@@ -458,7 +460,8 @@ def load_dataframe_into_behaviors_tablewidget(self, df: pd.DataFrame) -> int:
458
460
 
459
461
  if field_type not in cfg.ETHOGRAM_EDITABLE_FIELDS:
460
462
  item.setFlags(Qt.ItemIsEnabled)
461
- item.setBackground(QColor(230, 230, 230))
463
+ # item.setBackground(QColor(230, 230, 230))
464
+ item.setBackground(self.not_editable_column_color())
462
465
 
463
466
  self.twBehaviors.setItem(self.twBehaviors.rowCount() - 1, cfg.behavioursFields[field_type], item)
464
467
 
@@ -469,11 +472,9 @@ def import_behaviors_from_project(self):
469
472
  """
470
473
  import ethogram from a BORIS project file
471
474
  """
472
- fn = QFileDialog().getOpenFileName(
475
+ file_name, _ = QFileDialog.getOpenFileName(
473
476
  self, "Import behaviors from BORIS project file", "", ("Project files (*.boris *.boris.gz);;" "All files (*)")
474
477
  )
475
- file_name = fn[0] if type(fn) is tuple else fn
476
-
477
478
  if not file_name:
478
479
  return
479
480
  _, _, project, _ = project_functions.open_project_json(file_name)
@@ -495,10 +496,9 @@ def import_behaviors_from_text_file(self):
495
496
  if response == cfg.CANCEL:
496
497
  return
497
498
 
498
- fn = QFileDialog().getOpenFileName(
499
+ file_name, _ = QFileDialog.getOpenFileName(
499
500
  self, "Import behaviors from text file (CSV, TSV)", "", "Text files (*.txt *.tsv *.csv);;All files (*)"
500
501
  )
501
- file_name = fn[0] if type(fn) is tuple else fn
502
502
 
503
503
  if not file_name:
504
504
  return
@@ -549,10 +549,9 @@ def import_behaviors_from_spreadsheet(self):
549
549
  if response == cfg.CANCEL:
550
550
  return
551
551
 
552
- fn = QFileDialog().getOpenFileName(
552
+ file_name, _ = QFileDialog.getOpenFileName(
553
553
  self, "Import behaviors from a spreadsheet file", "", "Spreadsheet files (*.xlsx *.ods);;All files (*)"
554
554
  )
555
- file_name = fn[0] if type(fn) is tuple else fn
556
555
 
557
556
  if not file_name:
558
557
  return
@@ -662,7 +661,8 @@ def import_behaviors_from_clipboard(self):
662
661
 
663
662
  if field_type not in cfg.ETHOGRAM_EDITABLE_FIELDS: # [TYPE, "excluded", "coding map", "modifiers", "category"]:
664
663
  item.setFlags(Qt.ItemIsEnabled)
665
- item.setBackground(QColor(230, 230, 230))
664
+ # item.setBackground(QColor(230, 230, 230))
665
+ item.setBackground(self.not_editable_column_color())
666
666
 
667
667
  self.twBehaviors.setItem(self.twBehaviors.rowCount() - 1, cfg.behavioursFields[field_type], item)
668
668
 
@@ -681,50 +681,51 @@ def import_behaviors_from_JWatcher(self):
681
681
  if response == cfg.CANCEL:
682
682
  return
683
683
 
684
- fn = QFileDialog().getOpenFileName(self, "Import behaviors from JWatcher", "", "Global Definition File (*.gdf);;All files (*)")
685
- fileName = fn[0] if type(fn) is tuple else fn
684
+ fileName, _ = QFileDialog().getOpenFileName(self, "Import behaviors from JWatcher", "", "Global Definition File (*.gdf);;All files (*)")
686
685
 
687
- if fileName:
688
- if self.twBehaviors.rowCount() and response == cfg.REPLACE:
689
- self.twBehaviors.setRowCount(0)
686
+ if not fileName:
687
+ return
688
+ if self.twBehaviors.rowCount() and response == cfg.REPLACE:
689
+ self.twBehaviors.setRowCount(0)
690
690
 
691
- with open(fileName, "r") as f:
692
- rows = f.readlines()
693
-
694
- for idx, row in enumerate(rows):
695
- if row and row[0] == "#":
696
- continue
697
-
698
- if "Behavior.name." in row and "=" in row:
699
- key, code = row.split("=")
700
- key = key.replace("Behavior.name.", "")
701
- # read description
702
- if idx < len(rows) and "Behavior.description." in rows[idx + 1]:
703
- description = rows[idx + 1].split("=")[-1]
704
-
705
- behavior = {
706
- "key": key,
707
- "code": code,
708
- "description": description,
709
- "modifiers": "",
710
- "excluded": "",
711
- "coding map": "",
712
- "category": "",
713
- }
714
-
715
- self.twBehaviors.setRowCount(self.twBehaviors.rowCount() + 1)
716
-
717
- for field_type in cfg.behavioursFields:
718
- if field_type == cfg.TYPE:
719
- item = QTableWidgetItem(cfg.DEFAULT_BEHAVIOR_TYPE)
720
- else:
721
- item = QTableWidgetItem(behavior[field_type])
691
+ with open(fileName, "r") as f:
692
+ rows = f.readlines()
693
+
694
+ for idx, row in enumerate(rows):
695
+ if row and row[0] == "#":
696
+ continue
697
+
698
+ if "Behavior.name." in row and "=" in row:
699
+ key, code = row.split("=")
700
+ key = key.replace("Behavior.name.", "")
701
+ # read description
702
+ if idx < len(rows) and "Behavior.description." in rows[idx + 1]:
703
+ description = rows[idx + 1].split("=")[-1]
704
+
705
+ behavior = {
706
+ "key": key,
707
+ "code": code,
708
+ "description": description,
709
+ "modifiers": "",
710
+ "excluded": "",
711
+ "coding map": "",
712
+ "category": "",
713
+ }
714
+
715
+ self.twBehaviors.setRowCount(self.twBehaviors.rowCount() + 1)
722
716
 
723
- if field_type in [cfg.TYPE, "excluded", "category", "coding map", "modifiers"]:
724
- item.setFlags(Qt.ItemIsEnabled)
725
- item.setBackground(QColor(230, 230, 230))
717
+ for field_type in cfg.behavioursFields:
718
+ if field_type == cfg.TYPE:
719
+ item = QTableWidgetItem(cfg.DEFAULT_BEHAVIOR_TYPE)
720
+ else:
721
+ item = QTableWidgetItem(behavior[field_type])
726
722
 
727
- self.twBehaviors.setItem(self.twBehaviors.rowCount() - 1, cfg.behavioursFields[field_type], item)
723
+ if field_type in [cfg.TYPE, "excluded", "category", "coding map", "modifiers"]:
724
+ item.setFlags(Qt.ItemIsEnabled)
725
+ # item.setBackground(QColor(230, 230, 230))
726
+ item.setBackground(self.not_editable_column_color())
727
+
728
+ self.twBehaviors.setItem(self.twBehaviors.rowCount() - 1, cfg.behavioursFields[field_type], item)
728
729
 
729
730
 
730
731
  def import_behaviors_from_repository(self):
@@ -885,11 +886,9 @@ def import_subjects_from_project(self):
885
886
  import subjects from a BORIS project
886
887
  """
887
888
 
888
- fn = QFileDialog().getOpenFileName(
889
+ file_name, _ = QFileDialog().getOpenFileName(
889
890
  self, "Import subjects from project file", "", ("Project files (*.boris *.boris.gz);;" "All files (*)")
890
891
  )
891
- file_name = fn[0] if type(fn) is tuple else fn
892
-
893
892
  if not file_name:
894
893
  return
895
894
 
@@ -949,11 +948,9 @@ def import_subjects_from_text_file(self):
949
948
  if response == cfg.CANCEL:
950
949
  return
951
950
 
952
- fn = QFileDialog().getOpenFileName(
951
+ file_name, _ = QFileDialog().getOpenFileName(
953
952
  self, "Import behaviors from text file (CSV, TSV)", "", "Text files (*.txt *.tsv *.csv);;All files (*)"
954
953
  )
955
- file_name = fn[0] if type(fn) is tuple else fn
956
-
957
954
  if not file_name:
958
955
  return
959
956
 
@@ -1004,11 +1001,9 @@ def import_subjects_from_spreadsheet(self):
1004
1001
  if response == cfg.CANCEL:
1005
1002
  return
1006
1003
 
1007
- fn = QFileDialog().getOpenFileName(
1004
+ file_name, _ = QFileDialog().getOpenFileName(
1008
1005
  self, "Import subjects from a spreadsheet file", "", "Spreadsheet files (*.xlsx *.ods);;All files (*)"
1009
1006
  )
1010
- file_name = fn[0] if type(fn) is tuple else fn
1011
-
1012
1007
  if not file_name:
1013
1008
  return
1014
1009
 
@@ -1049,15 +1044,12 @@ def import_indep_variables_from_project(self):
1049
1044
  import independent variables from another project
1050
1045
  """
1051
1046
 
1052
- fn = QFileDialog().getOpenFileName(
1047
+ file_name, _ = QFileDialog().getOpenFileName(
1053
1048
  self,
1054
1049
  "Import independent variables from project file",
1055
1050
  "",
1056
1051
  ("Project files (*.boris *.boris.gz);;" "All files (*)"),
1057
1052
  )
1058
-
1059
- file_name = fn[0] if type(fn) is tuple else fn
1060
-
1061
1053
  if not file_name:
1062
1054
  return
1063
1055