boris-behav-obs 8.27.9__py2.py3-none-any.whl → 9.0.1__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/about.py +7 -5
- boris/add_modifier.py +35 -35
- boris/add_modifier_ui.py +229 -129
- boris/advanced_event_filtering.py +3 -3
- boris/analysis_plugins/__init__.py +0 -0
- boris/analysis_plugins/number_of_occurences.py +60 -0
- boris/analysis_plugins/number_of_occurences_by_independent_variable.py +72 -0
- boris/analysis_plugins/time_budget.py +95 -0
- boris/behav_coding_map_creator.py +103 -108
- boris/behavior_binary_table.py +1 -1
- boris/behaviors_coding_map.py +8 -8
- boris/coding_pad.py +6 -6
- boris/config.py +6 -0
- boris/config_file.py +1 -1
- boris/connections.py +4 -2
- boris/converters.py +2 -3
- boris/converters_ui.py +187 -110
- boris/cooccurence.py +2 -2
- boris/core.py +340 -94
- boris/core_qrc.py +16088 -13246
- boris/core_ui.py +922 -812
- boris/db_functions.py +3 -1
- boris/dialog.py +14 -13
- boris/duration_widget.py +5 -5
- boris/edit_event.py +1 -1
- boris/edit_event_ui.py +162 -88
- boris/event_operations.py +4 -25
- boris/events_cursor.py +17 -9
- boris/events_snapshots.py +5 -5
- boris/exclusion_matrix.py +1 -1
- boris/export_events.py +38 -28
- boris/export_observation.py +1 -1
- boris/external_processes.py +3 -5
- boris/geometric_measurement.py +49 -26
- boris/gui_utilities.py +31 -30
- boris/import_observations.py +2 -4
- boris/irr.py +1 -1
- boris/latency.py +1 -1
- boris/map_creator.py +77 -89
- boris/measurement_widget.py +4 -4
- boris/media_file.py +2 -4
- boris/menu_options.py +1 -3
- boris/modifiers_coding_map.py +4 -4
- boris/mpv2.py +0 -2
- boris/observation.py +124 -29
- boris/observation_operations.py +18 -40
- boris/observation_ui.py +566 -374
- boris/observations_list.py +6 -6
- boris/param_panel.py +2 -2
- boris/param_panel_ui.py +246 -141
- boris/player_dock_widget.py +16 -21
- boris/plot_data_module.py +6 -6
- boris/plot_events_rt.py +7 -8
- boris/plot_spectrogram_rt.py +7 -8
- boris/plot_waveform_rt.py +6 -7
- boris/plugins.py +79 -0
- boris/preferences.py +127 -17
- boris/preferences_ui.py +464 -240
- boris/project.py +69 -72
- boris/project_functions.py +233 -31
- boris/project_import_export.py +59 -67
- boris/project_ui.py +672 -440
- boris/qrc_boris.py +6 -3
- boris/qrc_boris5.py +6 -3
- boris/select_modifiers.py +2 -2
- boris/select_observations.py +2 -2
- boris/select_subj_behav.py +3 -3
- boris/state_events.py +1 -1
- boris/subjects_pad.py +5 -5
- boris/synthetic_time_budget.py +2 -2
- boris/time_budget_functions.py +15 -0
- boris/time_budget_widget.py +4 -4
- boris/transitions.py +34 -25
- boris/utilities.py +95 -2
- boris/version.py +2 -2
- boris/video_equalizer.py +4 -4
- boris/video_equalizer_ui.py +199 -130
- boris/video_operations.py +1 -1
- boris/view_df.py +106 -0
- boris/view_df_ui.py +75 -0
- boris/write_event.py +9 -1
- {boris_behav_obs-8.27.9.dist-info → boris_behav_obs-9.0.1.dist-info}/METADATA +5 -5
- boris_behav_obs-9.0.1.dist-info/RECORD +103 -0
- {boris_behav_obs-8.27.9.dist-info → boris_behav_obs-9.0.1.dist-info}/WHEEL +1 -1
- boris/qdarkstyle/__init__.py +0 -479
- boris/qdarkstyle/__main__.py +0 -66
- boris/qdarkstyle/colorsystem.py +0 -38
- boris/qdarkstyle/dark/__init__.py +0 -1
- boris/qdarkstyle/dark/darkstyle_rc.py +0 -11379
- boris/qdarkstyle/dark/palette.py +0 -38
- boris/qdarkstyle/example/__init__.py +0 -4
- boris/qdarkstyle/example/__main__.py +0 -386
- boris/qdarkstyle/example/ui/__init__.py +0 -4
- boris/qdarkstyle/light/__init__.py +0 -1
- boris/qdarkstyle/light/lightstyle_rc.py +0 -11305
- boris/qdarkstyle/light/palette.py +0 -37
- boris/qdarkstyle/palette.py +0 -102
- boris/qdarkstyle/utils/__init__.py +0 -73
- boris/qdarkstyle/utils/__main__.py +0 -96
- boris/qdarkstyle/utils/images.py +0 -449
- boris/qdarkstyle/utils/scss.py +0 -318
- boris/vlc_local.py +0 -83
- boris_behav_obs-8.27.9.dist-info/RECORD +0 -114
- {boris_behav_obs-8.27.9.dist-info → boris_behav_obs-9.0.1.dist-info}/LICENSE.TXT +0 -0
- {boris_behav_obs-8.27.9.dist-info → boris_behav_obs-9.0.1.dist-info}/entry_points.txt +0 -0
- {boris_behav_obs-8.27.9.dist-info → boris_behav_obs-9.0.1.dist-info}/top_level.txt +0 -0
boris/project_import_export.py
CHANGED
|
@@ -28,9 +28,9 @@ import pandas as pd
|
|
|
28
28
|
import tablib
|
|
29
29
|
import pickle
|
|
30
30
|
|
|
31
|
-
from
|
|
32
|
-
from
|
|
33
|
-
from
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
689
|
-
|
|
686
|
+
if not fileName:
|
|
687
|
+
return
|
|
688
|
+
if self.twBehaviors.rowCount() and response == cfg.REPLACE:
|
|
689
|
+
self.twBehaviors.setRowCount(0)
|
|
690
690
|
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
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
|
-
|
|
724
|
-
|
|
725
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|